Maxim Integrated 71M6513H Power Meter IC Family Software User Manual
Page 67

71M651x Software User’s Guide
On each ADC cycle, an MPU interrupt, "ce_busy" (see ce.c, ce_busy_isr() ) is generated. Normally, the interrupt
service routine checks the CE's status word for the sag detection bits, and begins sag logic processing if a sag of the
line voltage is detected.
In the event of a sag detection, the cumulative quantities in memory could be written to the EEPROM. The demo code
intentionally omits this sag logic, because that varies by application, and might actually interfere with demonstration. It
does, however, arrange to keep valid CRC-protected values (see ce.c Accumulate_Energy() ) in battery-backed RAM,
which permits the demo system to become a simple functional meter with the addition of a suitable battery.
By the end of each accumulation interval, each second on the demo code, the CE performs the following tasks:
1. It calculates deviation from nominal calibration temperature (TEMP_X).
2. It calculates the frequency on a particular phase (FREQ_X).
3. It calculates watt hours (Wh) for each conductor, and the meter (WxSUM_X).
4. It calculates var hours (VARh) for each phase and the meter (VARxSUM_X).
5. It calculates summed squares of currents for each phase (IxSQSUM_X).
6. It calculates summed squares of voltages for each phase (VxSQSUM_X).
7. It calculates lags between different phases (on 3-phase meters) (PH_Atox).
8. It counts zero crossings on the same phase as the frequency (MAINEDGE_X).
The CE code (see ce1x.c) digitally filters out the line frequency component of the signals, eliminating any long-term
inaccuracy caused by heterodyning between the line frequency and the sampling or calculation rates. This also
permits a meter to be used at 50 or 60Hz, or with inaccurate line frequencies.
The CE has several equations of calculation, so that it can calculate according to the most common methods.
Once per accumulation interval, the MPU requests the CE code to fetch an alternative measurement (alternate multi-
plexer cycle).
At the end of each accumulation interval, an MPU interrupt, the "xfer_interrupt" occurs (see ce.c, xfer_busy_isr())
occurs. This is the signal for the MPU to copy the above data to stable storage for further use.
At this time, the MPU performs creep detection (ce.c Apply_Creep() ). If the current or the accumulated energy (watt
hours) are below the minimum, no current or watts are reported. If volts are below the threshold, no frequency or edge
counts are reported. The MPU's creep thresholds are configurable (CREEP_THR, VThrshld, IThrshld).
The MPU calculates human-readable values, and accumulates cumulative quantities (see ce.c, ce_update() ). The
MPU scales these values to the PCB's voltage and current sensors (see VMAX and IMAX).
Watt hours and Var hours are signed, permitting the MPU to perform net metering by assigning negative values to
"export" and positive values to "import" (see ce.c. WSum_Isrc(), WSum_ESrc(), VarSum_Isrc() and VarSum_Esrc() ).
At very low currents, the watt hours have a lower noise-floor than the direct current measurements. The Demo Code
includes a mode to detect this case, and use the alternate low-noise calculations. In this mode, with disabled (zero)
creep thresholds, it measures current down to a few milliamps (ce.c, ce_updated(), Compute_Small_Irms() ).
The multiple-precision calculations needed for a meter require more precision than standard C floating point provides.
The Demo Code has many reusable extended-precision calculations (classics.c, library.c), including a square-root that
takes a 64-bit number for accurate calculation of VA (library.c).
The MPU also places a scaled value into the CE RAM for each pulse output (ce.c, see xfer_busy_isr(),
Pulse_Src_Func[]). This adjusts the pulse output frequency in such a way as to reflect that accumulation's contribution
to the total pulse interval. Pulse intervals are cumulative, and cumulatively accurate, even though the frequency is
updated only periodically.
Placing the pulse value selection logic into the MPU software means that any quantity from any phase or combination
of phases can control either pulse output (see Pulse_Src_Func[] for a list of transfer functions).
The MPU also performs temperature adjustments of the real-time clock (rtc.c, RTC_Trim(), RTC_Adjust() ). The Demo
Code can adjust the clock speed to a resolution of 1 part per billion, roughly one second per thirty years. The
adjustments include offset (Y_CAL), temperature-linear (Y_CALC) and temperature-squared (Y_CALC2) parameters.
Once a human-readable quantity is available, it can be translated into a set of segments (display.c, lcd.c) to display on
the liquid crystal display, or read from a register in memory by means of the command-line interface (cli.c), or possibly
some other serial protocol such as Flag or NEMA.
Revision 2.4
TERIDIAN Proprietary
67 of 137
© Copyright 2005-2006 TERIDIAN Semiconductor Corporation