Tuesday, April 26, 2011

Kevin's Week 13 Report

This week I worked on making a few modifications to the sensor reading tool and the website.  For the sensor tool, I added in a check where if the serial port is unable to read data from the sensor, due to it being unplugged, it will set the sensor value reading to 0.  This is needed so that a reading is at least being put in, so that if a full minute goes by where the cable is unplugged, the program will not crash.  I also made a modification to the website in terms of viewing available data.  Beforehand, when the browse tab was initially opened, if a full days worth of data had not been collected, then you could not view data from that year.  On the initial browse page, I was checking the day data table to see if there was data, I instead switched it to the minute data and now I can view that data.  I met with Andrew and Ashley yesterday to work on getting the numbers from the system into our database.  We are still working on getting the correct numbers into the database, as there is too much fluctuation between data right now.  There seems to be some timing issue with reading the data.  We tried switching the reading to every two seconds on my end, in order to give the calculation and transmission enough time to complete, however, we still saw data that was not consistent.

I was able to view the website on other computers connected to the router.  Now I will finish up getting the final touches on the sensor tool and website, just getting it ready for installation and I will continue to work with Ashley on getting consistent data coming in.  I will also start gathering up the documentation I need for the reports.

Andrew's Week 13 Report

Last week ended with our project failing to work after moving the circuit into its new enclosure.  To eliminate variables on the lack of operation I began replacing components and rewiring signal wires to ensure less noise in our system.  Despite these modifications our circuit was still not functioning correctly.  Finally I decided to look at the output of our shunt resistor which is used to measure current.  I reused the amplifier circuit I created several weeks prior to test the shunt.  Comparing the output wave of the shunt with the waveforms I collected several weeks prior I immediately noticed that our shunt was acting very differently.  The waveform was no longer sinusoidal but more of a spike which didnt change as our load increased or decreased.  I concluded that either the shunt resistor was broke (most likely not since it is a very simple component) or there was an increase in noise on the neutral line which I was measuring across.  Due to this Ashley ordered another shunt resistor and I was able to obtain a 150:5 current transformer from an electrical client: Wendling Quarries.  After testing the new shunt resistor there was still an odd waveform so I began changing the circuit so that the current transformer could be used to measure current. 
By using a current transformer I was able to measure current at the 120V end of the circuit which generally has less harmonic distortion present.  Also by using the CT we are able to produce a larger signal without having to dissipate much power like a shunt would.  Connecting the CT to the existing circuitry was relatively easy because the filter network stayed the same and only required the removal of the 100ohm resistors.  Finally I placed 2-2ohm resistors in parallel across the CT output which act as burden resistors to change the current into a voltage. 
Our requirements specify a circuit rating of 15 amps so at 15 amps with a 150:5 ct ratio the current produced is 500mA which forced across a resistance of 1ohm produces a signal of .5V which is the upper limit of the chips channel 1 so the full range is being utilized.  Because our signal is larger the gain in our waveform register is now set to 1 compared to it being 16 when the shunt was being used.  After adjusting the gain we have obtained satisfactory results.  I can now breathe easy.
Now that the hardware has been fixed after our malfunction with the Shunt we will concentrate on the five artifacts due next week. Shown below is the circuit enclosure with the new CT.

Ashley's Week 13 Report

This Week:  Andrew and I spent quite a bit of time last Tuesday working on trying to get the desired values read from our energy registers after he moved everything into the enclosure.  We were unsuccessful in getting correct values, but did narrow down the problem to our shunt resistor.  I ordered another one and Andrew received it on Friday.  He was still having issues so he obtained a CT to use in its place.  This solved our problem and we were reading the desired, consistent values.  Last night, the three of us met briefly to send the values to Kevin's database.  The difference this time is that now we were sending 3 bytes of data to represent one data point as opposed to 2.  The numbers weren't very consistent, but the value did rise when we went from 1 to 2 bulbs but slightly lowered when going to 3 bulbs.  I began working on the output myself today by printing the values to my secureCRT window.  I was getting very consistent numbers but was still having the issue with the 3rd light bulb  dropping the energy value.  After telling Andrew the problem, we realized that the value was probably getting clipped so we lowered our current gain from 16 to 1.  This solved that problem and now our data points from the 3 configurations of light bulbs made a linear line.  I currently have a while loop in my program that reads and prints the active energy register to the screen approximately every 1 second.  I averaged out the values and plotted the data points for 1, 2 and 3 light bulbs again their known energy values.  I found a linear curve to fit the points and applied this to the active energy value that I was reading out.  I print out this modified value and you can see the output below.  The first set of numbers just below 200 represents the single 200W light bulb (200Ws), the numbers just below 400 are the two 200W bulbs (400Ws) and the numbers just below 600 are the three 200W bulbs (600Ws).  Kevin is meeting me shortly to begin reading the values to his database again and see if we are consistent and tweak our equations so that the linear curve still fits with the desired values.

I also created a logo for our product.  You can see the new logo on our home page.  I had a bumper sticker made with this logo so that we can place it on our enclosure.

I also began putting together the slideshow for our presentation next Thursday.

Next Week:  Kevin and I will work on transferring the desired data to his database.  The three of us will get together information for the poster since we will be presenting that on Tuesday and we will also work on the remaining documents for the end of the semester.

--------------------------------------
SecureCRT Output
--------------------------------------

196
198
194
195
195
195
197
198
198
395
396
396
397
396
394
394
395
393
392
589
597
596
596
595
595
595

Tuesday, April 19, 2011

Kevin's Week 12 report

This week I met with Ashley to make sure that we were able to transfer data containing 2 bytes over the serial port connection.  We were successful in receiving data of this size; a screenshot of this data is shown below.  We were able to test this by just performing two consecutive read operations of the serial port.  We first read the MSB and shift it to the left, then we read the LSB and add it to the shifted MSB and we get our result.  We were able to test this using the light bulb loads that we have set up.  The values around 600 were when all three were on.  We also saw a jump in the energy value when we switched the light bulbs on; this is why there are random values that spike up such as the 1168 value, these are only the minute values, but when looking at the second data, you will see 1 second where the energy value greatly increases.
Most of the time I spent this week was working on getting the website posted to the localhost.  I was still unable to find my error posting it through IIS, so I had to decide to use the www directory in the WAMP server.  To do this, I had to convert my code for the website to PHP.  The logic used was all the same, so most of the work was just getting the syntax in language differences corrected.  Since the PHP syntax is quite different from C#, it took me most of the week to get this done, but I finally have the site posted to my local host.  The site looks and operates pretty much the same.  The only change I had to make was to use a different charting tool, because the MS Chart tool would not work with PHP.  I decided to use the Libchart tool.

Now that this is working, I can focus on the reports and testing over the next weeks.


Andrew's Week 12 Progress Report

This week I worked on putting our rough prototype into a final enclosure so that the system can be contained in one nice package.  I began this work by building the actual power supplies which were designed the week before.  I am using 120VAC-12.6VAC step down transformers into a bridge rectifier then a smoothing capacitor and finally an LM7805 linear voltage regulator which steps the 12.6VAC to 5.0V.  After building the power supplies I began mounting the hardware components into a 12X12X6 PVC enclosure so that all the aspects of the circuit can be installed in a neat manner.  After mounting and wiring each component into place I brought the project into the lab so that I could test the power supply DC voltage for each of the three different supplies.  When testing I found that I connected the smoothing capacitor for the digital power supply into the wrong ground so there was a droop in the rectified waveform.  After fixing that I noticed that the isolated side linear voltage regulator was getting hot so it was dissipating a decent amount of energy for some reason.  Despite these few issues each power supply now provides a steady 5V DC output.

After testing the power supplies I met with Ashley to test out the new enclosure.  Immediately we realized that the MOSI and SCLK pins on the micro controller side of the SPI bus were switched.  After fixing this problem we were able to program the micro controller.  Once communication between the Atmega and ADE7763 was verified we began reading in apparent and active energy with the same software as our originally working prototype.  Despite using the same software and making "identical" new connections we are getting inconsistent values.  This leads us to believe there is an issue with our hardware some place in the circuit.  We are currently in the process of ruling out causes and began by installing .1uF capacitors between each chips power supply and ground.  After that I separated the Hot voltage signal coming in from the power supplies so that the power supplies wouldnt be sending noise into our voltage channel.  Next I plan to hook the shunt into the existing amplifier circuit I used to verify the shunt earlier in the semester.  We are hoping to continue to work through the hardware and resolve this issue by the end of today or Thursday at the latest so that we can begin to work on our five artifacts.  Shown below is the enclosure as constructed.

Ashley's Week 12 Report

This Week:  Kevin and I met up to work on sending the apparent energy value to his database.  We practiced sending hardcoded multi-byte values to make sure that we could correctly separate the bytes, send them via the RS232 and reassemble them on his end.  Once we saw that this was working, I began sending him the actual apparent energy values from our chip.  Kevin read the values once a second.  The numbers were very consistenet on each level of power we tested: no power, 1 lightbulb, 2 lightbulbs and 3 lightbulbs.  Because Kevin was reading every 1 second instead of the approximate every 2 seconds that Andrew and I were doing when we tested it previously, his values were all shifted down which makes perfect sense because there is less time for the energy to accumulate on the energy registers.  As we added more power (more lightbulbs), the value went up and as we removed them, it went back down hitting the same levels that it did on the way up.  This helped confirm our consistency.  We even looked at Kevin's minute readings which take the second readings and average them over the 60 second interval.  You can see a picture of this below.  For the rest of the week we did not have a chance to do more work with reading values because Andrew worked on putting the circuit into the enclosure, building the power supplies and double checking his work so that we would not blow another chip.  This morning, Andrew and I met up and tried reading the registers to the SecureCRT terminal on my computer just to make sure that things were still working.  We fixed a couple of errors in the hardware but are still reading odd values off of the energy registers so we hope to have that resolved later this afternoon.

Next Week:  This next week we will solve the problem with the signal being sent to the chip.  We will also meet with Kevin and read values to his database so that we can take them and make an equation to fit those data points.  We hope to be displaying the desired data by next Tuesday and from there work on any final touches.  The final step will be making sure Kevin can get his site uploaded and live on the web.  Once we finish up with sending the correct data, though, we can get started on our 5 end points for the course.

Click to Enlarge

Tuesday, April 12, 2011

Ashley's Week 11 Report

This Week: Andrew and I met up and decided to work on reading the raw values off the Apparent and Active Energy registers.  We took out the calibration steps that we had started to use and only added in a few register settings that we needed to make these registers begin accumulating values.  Our apparent energy was looking stable in the 10 million magnitude, but active was jumping around quite a bit.  Andrew decided to take out the digital isolator since he had built his own isolators on the circuit board.  This made a huge impact on our readings.  We were getting consistent values for both apparent and active energy and they were significantly lower (in the hundreds).  We collected the average values with 1 light bulb, 2 light bulbs, and 3 light bulbs.  We made a scatter plot in Excel containing the three points for both the active and the apparent energy.  Then we ran a linear regression to find a fitted line.  The R squared values were 1 and .99999 so that gave us proof that the relation between the actual energy output and that read from from the chip were linear.  We began applying the equations to the values read from the registers to see how close it would display to the correct value.  You can see our data below.

Next Week:  Kevin and I am meeting up today to work on passing the active and apparent energy values.  We have only sent values that fit into 1 byte in the past so we may need to do some tweaking so that he can read values larger than that.  Once we're able to pass him the numbers, we will start collecting the data points from his computer and redo the equations for calculating the correct active and apparent energy.  When Andrew and I first added in the equations before printing the two values, we saw that the numbers fluctuated a bit.  We realized that adding in those few lines of code slightly delayed things until the next read command, therefore allowing the energy to accumulate to a slightly higher value than we calculated for.  So keeping the old equations as a "place holder" in the program will allow us to read the raw values that we want and use them to figure out the correct parameters in the equations.

Overall we are feeling like we've made some great progress and feel more comfortable about the direction we are going.

Click to Enlarge