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

Kevin's Week 11 report

This week I continued working on attempting to get the website published through IIS7.5.  I am currently still getting an Internal Server Error when I try to open the page on the local host.  I have gone through several tutorials over the past week on how to set up IIS 7.5 and add an application website to the default website.  I went through my permissions and made sure that all accounts were able to access the local host webpage, however, the error did not change, so I am thinking that there may be a setting between my IIS setup and my web config file in my asp.net project that needs to be changed so that the two are compatible.  I also attempted moving my .NET framework to version 3.5 in my project as that was the specified version in IIS 7.5; again, I got the same internal server error.  I am going to try to talk to someone in CSS to see if they would have an idea of a setting I need to change to get the website to be accessible on the local host so I can move on from there.  I also want to check with them why I sometimes get an error writing to MySql when I am trying to publish the website on through IIS.
Also, I am going to meet with Ashley today to test receiving the active and apparent energy readings over the serial port.  I will include another second part to this report indicating how our test went.  Over the next week, I want to find a solution for publishing the website and get the testing for receiving data from Ashley done.  I hope to also start the basic parts of the final report.

Monday, April 11, 2011

Andrew's Week 11 Progress Report

This week I continued to work with Ashley on developing accurate Active and Apparent Energy Readings.  We decided to use active and apparent accumulating registers from the ADE7763 which reset each time they are read.  We decided to use the micro controller as our timer and to get readings from the register every two seconds.  Ashley and I were able to get consistent values for power consumption using 0W, 200W, 400W, and 600W worth of resistive loads.  Ashley's report contains the values we got during these tests.  Before performing each test I used a voltmeter and digital clamp current meter to calculate power consumption for each source.We then used the known power consumption versus the active and apparent values to form linear equations using excel.  For  active and apparent energy we got an R squared value of .999 and 1 which reinforced our feelings about using the equation.

After feeling a sense of accomplishment I decided to begin concentrating on building the power supplies so that we can move our prototype into its final enclosure.  The power supplies for this project are relatively simple for two main reasons: line power can be utilized so energy efficiency is not a huge deal, only +5V DC is needed as a voltage for our entire circuit.  Despite the rather simple constraints the power supply will need to be built 3 times since our circuit has an isolated side, analog loads and digital loads.  Searching the internet I came across a site which provided good information about building simple 5V power supplies using the LM7805 linear voltage regulator, a device I am pretty familiar with.  The website referenced was: http://www.eleinmec.com/article.asp?16   Below is a schematic of the power supply design thus far.





I plan on each power supply having to supply minimal power (less than 500mW) however I still need to do the calculations to determine how much power each supply will need to produce.  If the power consumption is low enough I am hoping to get away with not having to mount the LM7805's to heat sinks.  I also plan on using a 9V AC input into the bridge so that less power has to dissipated by the regulators.

Over the next week I plan to finalize and build all the power supplies.  Once the supplies are built I also plan to begin building the project's final enclosure.  Ashley and I will also continue to test and fine tune our active and apparent energy readings.

Tuesday, April 5, 2011

Andrew's Week 10 Report

This week Ashley and I continued to work on the Irms and Active Energy Callibrations.  To callibrate Irms we followed steps very similar to the Vrms method.  For the Active Energy Callibration we began performing the calculations outlined on page 34 of the datasheet. To perform the accurate source calibration I built a sink which consumes 600W at close to 1.0 power factor.  This was constructed using three 200W light bulbs which will draw roughly 5 amps of current at 120V.  The data sheet calculations are being performed using these values as our base factors. 
Currently our Vrms measurement are accurate within +-5%.  To get a more consistent voltage measurement I seperated all the digital and analog connections from each other.  This involved adding one more power supply which will provide +5V.  Unfortunately while re connecting the Vanalog I swapped the positive and negative which resulted in a blown ADE7763.  This mistake put a hault to the callibration but our new chip is being soldered and will hopefully be ready for action this by this evening.  A photo of the current circuit and its breadboard power supplies are shown below: 


Next week we plan to finish or become closer to finishing all the callibrations required for the ADE7763.   

Kevin's Week 10 report

This week I worked on getting the final touches on the website.  In addition to the page that displays the hourly data, I also created the pages to display the day, month, and yearly data.  They operate the same way as the hourly data does.  The yearly data page shows data from each day.  The monthly data shows data from 4 points throughout each day in that month, once at midnight, once at 6AM, once at noon, and once at 6PM.  The daily data shows data from 4 points within each hour; once on the hour, once at 15 minutes after, once at 30 minutes after, and once at 45 minutes after.  Over the weekend I also met up with Andrew and Ashley to try and get the power chip calibrated.  Right now I am in the process of publishing the webpage to the internet through IIS.  I am having some trouble getting the page to show up.  When I try to open the page, it gives me an internal server error HTTP Error 500.19.  I believe that it has something to do with the allowed permissions when trying to access the page.  I will have to look more closely at this, but I do not expect this fix to take more than a couple of days.  I plan on being ready to begin testing receiving actual data by the start of next week.

Ashley's Week 10 Report

This Week:  Andrew installed the isolators on the board and we made sure we were still able to read the RMS Voltage.  We reworked the scaling equation so that it outputs an average value of 120V to the terminal when we request a reading.  We also started reading the RMS current register.  When power was applied, we were getting a number around 3,000,000 and when the power was removed, the value was around 23,000.  We have a light bulb socket connected to the circuit and tried some different light bulbs but weren't having much luck with changes in current.  Andrew is putting together a couple more light bulb sockets to hook to our device for further testing. While messing around with the RMS current reading, we decided to add another power supply to so that each part of the board was isolated from the rest, hoping to get better values, but we accidentally fried the power chip so we were unable to continue our work this Sunday.  We began reading through the datasheet about the Active Energy calibration so that we would have an idea of where we needed to start at our next meeting.

(I am not posting code this time because it is essentially the same as my previous post)

Next Week:  We will spend this next week calibrating the active energy readings and possibly look at the apparent energy if time allows.