Power, and the part that does no work

The cycle a converter has to know

Summing a waveform's square over a whole number of periods reads its root-mean-square exactly: no averager, no ripple, no bias. It needs the period, and a period known one per cent long puts a hundredth of a period too much into the window. Wherever that extra piece falls, the reading moves — on a sine by up to 0.50 per cent over one period, and by 0.46 per cent over ten, because the extra piece grows with the window as fast as the window does. The worst error is δ(CF² − 1)/2, set by the crest factor and the period error and not by how many periods are summed, until the excess reaches half a period. A square wave is read exactly from any window, and a 60° rectifier current twice as badly as a sine.

Assumes: What a meter multiplies by · The frequency a sample rate invents

The average a square root pulls low found that a true-RMS converter built from a filter and a root reads low whenever the averaged square ripples, and that a second filter after the root steadies the reading without moving its bias at all. It also named the way out. An average of the square taken over a whole number of periods is the mean square exactly: the rectangle of whole periods rejects every harmonic of the square completely, there is no ripple to take a root of, and a sampling converter that sums squares over whole cycles has no bias of this kind at any frequency.

It trades the bias for something else, and that essay said what: it needs to know how long a cycle is. A mains frequency drifts, a motor drive’s output frequency is whatever the drive is doing, and a zero-crossing detector on a distorted waveform finds crossings that move with the distortion. So the summing window is an estimate, and this essay measures what an estimate costs.

The answer turns out to have a closed form in two numbers — how wrong the period is and the waveform’s crest factor — and a feature nobody would guess: over a wide range, summing more periods does not help at all.

The ripple that summing removes

A second filter takes the ripple off a true-RMS reading and leaves it 0.88% low. Two periods of a unit sine's square, that square averaged through a one-pole of τ = 100 ms, and its square root, which is what an explicit converter reads, at 2 Hz in steady state. The averaged square has a mean of exactly one; its root has a mean of 0.991166, −0.883% from the truth, and moves by 37.64% peak to peak. The fourth curve is that reading through a second one-pole of 1000 ms: its ripple is 1.489% and its mean is 0.991166, the same to every figure, because a linear filter with unit gain at direct current cannot move a mean.
Fig. 1 A 2 Hz sine’s reading through a 100 ms averager and then a second one-pole of 1 s. Its ripple falls from 37.64 to 1.489 per cent peak to peak, and its mean stays 0.991166, the same as before the second filter.

The filter converter’s problem, drawn once more: the reading is steadied by a second filter and stays 0.88 per cent low, because the bias was created by the root and no linear filter after the root can see it. A window of whole periods removes the problem at its source. There is no filter to leave ripple on the averaged square; the mean of the square over a window the waveform repeats in is simply the mean square.

What replaces the filter is the window’s length, and a window meant to be NN periods long is, if the period is estimated a fraction δ too long, N(1+δ)N(1 + \delta) periods long. It contains NδN\delta of a period more than it should.

The waveforms the measurement uses are the ones this subject keeps returning to. The rectifier current is the load current that the neutral that carries more than a line found adding up in a three-phase neutral, and its crest factor is the reason what a meter multiplies by found an averaging meter 35.9 per cent low on it. A window of whole periods is the rectangular filter the filter an average is describes, placed with its nulls on the harmonics; and a window’s length set by a period the converter believes is a frequency error of exactly the kind the corner that moved found a digital filter making near half its sample rate — a design correct at one frequency, applied at another.

Where the extra piece lands

Summed over 1 assumed period 1% too long, a sine reads within ±0.50% and a 60° rectifier current within ±0.98%Integrated exactly over the window. The root-mean-square of a waveform summed over 1 period of an assumed length 1% longer than the true one, against where in the waveform the window starts, as an error on the true root-mean-square. For the sine: worst −0.496%, crest factor 1.414, bound δ(CF² − 1)/2 = 0.500%. For the triangle: worst 0.956%, crest factor 1.732, bound δ(CF² − 1)/2 = 1.000%. For the rectifier current, 60°: worst 0.985%, crest factor 1.732, bound δ(CF² − 1)/2 = 0.999%. For the square wave: worst zero, crest factor 1.000, bound δ(CF² − 1)/2 = 0.000%. A sine's worst agrees with |sin 2πNδ|/(4πN(1 + δ)); a square wave is read exactly from every start, because its square does not vary.-10100.2500.5000.7501where the window starts, as a fraction of a perioderror in the reading (per cent)sineworst −0.496%triangleworst 0.956%rectifier current, 60°worst 0.985%square waveexact from every startintegrated over the window, every startthe extra piece, wherever it lands
Fig. 2 The root-mean-square summed over one period of an assumed length 1% too long, against where the window starts. A sine’s reading moves by up to 0.496%, a triangle’s by 0.956%, a 60° rectifier current’s by 0.985%, and a square wave’s not at all. The slider is how long the assumed period is.

The figure integrates each waveform’s square exactly over a window of one assumed period, one per cent too long, starting at every phase of the waveform, and plots the error in the reading. For a sine it swings between −0.496 and +0.496 per cent. The extra hundredth of a period adds the square’s value at wherever the window ends, and the mean square is spread over one period and a hundredth: if the extra piece lands where the square is at its peak the reading is high, if it lands at a zero crossing it is low.

The sine’s error has a closed form, and the figure checks the worst case against it. A unit sine’s square over a window WW starting at aa has a mean of 1[sin4π(a+W)sin4πa]/(4πW)1 - [\sin 4\pi(a+W) - \sin 4\pi a]/(4\pi W), and the worst over every start gives a root-mean-square error of

sin2πNδ4πN(1+δ).\frac{|\sin 2\pi N\delta|}{4\pi N(1 + \delta)}.

For one period one per cent long that is 0.495 per cent, which is the figure’s 0.496 to the resolution of 360 starting phases.

The triangle and the rectifier current swing twice as far, 0.956 and 0.985 per cent. The square wave does not swing at all: its square is one at every instant, so however much extra window there is and wherever it lands, it adds exactly the mean. The ordering is the ordering of how peaked each waveform’s square is, and it has a name.

The crest factor decides it

While the extra piece is small — while NδN\delta is a small fraction of a period — the error it causes is at most the extra fraction of the window times how far the square’s peak is above its mean. The extra fraction is δ. For a waveform of unit root-mean-square value the square’s mean is one and its peak is the crest factor squared. So the mean square is out by at most δ(CF21)\delta(\text{CF}^2 - 1) and the root-mean-square by half of that:

errorδ(CF21)2.|\text{error}| \le \frac{\delta\,(\text{CF}^2 - 1)}{2}.

A sine has a crest factor of 2\sqrt2 and the bound is δ/2, 0.500 per cent at one per cent of period error; its worst was 0.496. A triangle and a 60° rectifier current both have a crest factor of 1.732, the bound is δ, and their worsts were 0.956 and 0.985 per cent. A square wave’s crest factor is one and its bound is zero. The figure checks every waveform’s worst against its bound.

That is the whole price of the exact method in one line. It is proportional to the period error and to CF21\text{CF}^2 - 1, and it is largest for exactly the waveforms a true-RMS converter exists to measure: a rectifier current conducting for 20 degrees, with a crest factor near three, has a bound eight times the sine’s, four per cent of reading for one per cent of period error.

More periods do not help

The bound has no NN in it. That is not an approximation hiding a slow improvement; it is the behaviour.

Summed over 10 assumed periods 1% too long, a sine reads within ±0.46% and a 60° rectifier current within ±0.98%. Integrated exactly over the window. The root-mean-square of a waveform summed over 10 periods of an assumed length 1% longer than the true one, against where in the waveform the window starts, as an error on the true root-mean-square. For the sine: worst −0.464%, crest factor 1.414, bound δ(CF² − 1)/2 = 0.500%. For the triangle: worst 0.710%, crest factor 1.732, bound δ(CF² − 1)/2 = 1.000%. For the rectifier current, 60°: worst 0.985%, crest factor 1.732, bound δ(CF² − 1)/2 = 0.999%. For the square wave: worst zero, crest factor 1.000, bound δ(CF² − 1)/2 = 0.000%. A sine's worst agrees with |sin 2πNδ|/(4πN(1 + δ)); a square wave is read exactly from every start, because its square does not vary.
Fig. 3 The same readings summed over ten assumed periods 1% too long. The sine’s worst is 0.464%, the triangle’s 0.710%, the 60° rectifier current’s 0.985%; the square wave is exact from every start.

Summed over ten periods instead of one, each one per cent long, the window holds a tenth of a period too much instead of a hundredth — and it holds it spread over ten times as much signal. The two effects cancel. The sine’s worst is 0.464 per cent over ten periods against 0.496 over one; the rectifier current’s is 0.985 per cent over both. The extra piece grows in proportion to the window, so its share of the window does not change, and a longer sum does not dilute the error at all.

Summed over whole periods 1.3% too long, a sine is read to ±0.65% for up to 38 periods, whatever their number. Integrated exactly over each window, the worst over every starting phase. The error in a root-mean-square summed over N assumed periods 1.3% too long, against N, for a sine and a 60° rectifier current, beside an explicit converter averaging over a comparable time, τ of N/2 periods. For the sine the worst error is 0.643% at one period and stays near δ/2 until N approaches 1/(2δ) = 38; it vanishes where Nδ is a whole number of half-periods of the square, and beyond it is bounded by 1/(4πN). The rectifier current's is 1.274% at one period, near δ(CF² − 1)/2 with a crest factor of 1.732. The converter at τ = N/2 periods is low by 15.8 ppm on the sine at N = 10, with a ripple of ±0.796%; on the rectifier current, low by 46.3 ppm with ±1.665%.
Fig. 4 The worst error of a reading summed over N assumed periods 1.3% too long, against N, for a sine and a 60° rectifier current, beside an explicit converter averaging over τ of N/2 periods. The sine’s is 0.643% at one period and stays near δ/2 until N approaches 1/(2δ) = 38; it vanishes where Nδ is a whole number of half-periods, and beyond that it is bounded by 1/(4πN). The converter at τ = 5 periods is low by 15.8 ppm on a sine, with a ripple of ±0.796%.

The figure sweeps the number of periods from one to a thousand with the period 1.3 per cent long. The sine’s worst error is 0.643 per cent at one period and stays close to that until the excess approaches half a period of the waveform — at about 38 periods here — because until then the extra piece is a small, growing sliver of the square and its share of the window is fixed. When the excess reaches half a period, which is a whole period of a sine’s square, the extra piece is a complete cycle of the square and adds exactly its mean: the error vanishes. Beyond that the pattern repeats, and the error is bounded by 1/(4πN)1/(4\pi N), which finally does fall as the number of periods grows.

So there are two regimes, and the boundary is not a number of periods but a product. While NδN\delta is below a half, the reading’s worst error is set by the period error and the crest factor and a longer sum buys nothing. Above it, the error falls as 1/N1/N with nulls wherever the excess is a whole half-period. A converter that sums ten cycles of fifty-hertz mains with its frequency estimated to a per cent is in the first regime; so is one summing a hundred cycles with the frequency known to a tenth of a per cent.

Why the triangle recovers and the rectifier current does not

The ten-period figure has a detail the bound does not predict. The triangle and the 60° rectifier current have the same crest factor, 1.732, and the same bound. Over one period their worst errors were nearly equal, 0.956 and 0.985 per cent. Over ten periods the triangle’s has fallen to 0.710 and the rectifier current’s has not moved.

The bound assumes the extra sliver can be placed entirely on the square’s peak. Over one period one per cent long the sliver is a hundredth of a period wide, and on either waveform a hundredth of a period fits on the peak. Over ten periods it is a tenth of a period wide. A triangle’s square is at its peak for an instant and falls away on either side, so a sliver a tenth of a period wide averages well below the peak wherever it is placed. A rectifier current conducting for sixty degrees is flat-topped by comparison — its current rises and falls within a sixth of a period, and its square stays near its peak for a good part of that — so a tenth-of-a-period sliver can still sit almost entirely on high values.

So the bound is reached only by waveforms whose square stays near its peak for at least NδN\delta of a period, and the rate at which a waveform falls below the bound as the window lengthens is a statement about the width of its peaks as well as their height. Crest factor sets the worst case; the shape of the peak decides how long the worst case lasts.

A period that is measured, not assumed

The flat regime belongs to a period error that stays fixed as the window grows: a converter that assumes fifty hertz on a supply running at 50.5, or one that estimated the period once and kept it. That is a real case — a meter locked to a nominal frequency is exactly this — but it is not the only one.

A converter that measures the period over the same window it sums does better as the window grows, for a reason that has nothing to do with the window itself. A period estimated by timing NN zero crossings has a timing error at each crossing from noise and distortion, and the estimate of one period is that error divided across NN periods. So δ falls roughly as 1/N1/N, and since the reading’s error is proportional to δ in the flat regime, the reading’s error falls as 1/N1/N too. The flatness measured here is then the statement that all of the improvement a longer sum brings comes from a better period estimate, and none from the longer sum as such.

The distinction matters for how a synchronous converter is specified. An accuracy quoted for a fixed number of cycles on a waveform of exactly nominal frequency says nothing about the same converter on a supply that has drifted by a per cent, where the error is set by the drift and not by the cycles; an accuracy quoted for a stated frequency error, in the form δ(CF21)/2\delta(\text{CF}^2 - 1)/2, says everything about both.

In mains terms

The numbers here are dimensionless, and a supply puts units on them. A European grid holds its frequency to within a per cent of fifty hertz in normal operation, so a meter that sums over ten nominal cycles — two hundred milliseconds — with the period fixed at twenty milliseconds has δ up to one per cent, and reads a sine to within half a per cent and a 60° rectifier current to within a per cent, whatever it does with those ten cycles. The flat regime lasts until the excess is half a period, which at one per cent is fifty cycles, a full second of summing; beyond it the error begins to fall.

A meter that locks to the measured frequency and holds it to a tenth of a per cent is ten times better on both waveforms and stays in the flat regime ten times longer, to five hundred cycles. And a meter that locks to thirty parts per million — which a phase-locked loop on a clean supply can do — has a worst error on a sine of about fifteen parts per million, comparable with the bias of a filter converter averaging over the same few tenths of a second.

Against the converter it replaces

The comparison the method invites is with the filter converter averaging over a similar time, and the answer depends on which of that converter’s errors is meant.

At ten periods the figure sets beside the window an explicit converter with a time constant of five periods. Its mean reading is low by 15.8 parts per million on a sine and 46.3 on the rectifier current. Its instantaneous reading, though, ripples by ±0.796 per cent on the sine and ±1.665 per cent on the rectifier current — because a time constant of five periods is not long against twice the frequency, where the square’s line sits.

So against a converter whose reading is taken at an instant, the window of whole periods is better even with a period one per cent wrong: ±0.46 per cent against ±0.80 on the sine. Against a converter whose mean is used — its display smoothed, its output logged and averaged — the window is worse by a factor of three hundred on the sine unless the period is known to about thirty parts per million, where δ/2\delta/2 falls to the converter’s 15.8 parts per million of bias.

Summed over whole periods 0.13% too long, a sine is read to ±0.07% for up to 385 periods, whatever their number. Integrated exactly over each window, the worst over every starting phase. The error in a root-mean-square summed over N assumed periods 0.13% too long, against N, for a sine and a 60° rectifier current, beside an explicit converter averaging over a comparable time, τ of N/2 periods. For the sine the worst error is 0.065% at one period and stays near δ/2 until N approaches 1/(2δ) = 385; it vanishes where Nδ is a whole number of half-periods of the square, and beyond it is bounded by 1/(4πN). The rectifier current's is 0.130% at one period, near δ(CF² − 1)/2 with a crest factor of 1.732. The converter at τ = N/2 periods is low by 15.8 ppm on the sine at N = 10, with a ripple of ±0.796%; on the rectifier current, low by 46.3 ppm with ±1.665%.
Fig. 5 The same sweep with the period 0.13% too long. The sine’s worst error is 0.065% at one period and stays near that until N approaches 385; the rectifier current’s is 0.130%.

With the period known to 0.13 per cent the window’s worst error falls in proportion, to 0.065 per cent on a sine, and stays flat out to 385 periods. The proportionality is exact while NδN\delta is small, which is what makes the bound useful: a converter’s specification can state its accuracy directly in terms of how well its period is tracked, and the statement does not need the number of cycles.

What a sampling converter should take from this

Track the period, not the number of cycles. Summing more cycles is the obvious lever and, in the regime where most converters operate, it does nothing. The period estimate is the whole of the error.

The waveform’s crest factor scales the requirement. A converter specified on sines has an accuracy half its period error; on a rectifier current of crest factor 1.73 the same converter is out by its whole period error, and on one of crest factor three, by four times it. What a meter multiplies by found an average-responding meter’s error set by the ratio of form factors; a synchronous true-RMS converter’s is set by the crest factor, and it is the waveforms with high crest factors that are measured with such converters precisely because their form factors fool the cheaper meter.

A square wave is free. Any waveform whose square is constant — a symmetrical square wave is the everyday one — is read exactly from any window, by this method and by the filter converter alike, because a crest factor of one leaves nothing for the extra sliver to add.

And a window can be made insensitive by shaping it. The error comes from a rectangle’s sharp ends catching an uncontrolled sliver of the square. The filter an average is found a triangular window’s side lobes falling as the square of frequency rather than the first power; a window that tapers at its ends weights the extra sliver less, at the cost of the exact null a rectangle of whole periods puts on every harmonic.

Still open: a tapered window, a frequency that moves during the sum, and noise summed over cycles

A tapered window. Replacing the rectangle with a raised-cosine or triangular weighting should make the error fall with the window rather than stay fixed, because the sliver at each end enters with a weight that goes to zero. By how much, and whether the loss of the exact harmonic null costs more than the taper saves when the period is right, is a measurement the same integration can make.

A frequency that drifts during the sum. Everything here has a period that is wrong but constant. A mains frequency wandering by a few millihertz over ten cycles gives a window that is right on average and wrong at its end, and the extra sliver then depends on the drift’s history. Whether the flat regime survives a drift, or turns into an error that grows with the number of cycles, is the case a real synchronous converter meets.

Noise in a cycle-summed reading. The noise a true-RMS meter reads low found a filter converter’s reading of noise low by 1/(16Bτ). A window of whole periods has no root inside its average either, and should read noise with no bias at all — but it defines its window by a period the noise does not have, and what a cycle-summing converter does with a waveform that is a periodic signal plus noise is the question that joins the two measurements.

Part 4 on RMS and average

One argument about RMS and average, and one of 4 essays on it so far, each part numbered by how much of the idea it assumes. What sits either side of it:

The objects named here

The third axis, after the field and the idea: the things themselves, and every essay that touches each one.

AveragingConduction angleCrest factorForm factorMeasurement conditionModel rangeTrue-RMS