The clock project finished up a year ago. This is the start of a new project, which might turn into some sort of power monitor.
Here's a picture of two waveforms on an old-school scope from ~1990.
Sine wave is volts, pulse is amps
If the units and scales are right, the integration of volts * amps is the real power being used by the load. I did that, eye-balling it, and got 47 watts. That was a little disappointing because this is the device under test.
30W CFL bulb
If that was an incandescent bulb, the volts and amps would be very similar waveforms, neatly aligned. But most of today's electronics demand power during a fraction of a voltage cycle.
current: peak is 85 mv on 30 ohms. e/r=i, .085/30 = .0028 amp
x500 -> 1.4Amp
That max current is when Volts = 4, current ramps to zero as volts ramps to 6.
The volts are actually (xformer ratio 230/8.6 no load) x26.75, so 4*26.75 = 107V to 6*26.75 = 160.5V
the ramp is about 1/4 of the cycle.
treat the sine wave as a linear ramp too.
begin of ramp is .0028A * 107V
end of ramp is 0.0A * 160V
average is 1.4A * 133.5V = 186.9 volt-amps (watts)
but only 25% duty cycle
187/4 = 47W
All of those numbers are estimates, off the screen, or off of data sheets. Some will change, below.
Here's the JSL I used to digitize some points. The data arrays were not filled in initially; those are my answers. This is single-use code; I took a short cut and made the first and last point have special meanings, further below.
That one degree rotation makes the image x-y line up with the screen.
Scope traces as image in a JMP graph. The tiny black square boxes on the traces are the handles.
After dragging the points into place, with the first and last voltage points defining a full cycle and the first and last current points defining the length of the pulse, I used this.
vmax = Max( volts[0, 2] ); // sine top
vmin = Min( volts[0, 2] ); // sine bottom
vrange = vmax - vmin; // sine range
amax = Max( amps[0, 2] ); // similar for pulse
amin = Min( amps[0, 2] );
arange = amax - amin;
minx = Min( volts[0, 1] ); // length of sine cycle
maxx = Max( volts[0, 1] ); // because point 1 and 9 at begin and end
pulselength = amps[9, 1] - amps[1, 1]; // length of 1 of 2 pulses
pulseduty = 2 * pulselength / (maxx - minx); // 2 pulses per cycle
dt = pulselength / 16384; // small dt improves answer
n = 0; // count the dt intervals
sum = 0;
For( t = amps[1, 1], t < amps[9, 1], t += dt, // step thru the pulse
y = Interpolate( t, volts[0, 1], volts[0, 2] ); // get the volts
v = 125 * 1.414 * (2 * (y - vmin) / vrange - 1); // map the volts
y = Interpolate( t, amps[0, 1], amps[0, 2] ); // get the amps
a = 1.4 * ((y - amin) / arange); // map the amps
sum += a * v; // watts for this dt
n += 1;
);
sum = sum / n;
sum = sum * pulseduty;
Show( sum );
to get
sum = 25.8513297218601;
It took a bit of rethinking; rather than use the transformer's poorly defined turns ratio and the scope's ancient calibration, I assumed my house voltage is 125V rms and used the 1.414 factor to get the peak-to-peak voltage the sine wave should match. That seems close enough. Now to make the ESP32 digitize the points directly...
Last Modified: Oct 31, 2022 7:49 PM
Comments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.