6 data flow, Data flow – Maxim Integrated 71M6534 Energy Meter IC Family Software User Manual

Page 63

Advertising
background image

71M653X Software User’s Guide

5.6 DATA FLOW

The ADC collects data from the electrical inputs on a cycle that repeats at 2520Hz. On each ADC cycle, the compute
engine (CE) code digitally filters and adjusts the data using gain parameters (CAL_Ix, CAL_Vx) and phase adjustment
parameters (PHADJ_x).

Normally, a calibration operation during manufacturing defines these adjustments and stores them in flash or EEPROM
to be placed into CE memory. The Demo Code includes a fast self-calibration function that can typically reach 0.05%
accuracy. (See Calibration() in meter\calphased.c, called from meter_run(0 in meter\meter.c).

The calibration save and restore operations (cal_save() and cal_restore() ) save and restore all adjustment variables,
such as the constants for the real-time clock, not just the ones for electrical measurements.

On each ADC cycle, 2520 times per second, the CE performs the following tasks:

1. It calculates intermediate results for that set of samples.

2. It runs a debounced check for sagging mains, with a configurable debounce.

3. It has three equally-spaced opportunities to pulse each pulse output.

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 (announcing a momentary brownout condition or even a blackout), the cumulative
quantities in memory are written to the EEPROM.

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 counts zero crossings on the same phase as the frequency (MAINEDGE_X).

The CE code (see ce\ce3x_ce.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 meter\ce.c, xfer_busy_isr())
occurs. This is the signal for the MPU to use the CE’s data.

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 (VThrshld, IThrshld). If Ithrshld is 0, creep logic is
disabled.

The MPU calculates human-readable values, and accumulates cumulative quantities (see meter\meter.c, meter_run()
). The MPU scales these values to the PCB's voltage and current sensors (see VMAX and IMAX).

The CE’s Wh and VARh quantities are signed, permitting the MPU to perform net metering by assigning negative
values to "export" and positive values to "import" (see meter.c. Wh.c, VAh.c and VARh.c.

The calculations needed for a meter require more precision than standard C floating point provides. The Demo Code
has a “meter math” package to add CE Wh or VARh data to a meter register without overflow (see Util\math.c). There
are also routines to add a meter register to another meter register (add8), and a routine to convert a meter register to a
floating point value (s2f(), useful to calculate ratios).

v1.1v1.1

TERIDIAN Proprietary

63 of 116

© Copyright 2005-2008 TERIDIAN Semiconductor Corporation

Advertising
This manual is related to the following products: