Transcript P avg

Measuring and Controlling Load
Power with Embedded
Processors: Is There an Easy
Way?
Jim Gilbert
Technical Fellow
Covidien Energy-based Devices
IEEE SPS – Denver May 10th, 2011
Agenda
• Introduction
• What is so hard about measuring power?
• Definitions
• Uncertainty budgets for sensing power
• Uncertainty in sensing power in the digital domain
• Some digital implementation comparisons
• Wrap up
2 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Quote of the Day
“One person can use smoke and mirrors to make a demo
that dazzles an audience. But shipping to a million
customers will expose [a product’s] flaws and leave
everyone looking bad…
It is a cliché in our business that the first 90 percent of the
work is easy, the second 90 percent wears you down,
and the last 90 percent – the attention to detail – makes
a good product.”
Ron Avitzur, “The Graphing Calculator Story,” Pacific Technology,
2004. www.pacifict.com
3 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Introduction
nwcommunityenergy.org
The world market has become energy efficiency aware
and mobile device dependent. This has affected many
disparate markets from consumer and industrial lighting
to arc welding and plasma cutters in some unique, and
perhaps positive, but unexpected, ways…
4 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Introduction (continued)
Consumer and industrial lighting examples:
– Incandescent bulbs will no longer be found in the EU after 2012 and will be phased
out of the US markets starting that same year; compact fluorescent [most with
electronic ballast] is taking over [Kanter, NY Times, “European Ban …,” Aug 31, 2009]
– High-efficacy RF lamps, based in SMPS design techniques, have not only improved
efficiency, but greatly extended lamp life and functionality, i.e. new applications and
usage models [Knisley, EC&M, “RF Lighting …,” Nov 1, 2002]
– Industrial UV curing has combined SMPS design techniques with cathodeless RF
lamps and LEDs to achieve incredible reliability, power density, and high factorythroughput rates [e.g. Fusion UV Systems’® Light Hammer® and Phoseon Technology’s SLM™]
5 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Introduction (continued)
www.torchmate.com
Arc welding and plasma cutter examples:
– The jump from transformer-based to inverter-based arc welder technology has
reduced costs and improved production quality in the highly demanding aerospace
industry [Miller Electric Mfg., “Aerospace Fabricator …,” www.millerwelds.com]
– Cathode spot control and arc plasma start/restrike phenomena require response
speeds of 10 kHz or more bandwidth, which the new RF AC inverters with digital
feedback control can offer over prior analog art [Weman, Welding Processes Handbook, 2003]
– Scramjet plasma torches require active power control and benefit further in
increased battery life from pulsed or sinusoidal power waveforms [Billingsely et al, “Improved
Plasma …,” Virginia Tech, AIAA Paper 2005-3423]
6 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Introduction (continued)
Setting
(Weighting or
Desired
Response)
•
Output
Digital
Compensator
(PID)
D/A
(Actuator)
Plant
Signal Processing
A/D
Sensors
The typical digital feedback controller requires some signal processing
of the process variable sensors
– This can be done in either the digital or analog realm, but in either case, this
introduces a delay or latency into the loop that may affect control response
– Each block in the control loop introduces both magnitude and phase errors, these
affect accuracy and precision; this includes the signal processing
– An overall budget for the accuracy and precision as well as the latency is necessary
to architect the system appropriately
7 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
What is so hard about measuring power?
• Huh?
– Average AC real power measurements can be distorted by
– Nonlinearities, HF limitations (>10MHz), or noise – not in detail
– Algorithmic approximations – yes, in detail
– This talk will center primarily on uncertainties created by digital
signal processing algorithmic approximations
– These uncertainties can be minimized (or practically eliminated) by
architectural design choices, i.e. sample frequency and averaging
window selection
– The signal processing typically contributes non-negligible
latency that affects control loop dynamics
– This talk will cover computational complexity as a relative measure
– This talk will not go into detail about latency in control loop designs
8 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
What are we doing with power: Tracking Pavg
• Power is a measure of the rate of work being done by the system
‒ Rate of heating, lifting, or, generally, energy conversion
‒ Tracking power allows control of the energy delivery
• Need to track the envelope of the voltage and current waveforms
• AM Power!
• Amplitude Modulation is v(t)  A  V (t)  cos( c t   )
V(t) has its own bandwidth, often < c

9 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Tracking of Pavg (continued)
• Which signal is being modulated: voltage or current?
– Ideal voltage source → current is modulated by load fluctuations
– Ideal current source → voltage is modulated by load fluctuations
• If one or the other is well known and controlled, then you
need only measure and control based on the other –
simple
• Sometimes, but…
– Sources are not always “ideal” – e.g. matched to some maximum
power transfer load; so, both voltage and current are modulated
– The load in question, if it is interesting, may be non-linear; so,
different, non-ideal spectra for voltage and current
10 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Tracking of Pavg: Non-linear Loads
What does a non-linear load look
like?
i(t)
• It could be an arc between a
stick welder and its
workpiece…
• Here we see an ideal
sinusoidal voltage source
driving a spark gap that results
in a highly non-linear current
waveform
• If distance is precisely known,
then a voltage-source welder
works here. But, that is why
stick welders are currentsourced!
11 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
v(t)
Tracking of Pavg (continued)
• And, just to make it more interesting, multiplication in the timedomain is convolution in the frequency-domain
Voltage
Baseband
-Fv 0
Frequency
*
Current
-Fi
Fv
0
Assume voltage and current
both have different amplitude
modulation bandwidth
Fi
=
Power
- (Fv+Fi)
0
• Everything just got twice as hard!
12 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
(Fv+Fi)
Definitions and Refreshers
• Instantaneous power
p (t )  v(t )  i (t )
– Voltage times current (note
both are real valued signals)
• Average Power definition
– Pavg is defined as the average
power absorbed by a load over
some time interval, ∆t = (t2 - t1);
(sign matters!)
• For periodic signals
– Average power of one period =
average power of any number
of periods, k
– T = the period of v(t) and i(t)
– kT is integration time or
averaging window “length”
13 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
1
v(t )  i (t )dt
t 
Electrical

1
F (t )  v(t )dt
t 
Mechanical

1
p (t )  Q (t )dt
t 
Fluid/Acoustic
Pavg 
Pavg
1

kT
kT
 v(t )  i(t )dt
k  positve integers
Definitions (continued)
S = Complex Power (of a singlefrequency sinusoid)
|S| = Apparent Power (VA)
S  V  I*
Q = Reactive Power (VAR)
P = Real Power (Watt)
Complex
Voltage and
Current
S  V  I*
S  Vrms I rms
P  S cos( )

 Re V  I*

* Denotes complex conjugate
Diagram from Wikipedia
http://en.wikipedia.org/wiki/AC_power
14 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Vector (Phasor) Plot
Definitions (continued)
• Accuracy and Precision
– Accuracy is the relative
difference between a
reference and the
measured values
– Precision is the
unbiased repeatability
of the measurement
– Accuracy is a metric for
the non-random bias, or
systematic error, and
precision is a metric for
the unbiased random
error
We will assume that we can calibrate out bias,
or systematic error, and neglect covariance (by
design), leaving primarily random error for this
study: uncertainty error
Diagram from Wikipedia
http://en.wikipedia.org/wiki/Accuracy_and_precision
15 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Definitions (continued)
• Independent and random fractional uncertainties of
products or ratios are added together in quadrature, i.e.
by r.m.s. addition
The system fractional uncertainty
is the uncertainty normalized by
the absolute value of the best
estimate
The independent contributing fractional
uncertainties
16 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Definitions (continued): Big O
• A function that defines an upper bound of another
function
ek
f(x)  O(ek)
f(x)
• In Computer Science Big O is used as a metric for
computational complexity
– MIPS/FLOPS are relative to a processor and can be misleading
or confusing, when comparing algorithms versus specific
implementations
17 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Definitions (continued)
• We define computational complexity of an algorithm as:
– Sum total of additions/subtractions and multiplies
– Division is considered to be multiplication
– Everything else not included (moving data)
• Example:
y[n]=A∙sum(x[n]), for N samples
one multiply
N-1 additions
y[n]  O(Nn)
Order N,
or ,
N operations for n samples
18 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Definitions (continued)
• Sample rate conversion – handled similar to MIPS
– Example: Direct (inefficient) form of decimation
v[n]
@ Fs MSPS
N samples
M
Sum
Pavg[k]
@ Fs/M MSPS
i[n]
One sample, n, requires
N computations
One sample, k, requires
N∙M computations
Conversion: Multiply by M
O(Nn)
19 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
O(NMk)
Uncertainty Budget Example: A/D Selection
Let’s start apportioning an
error budget from the
analog side assuming
digital is negligible (< 1/5th)…
•
The voltage and current
sensor chains each consist
of a cascade of transfer
functions with gain
•
The measured power is
dependent on a linear
combination of the voltage
and current sensor gain
product terms
•
Budget for the A/D and
sensor contributions to total
uncertainty error by r.m.s.
addition
Sensor
KSENSOR
KA/D
KV or I = KSENSORKA/D
Let’s say 15% ripple is OK in the total analog budget
(pretty generous), and we split it evenly between the
A/D’s and the sensors
Then the A/D’s would be allowed 11% of the budget
20 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Uncertainty Budget Example (continued)
Now we wish to calculate our
A/D budget for finding the
minimum number of bits
of resolution
•
Starts by combining an
equation for power with
an equation for the
propagation of uncertainty
error
•
Requires finding the
partial derivatives for each
of the variable terms
•
But the tan() function
goes to infinity!
•
Compromise: measure
power precisely up to a
PF of 0.707, else, assume
open circuit, or saturation
Pavg  VRMS I RMS cos( )
Where,
21 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Uncertainty Budget Example (continued)
•
Substitute our earlier
budgeted goal for the A/D
chain (~11%)
•
Let’s say we only need
30% (or 2/3, or one
standard deviation) margin
for headroom (~7.33%)
•
Allow for equal
contributions in magnitude
and phase errors from
voltage and current chains
•
•
Remember δϕ implies <7°
matched phase resolution
including phase noise plus
jitter
Not much dynamic range,
but certainly low cost!
Digital calculations
must be < 1%!
| e|
ENOB  1  log 2  
 e 
 5.64
For this example one could use an 8-bit A/D with
16-bit math … and 3 dB headroom/footroom
22 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Uncertainty in Calculating Average Power
• When periodic
signals are
sinusoids,
v(t)  V sin(  c t  1 ) where  c  2f c and f c 
i(t)  I sin(  c t   2 )
Squaring

Pavg can be
Pavg
evaluated
analytically to
arrive at our earlier
simplification, we’ll
call “r.m.s. power”
1

Tc
Tc
 V sin(  t   ) I sin(  t   )dt
c
1
c
2
0
VI
cos(1  2 )
2
 V  I 


 cos( ) where   1  2
 2  2 
 VRMS I RMS ( PF )

23 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
1
Tc
Average Power (continued)
Well, the first problem is that the
“r.m.s. power” simplification
does not always hold…
Pavg by integration
• The average power by
integration is true for all cases,
while “r.m.s. power” is only an
approximation for any case
other than a load with a linear
v-i characteristic
Pavg by multiplication of r.ms. values
• Example: For second-harmonic
with relative amplitude factors
of xv and xi with reference to the
fundamental the equations lead
to noticeably different answers
• Worse, yet, it is noisier!
24 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Not equivalent for all xv and xi and noise is
not “averaged out,” i.e. the covariance
assumption is violated
Deviation of power by r.m.s. multiplication
25 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Average Power: What else can go wrong?
• Squaring a
sinusoid:
• Spectrum of
sinusoid:
sin 2 (c t   ) 
1
1  cos( 2ct  2 ) 
2
1
2
sin( c t) 

1
2
sin ( c t) 
2

c
-c 
-2c
26 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
-c
c 2c

Average Power (continued)
• This works beautifully because the average of a sinusoid across
one or more of its periods is always = 0, for any k, ϕ, or t1
kTc  t1
 sin(  t   )dt  0
 integers k  0 and any t1 or 
c
t1
• Integration can be approximated with a low-pass filter. Most
obvious simple implementation is a boxcar window => sinc()
 w ( ) x(  t )d
T
27 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
0
Magnitude dB
Average Power (continued)
-20
-40
• Spectrum
of Box Car Averaging Window with a
-60
coherently
sampled signal
Squared sinusoid
-80
0
0.1
0.2
0.3
0.4
0.5
0.6
Averaging
Window
(sinc)
0.7
0.8
0.9
1
Spectrum of Power and Filter
Magnitude dB
0
-20
-40
-60
-80
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Normalized Freq (x )
Only DC component remains after integration
 Pavg is a DC value. Perfect!
28 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Average Power (continued)
• This perfect calculation even works with a distorted
signal (harmonics)!
Spectrum of v[n] or i[n]
Magnitude dB
0
DC value reflects
power of
fundamental
and harmonics
-20
3rd Harmonic
-40
2nd Harmonic
-60
-80
Fundamental
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0.8
0.9
1
Spectrum of Power and Filter
Magnitude dB
0
-20
-40
-60
-80
0
0.1
0.2
0.3
0.4
0.5
0.6
Normalized Freq (x )
29 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
0.7
P
avg
Frequency Domain
0
The Real World
Magnitude dB
-20
-40
• What happens
when the integration time or window is
-60
not a perfect
integer multiple of the input period?
-80
-100 vary or ripple over time
– Pavg will
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Normalized Freq (x )
P [k] Time Domain
avg
Amplitude
0.56
0.54
Pavg[k]
0.52
Mean=0.5000
Theo=0.5000
0.5
0.48
0.46
160
180
200
220
Samples
– Why?
30 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
240
260
280
1
Magnit
-40
-60
Deviation of Average Power
-80
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
• Squared spectrum
(with
noise)
and
averaging
filter
Spectrum of Power and Filter
Magnitude dB
0
-20
-40
-60
-80
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Normalized Freq (x )
• Output spectrum of wrong integration length wrt period
P
avg
Frequency Domain
Magnitude dB
0
-20
Bummer
-40
-60
-80
-100
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Normalized Freq (x )
P [k] Time Domain
avg
0.56
31 | Covidien Energy-based
Devices | 5/10/2011 | IEEE SPS - Denver
P
[k]
1
Deviation of Average Power (continued)
• Simulate and test Standard Deviation of Pavg with noise
Pavg Standard Dev vs SNR
0
10
fc=fs/16,N=16
fc=fs/16,N=17
-1
Standard Dev P
avg
[k]
10
Variation of Pavg is
defined by imperfect
window
-2
10
-3
10
-4
10
With a perfect window,
Pavg varies proportional
to noise level
-5
10
-6
10
0
10
20
30
40
50
60
70
SNR dB
32 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
80
90
100
Deviation of Average Power (continued)
Log Standard Dev of Pavg
Big
• But, this could get tedious and interpreting it gets complicated
fast…
FILT A
Wider,
Worse
Main-lobe Width
FILT B
Worse
Narrow,
Better
Small
Side-lobe
Rejection
High Noise
Low Noise
SNR dB
33 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Better
Deviation of Average Power (continued)
• And, results can vary and seem counter-intuitive
• We need to understand better what is going on to optimize this!
Pavg Standard Dev vs SNR
0
10
Goer,N=32,M=32
Goer,N=128,M=128
Goer,N=512,M=512
-1
Standard Dev P
avg
[k]
10
-2
10
-3
10
-4
10
-5
10
-6
10
0
10
20
30
40
50
SNR dB
34 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
60
70
80
90
100
Discrete-time Analysis
• Our approach in bounding this was to start in the continuous-time
domain, then convert to the discrete-time domain
• Simplifications
– No harmonics (or noise)
– Power Factor = 1, or PF angle  = 0 *
– Mathematically, normalized function x = voltage = current
x(,,t)  Asin( t   ) where A  1
Common phase offset, not the PF angle 

• Pdiff, the difference
in Pavg between an ideal integration window and
a non-ideal integration window…
Whole Window
kTc
Tc
T
Fractional Window
35 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Analysis (continued)
•
Pdiff (,,T) 
1
4T
sin( 2)  sin( 2  2T)

Pdiff(,T) at fixed c
Pdiff(, c) at fixed T
Note: offset by 0.5 for illustration purposes.
36 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Analysis (cont)
• Bounding Pdiff across all phase
offsets, 
– Assuming  is unknown, what is
the worst case uncertainty of
Pavg?
– Find min and max of Pdiff
– Define PmaxDev: Maximum
deviation of Pdiff
– Uncertainty of Pavg for stimulus
signal x(t)=Asin(t+)
37 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver

d
Pdiff (,,T)  0
d
 Pdiff ( max ,  , T )

PmaxDev ( , T )  max 
 Pdiff ( min ,  , T )
PmaxDev ( f , T ) 
sinc (2 fT )
2
1

Pavg  A2   PmaxDev ( f , T ) 
2

PmaxDev for Continuous-time
PmaxDev ( f , T ) 
38 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
1
sinc (2 fT )
2
Continuous-Time to Discrete-Time Domain
•
Wow – this looks like the scalloping loss problem of FFT’s!
•
When input signal x(t) is digitized, uncertainties defined by PmaxDev (in
the continuous-time domain) are transformed by the digitization
process
– Pavg is a combination of discrete and continuous variables
– Phase offset θ and sinusoid frequency  are continuous
– Time is discrete
– x(t) becomes x[n] at sample frequency Fs, Ts=1/Fs
– T (the integration or averaging window) becomes NTs, where N is a positive
integer
– PmaxDev is affected by sampling the same way that the continuous-time
Fourier Transform (CTFT) relates to the discrete-time Fourier Transform
(DTFT)
– Replicas every kFs, k {…,-2,-1,0,1,2,…}
39 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
PmaxDev for Discrete-time
• This can be done for any integration method, but for Rectangular or
boxcar integration:
PmaxDev from continuous-time equation
R
maxDev
P
  2 f  kFs  
 2 f  kFs 
1 

sinc  N 
( f , N , Fs )   sinc 



2 k  
 Fs

  Fs  
Shaping due to Rectangular integration
Sampling in time at Ts creates multiple frequency copies at Fs
Closed-form expression not known… yet. This result has been verified by simulation…
40 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
PRmaxDev Simulation Figure
•
PmaxDev for Rectangular Integration
0.5
N=4
N=9
N = 32
0.45
PmaxDev (% x100)
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
Normalized Freq (x)
Nulls at m/N, m = 1, 2, 3…floor(N/2)
Appears to fold over at Nyquist, , instead of sample frequency!
41 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
2
Notes on Discrete Integration Methods
•
Discrete integration algorithms
– Rectangular Method
– Approximation with single points
– Nulls cancel perfectly for coherent sampling with correct window length
– Computationally, the simplest per sample
– Trapezoidal Rule
– Approximation with two point lines
– More accurate (i.e. better sidelobe and stopband), but extra
computations
– Works better for non-coherent sampling or non-perfect window
length
– Simpson’s Rule
– Approximation with three point polynomials
– Most accurate for low/mid frequencies
– Most computationally complex and noisy at high frequencies (near Nyquist)
– Simpson’s Rule is NOT recommended
42 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Shaping Windows
• Similar to a DFT, a shaping window can be placed in the
signal processing chain to help reduce PmaxDev
Squaring
X(t)
X[n]
ADC
Buffer
N
(.)
Shaping
Window
Discrete
Integrator
∑
2
Pavg
N
wT
• This is the same as replacing the integrator with an FIR
filter!
Squaring
X(t)
X[n]
ADC
Buffer
N
43 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
FIR
Pavg
(.)
2
h[n]
Shaping Window (continued)
• PmaxDev with shaping window and rectangular integration
P
maxDev
(% x100)
PmaxDev Rect Integration, N=16, Hann Window
No window
Windowed
0.4
0.3
0.2
0.1
0
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
Zoomed
No window
Windowed
0.05
P
maxDev
(% x100)
0.1
0
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
Normalized Freq (x )
44 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
0.4
0.45
0.5
Now the Hard Part: Pulsed Stimuli
• Example: sinusoid that is pulsed on/off, periodically
• Assume on and off cycles are each an integer number
of sinusoidal periods (this makes it much easier!)
• Math really hard… we resorted to simulation to
determine PmaxDev for any given scenario
Pulse On
Ton
Pulse Off
Toff
Pulse Window
Tpulse
Power Window
45 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Pulsed Stimuli (continued)
• Simulation results
Fixed frequency
Avg Power Var (Rect) w=0.07
Avg Power Var (Rect) w=0.07
DC=1.00 On=1 Off=0 Win=30
DC=0.33 On=1 Off=2 Win=90
DC=0.17 On=1 Off=5 Win=180
0.5
PmaxDev (% x100)
PmaxDev (% x100)
0.5
0.4
0.3
0.2
0.4
0.3
0.2
0.1
0.1
0
DC=0.5 On=2 Off=2 Win=120
DC=0.5 On=8 Off=8 Win=480
DC=0.5 On=16 Off=16 Win=960
0
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Ratio of Power window to Pulse window
Duty Cycle Variable
46 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Ratio of Power window to Pulse window
Duty Cycle Fixed
5
Summary of Pulsed Stimuli
• Pulsed Stimuli
– PmaxDev is null when the averaging (integration) window is an
integer multiple of the pulse period
– For Duty Cycles < 100%, the type of integration (Rectangular or
Trapezoid) becomes less significant, i.e. a Rectangular window
is about as good as it gets
– But, shaping windows still help!
47 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Summary Thus Far…
• We use the digital domain for noisy, non-linear loads
• Eliminate PmaxDev by using boxcar averaging and
– Choosing (or re-sampling) Fs to be an integer multiple of fc
– Fs should be at least > 4fc (due to Nyquist fold-over and squaring)
– Choosing N (averaging window length) to be an integer multiple
of the driving function period, i.e. NTs = Tc
– Choose N to yield an integer multiple of pulsed stimuli period
• If above not possible, minimize PmaxDev by
– Choosing N such that PmaxDev is near a null
– Using Trapezoidal integration instead of Rectangular
– Or, using shaping window, or FIR filter for integrator
– Nulls are in a different place compared to boxcar window
48 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Implementation Comparison Overview
• Digital architectures for calculating Pavg
– Wide-band, Mean-Squared
 “Mean-VI” average power by integration
 “RMS-PF” power by r.m.s. multiplication
– Narrow-band, DFT
 Goertzel DFT (single or multiple frequency)
 Polyphase Demodulation (single or multiple frequency)
– Comparisons
 System resources
 SNR performance via simulation
49 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Comparison Overview (continued)
• Examining viable, efficient implementations
– Others not included: under-sampling, sliding-DFT, IIR filters
• Comparing apples-to-apples as best we can
– System resources: spectrum, memory, computational
complexity
– Performance: accuracy and precision (STD), group delay
(latency)
• This study does not include
– Calibration techniques
– Parasitic or cable compensation techniques
50 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Average Real Power
P[n]  v[n] i[n]
•
Instantaneous Power
•
Average real power, general form
Averaging
filter, LPF
Pavg

Mean-VI
Implementation
•
1

N
N 1
 v[n]  i[n]
n 0
Mean-Square
A good approximation for Pavg when inputs are sinusoidal is by
multiplication of RMS
Pavg  Vrms I rms cos( )
RMS-PF
Implementation
 1

 N

  1
v [ n]   

  N
n 0
 
N 1
2
Power Factor, PF

i [n]   cos( )


n 0

N 1
2
– Harmonics must be equal between voltage and current (true, except non-linear)
– Remember that noise is correlated by squaring, thus roughly doubles!
51 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Real Power by Fourier Transform (continued)
Z  x  jy  Z cos   j sin    Z e j
• Complex numbers
 y
x
  arctan  
Z  x2  y2
• Single-bin Fourier Transform of Voltage and Current
F v(t )  V  a  jb  V e jv
c
F i (t )  I  c  jd  I e
j i
c
• Real Power


P  2  Re V  I *
 2  Rea  jb  c  jd 
 2  Reac  jad  jbc  bd 
 2ac  bd 
52 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Goertzel
or
Polyphase
Demodulation
Implementations
Quick Comparison
• Architectures for calculating Pavg
– Wide-band, Mean-Squared
 Mean-VI
 RMS-PF
– Narrow-band, DFT
 Goertzel
 Polyphase Demodulation
• Double spectrum (for squaring)
• Power of fundamental and
harmonics
• Averaging filter notches-out
squared harmonics
• Normal spectrum (no squaring)
• Power at single frequency only
• DFT:
 time length vs
freq (bin) resolution
 bin alignment
… run multiple times for multiple frequencies and add them!
53 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Decimation can simplify – if you have the time
• Once Pavg is averaged, it doesn’t need to run at the sampling rate,
Fs, because it’s at baseband!
– Therefore, can toss out samples or decimate
– Keep every Mth sample, drop others. But, how much?
• Before dropping samples, the signal must be bandlimited to the
new Nyquist rate:
F 1

frequency 
s

radians 
2 M
M
Spectrum
…
π/M
π
2π
x[n]
…
Drop
Samples
π
2π
54 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
= Control update rate
…defined by
control loop
requirements
LPF
M
x[k]
Decimation (continued)
• Combining Mean-VI and Decimation
LPF
Pavg
1

N
N 1
 v[n]  i[n]
n 0
Pavg
v[n]
@ Fs MSPS
Decimation
N samples
Average
LPF
M
Pavg[k]
@ Fs/M MSPS
i[n]
Both LPFs …Combine!
55 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Decimation (continued)
• Mean-VI and Decimation, nomenclature
Averaging window of
previous N samples
No decimation
1 N 1
Pavg [n]   v[n   ] i[n   ]
N 0
Decimate by M

k is every Mth
sample
of input (n)

1 N 1
Pavg [k]   v[kM   ] i[kM   ]
N 0
Averaging LPF and Decimation LPF
are a combined function
56 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Decimation (continued)
• Averaging window N, moving in time
“Stepping”/non-overlap Window
Sliding/overlap Window
M=N
M<N
k
k
N
N
N
M
M
N
N
N
N
Sample n
Frame Buffer, B
Frame Buffer, B
Sample n
B<M, B<N
Domain of
Polyphase Filter
StructuresM
B>M, B<N
B>M, B>N
N
B<M
“Jumping” Window
B=M
M>N
k
B>M
M,N
N
Not recommended!
M
N
Frame Buffer, B
N
57 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Sample n
B=N
N

Decimation (continued)
• When a boxcar filter is used,
M should be < N for effective
filtering
1 N 1
Pavg [k]   v[kM   ] i[kM   ]
N 0
Magnitude Response (dB)

0
Example: N=8
N=8
-5
Best

M
 new Nyquist freq
Magnitude (dB)
-10
M=4
M=2
-15
M>N
-20
M=N=8
M=3
-25
0
0.1
58 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
0.2
0.3
0.4
0.5
0.6
Normalized Frequency ( rad/sample)
0.7
0.8
0.9
Decimation (continued)
• If the boxcar filter doesn’t cut it, add a designed FIR filter
1 N 1
Pavg [k]   h[ ] v[kM   ] i[kM   ]
N 0
Filter coefficients other than 1
Wider main-lobe
AM
may help
detection
bandwidth of Pavg
We added another
multiply @ Fs.
Computational
complexity goes up.
For M<N, use
polyphase struct
for efficiency.
59 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Mean-VI, Polyphase Moving Average
•
A polyphase moving average filter
implementation
•
Wide-band average power calculation
Polyphase
Pavg[k]
v(t)
ADC
h0[n]
v[n]
+
O((2N+M)k) M<N
O(3Nk) M=N
@Fs
X
i(t)
ADC
i[n]
vi[n]
h1[n]
@
O(n)
@Fs
hM-1[n]
FIR order (N-1)
O((2N/M)n)
(N-1) RAM
60 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
+
Fs
M
Polyphase Demodulation
•
Bandpass frequency content is demodulated to baseband
ej0θr
@Fs
1.5
e
j1θr
@
Fs
M
bin=1
bin=2
bin=3
bin=4
M=8
y[k]
h0[n]
x[n]
complex
value
1
h1[n]
θ=
ej(M-1)θr
2π
M
0.5
r = 0...M-1
hM-1[n]
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Normalized Freq (xπ)
One phasor at ω = r(2π/M)
yields one frequency bin
LPF acts like a bandpass filter
61 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
h[n] is flexible
0.8
0.9
1
Polyphase Demod Implementation
•
A polyphase demodulation implementation
•
Narrow-band calculation only
Polyphase Demod
v(t)
ADC
v[n]
@Fs
Buffer
x[n]
…
x[n-B]
↓M
hm[n]
x
+
a
O(k)
jθ
e
x
jb
FIR order (N-1)
O((2N/M+3)n)
N RAM
@
Polyphase Demod
i(t)
ADC
i[n]
@Fs
Buffer
x[n]
…
x[n-B]
↓M
hm[n]
+
c
ejθ
FIR order (N-1)
O((2N/M+3)n)
N RAM
•
x
Fs
M
O(k)
x
+
Pavg[k]
O((4N+3M+3)k) M<N
O((7N+3)k) M≥N
O(k)
jd
Extract voltage and current AM waveforms before multiplying for Pavg
– “Double” spectrum not needed anymore, but more computations since voltage
and current are processed separately
62 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Goertzel Implementation
•
•
Goertzel: Single FFT bin via IIR filter (often used for tone detection)
–
Could be used for extracting phase information on RMS-PF
–
Calculate Pavg via complex values
Narrow-band calculation
Goertzel operates at M≥N
For M<N, use sliding-Goertzel
RF Measure
Buffer
v(t)
ADC
v[n]
@Fs
x[n]
…
x[n-B]
↓M
Goertzel Filter
a
hG[n]
O(k)
Complex
x
jb
O(3Nk)
O(3k)
B=N, M≥N
@
Fs
M
O(k)
i(t)
ADC
i[n]
@Fs
x[n]
…
x[n-B]
Pavg[k]
O((6N+9)k)
RF Measure
Buffer
+
↓M
Goertzel Filter
c
hG[n]
Complex
O(3Nk)
O(3k)
jd
B=N, M≥N
63 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
O(k)
x
Polyphase Demod and Goertzel
• Carrier frequency fc, with respect to the DFT bin, is important,
especially in performance comparisons
Polyphase Demod vs Goertzel, M=64
4
grz 512 b49
poly 64 b7
fc
2*fc
2
Gain, dB
0
-2
Scalloping loss!
-4
-6
-8
0.16
0.17
0.18
0.19
0.2
Normalized Freq (x )
64 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
0.21
0.22
When Fs is an
integer multiple
of fc, DFT bins
will align,
otherwise,
there may be
scallop loss
RMS-PF Implementation
•
RMS-PF Implementation
•
Wide-band calculation
VRMS
RF Measure
v(t)
ADC
v[n]
O((3N+59)k)
@Fs
O((3N+16)k)
LPF
O((3N+62)k)
O(3k)
V
Power
Factor
-
+
Φ
O(k)
RF Measure
i(t)
ADC
VRMS[k]
LPF
O(3k)
cos
O(12k)
x
O(2k)
LPF
Pavg[k]
O((12N+171)k)
O(3k)
@
I
i[n]
O((3N+16)k)
@Fs
O((3N+59)k)
IRMS
LPF
IRMS[k]
O((3N+62)k)
O(3k)
65 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Fs
M
RMS-PF Implementation (continued)
Boxcar
Averaging
Filter
RF Measure
Buffer
x(t)
ADC
x[n]
@Fs
x[n]
…
x[n-B]
↓M
Root-Mean-Squared
Squaring
Mean
Root
1
(.)2
Σ
N
N
O(Nk)
O((N-1)k)
O(k)
(.)
O(28k)
B=N
M≥N
XRMS[k]
O((3N+59)k)
@
Goertzel Filter
Fs
M
Angle
hG[n]
Complex
O(3Nk)
O(3k)
66 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
a+jb
arctan
O(13k)
X[k]
O((3N+16)k)
Computational Complexity Comparison
Boxcar Filter
Computational Complexity for P avg[k]
Mean-VI
RMS-PF
Goer
PolyD
Normalized O(k) (xN)
10
RMS-PF
8
PolyD
6
Process
v(t) and i(t)
individually
Goertzel
4
Mean-VI
Shaped filter
2
0
0
0.2
0.4
Must consider
spectral content
0.6
0.8
1
1.2
1.4
1.6
1.8
2
when comparing
Normalized M (xN)
Big O!
Typically desire to operate in M<N for lowest latency…
Trade-off is higher STD (less processing gain)
67 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Conclusions
• Best in show
– Wide-band: Mean-VI Multistage
 Minimal system resources
 Most flexible filter design
– Narrow-band: Polyphase Demodulation
 Works best for negligible harmonic content
 Efficient for M<N
 Flexible filter design
• Runners up
– Narrow-band: Goertzel
 Efficient for M>N, but filter inflexible
– Wide-band: RMS-PF
 SQRT and separate computation of phase are killers!
68 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Thank you Brian Roberts!
I owe much to Brian Roberts for his help on everything, but
especially on producing the simulations and the slides!
69 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Questions?
70 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver
Supporting Slides
71 | Covidien Energy-based Devices | 5/10/2011 | IEEE SPS - Denver