Hi Guys -
As the OP, I realized that I should probably more clearly state my
objectives so as to make it easier for you to focus your advice.
1. I am measuring 3-Phase Volts and 3-Phase Amps
2. It must yield a 'True RMS' measurement accurate to 1% of full scale
for voltage (say 480V), and 2% of full scale current (5A).
3. The current sensing will use standard 5A secondary Current
Transformers across a precision shunt resistor.
4. The processor available is a 32 bit ARM Cortex with built-in ADC (12Bit).
5. I expect substantial harmonics and possibly conducted/radiated noise
from non-linear loads such as VFDs. Measurement up to the 10th
harmonic is desirable.
6. I don't need especially speed response of the Volts and Amps values,
substantial delay is acceptable up to perhaps a second or two.
7. It must work with engine-driven generator outputs which may not be
'stiff' power supplies compared to the grid. However, usually the
outputs will be reasonably well regulated with electronic governors and
automatic voltage regulators.
8. Although its not part of my initial design, I do anticipate adding
phase angle to complete KW and PowerFactor and to possibly trigger
in-phase synchronization of two AC sources.
9. Although there is a fairly high power CPU available, lots of other
activities will be happening at the same time such as network
communications, supervisory functions, time delay logic, processing of
sensors, etc. This is happening within the framwork of a basic
pre-emptive RTOS (FreeRTOS).
10. It is desirable to do as much of the RMS processing and filter in
software so as to keep the hardware generic.
Hopefully this helps to focus the discussion.
Thanks for your input Tim, John, and Mike.
Paul
Good comments guys.
I am reviewing an existing software design from another engineer so I
needed to spend some time trying to understand what is currently being
done. This design works but has problems with current sensing not
working or working inaccurately when presented with non-linear VFD
loads.
The basic sequence is as follows. Each RMS calculation is tored in a
ring buffer in FIFO fashion:
Calculate average RMS current (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS Voltage (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS current (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS Voltage (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS current (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS Voltage (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS current (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS Voltage (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS current (Ph A, B, and C)
Wait 200ms while doing other systems tasks
Calculate average RMS Voltage (Ph A, B, and C)
The averages of the above 5 calculations is taken and presented to the
display screen and monitoring system.
Each RMS calculation consists of:
1) Each 1/2 waveform being sampled at 21us between each sample.
2) Slope detection and zero crossing detection is used to start and
stop the sampling and to identify "tops" and "bottoms" of the waveforms.
3) The tops and bottoms are sampled in an alternating fashion for each
RMS calculation above. Hence, we might sample a top and then approx
200ms later start sampling a bottom.
4) When two tops and two bottoms are sampled (equivalent to 2 cycles),
then these are used to calculuate RMS and is fed to the ring buffer
above.
5) The microcontroller has a hardware feature for detecting zero
crossings which is used at the basis of the zero crossing detection
using interrupts. We also do some additional checks to verify
monotonicity on the result of the zero crossing to try to verify that
its legitimate and not "noise".
6) There does not appear to be any low pass filtering in the digital
domain. There is some hardware filtering; a second order filter that
starts to roll off quickly after the 10th harmonic (assuming 60hz
fundamental).
I know the devil is in the details and I've probably left out some
important ones that I have yet to discover but I am wondering if anyone
has any general comments or critique on this overall approach?
It strikes me that:
a) The sampling rate seems unnecessarily high. Its sort of like we can
vastly oversampling with LONG gaps between sampling runs.
b) Splitting the waveforms into tops and bottoms seems complicated and
subject to error in the presence of harmonics. i.e. how do we know we
are on a positive slope of the fundamental and not the positive slope
of a double dip bump due to harmonics?
c) There could be things changing in between the long gaps of sampling
runs. For example the frequency shifts between the time we sampled the
top and later sampled a bottom.
d) the zero crossing detection in the microcontroller is a bit of a
black box for me. Its not clear to me these are designed to work on
noisy waveforms.
Thanks!