14 DecPrototyping – Part II

There is not much to this. A protoshield, the arduino, and a breadboard. Note the current transformer (donut). I have two of those to use in the panel.

IMG_1426

The first test was to plugging in a 60 W lamp to see what the measurement came too. I expected around 0.5 Amps and 60 watts. I was not disappointed.  I proceeded to plug in a toaster and put the ammeter in the circuit to see if my RMS current matched its RMS measurement. The photo below shows a .4% error. Not bad. Note the drop in the line voltage.

In Canada, the nominal line voltage is 120Vrms. I do measure the voltage as part of my power calculations and when I saw the 113 V I checked with the multi-meter and it read the same.  Assuming a 120 V reference would lead to errors in the power calculations. I should not be running a toaster outside my 20Amp line in the kitchen. I created a suicide cord that threads through the current transformer and is basically an extension cord. It plugs into a 15Amp line with other loads. 120 down to 113 is just over a 5% difference from the nominal line voltage. I am trying to rationalize why such a large dip. Anyway, the power measurement works.

IMG_1421

Crest Factor

The crest factor is the the ratio between peak and RMS signals. I do compute that and it gives me an idea on the shape of the waveform. A sinewave should have a crest factor of \sqrt{2} . The 60 W lightbulb had a crest factor of 1.40 for the voltage 1.40 for the current. Close enough.

I plugged in a variable speed drill and ran it a low RPM. As expected, the power factor went down to .27 with most of the power becoming reactive at 104 vars. The real power was just a mere 29.5 watts. The crest factor for the voltage was 1.39 and for the current, 3.96. That is expected as the duty cycle is changed to control the speed. For us home owners, we get charged for the real power consumed.  In industrial environments, the power company would penalize you for running with such an awful power factor.

I can’t wait to plug all this in the main panel see what the overall power consumption profile is. I expect the power factor to be closer to one.

Next Steps

Computing C02 emissions is trivial as well as projecting cost of power usage.  I would like to have that wired next to the power panel and displayed on the LCD sooner than later.  On the other hand, I need figure out the zigbee side of things as well as how to best do the data logging.  I can easily purchase another arduino later and focus on getting this prototype soldered on something more permanent.

17 NovModeling the Math

I used Excel to enter the power calculations on a simulated data set (voltage and current). I later wanted something more responsive to what-ifs and designed for mathematical computation. I stumbled on a MatLab like open source tool cal GNU-Octave. I decided to download and install the tool to enter basic power calculations.

What I like about this tool and like Matlab is the ability to manipulate matrices and vectors. I can set up calculations for my power without resorting to annoying for loops. With my short attention span, I liked this.

Earlier I described the basic math and reduced the following salient equations:

P_{avg}=\frac {1}{T}\int^{to+T}_{to}p(t)dt\qquad(1)

I_{equiv}=I_{rms}=\sqrt{\frac {1}{T}\int^{to+T}_{to}i^2(t)dt} \qquad(2)

P_{avg} = V_{rms}I_{rms}cos(\Theta_v-\Theta_i) \qquad(3))

For giggles, I wanted to use Octave to calculate and plot power curves. I know from sampling theory that we need to sample at least at the Nyquist frequency to be able to reconstruct the signal.The reality is we don’t live in an ideal world with perfect filters. More about sampling rate later.

I created functions in Octave to generate a waveform. I can also import a text file with data values and compute the various types of powers as well. I wanted to test a couple of sunny day scenarios to ensure that my calculations were correct. I took two approaches. One I actually defined the function and let Octave integrate it. The other was to sample the function like I would in the software. Both yielded the same results. The table below outlines the expected and actual results.

Test #DescriptionMeasurement PointExpectedActualComment
160 Hz Phase 0, Vm=Im=1VrmsVm*sqrt(2)=0.7070.707pass
160 Hz Phase 0, Vm=Im=1IrmsIm*sqrt(2)=0.7070.707pass
160 Hz Phase 0, Vm=Im=1Apparent Power Vrms*Irms = 0.50.5pass
160 Hz Phase 0, Vm=Im=1Average Power Apparent Power * cos( 0-0)=.50.5pass
160 Hz Phase 0, Vm=Im=1Reactive Powerapparent power * sin (0-0) = 0.00.0pass
160 Hz Phase 0, Vm=Im=1Power Factor cos(0-45)=11.0pass
260 Hz Phase I=45 degrees, Vm=Im=1VrmsVm*sqrt(2)=0.7070.707pass
260 Hz Phase I=45 degrees, Vm=Im=1IrmsIm*sqrt(2)=0.7070.707pass
260 Hz Phase I=45 degrees, Vm=Im=1Apparent PowerVrms*Irms = 0.50.5pass
260 Hz Phase I=45 degrees, Vm=Im=1Average PowerApparent Power * cos( 0-45)=0.353550.35355pass
260 Hz Phase I=45 degrees, Vm=Im=1Reactive PowerApparent Power * sin( 0-45)=0.353550.35355pass
260 Hz Phase I=45 degrees, Vm=Im=1Power Factor cos( 0 - 45 ) = 0.707 0.707pass

I also generated an odd current waveform that could occur in speed control via a triac or something and ploted the graph below.

SCR

Intuitively one would expect the average power to be half of the sunny day scenario. The other half is reactive power. The following shows the power calculations for varying sampling rates.

Sampling RatePower Calcs
10,000 samples per secondVrms = 0.70711
Irms = 0.49990
apparentpwr = 0.35348
avaragepwr = 0.24990
reactivePower = 0.25000
pf = 0.70697
pfAngle = 45.011
1000 samples per secondVrms = 0.70711
Irms = 0.49900
apparentpwr = 0.35285
avaragepwr = 0.24900
reactivePower = 0.25000
pf = 0.70569
pfAngle = 45.115
600 samples per secondVrms = 0.70711
Irms = 0.49833
apparentpwr = 0.35237
avaragepwr = 0.24833
reactivePower = 0.24999
pf = 0.70475
pfAngle = 45.191
120 samples per secondVrms = 0.70711
Irms = 0.49160
apparentpwr = 0.34761
avaragepwr = 0.24167
reactivePower = 0.24986
pf = 0.69522
pfAngle = 45.955