Maxim Integrated 78M6631 User Manual

AVAILABLE
78M6631
Firmware Description Document
October 10, 2011
Rev 2
UG_6631_078
78M6631 Firmware Description Document UG_6631_078
Maxim Integrated 160 Rio Robles, San Jose, CA 95134 USA 1-408-601-1000
Maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim product. No circuit patent licenses are implied. Maxim reserves the right to change the circuitry and specifications without notice at any time. The parametric values (min and max limits) shown in the Electrical Characteristics table are guaranteed. Other parametric values quoted in this data sheet are provided for guidance.
©
XXXX Maxim Integrated
The Maxim logo and Maxim Integrated are trademarks of Maxim Integrated Products, Inc.
UG_6631_078 78M6631 Firmware Description Document
Table of Contents
1 Introduction ................................................................................................................................... 5
2 Functional Description .................................................................................................................. 7
2.1 Initialization and Startup ........................................................................................................... 7
2.2 Measurements and Signal Processing Flow ............................................................................. 7
2.2.1 Description of Measurement Equations........................................................................ 7
2.2.2 Front-End and Input Stage .......................................................................................... 8
2.2.3 Voltage and Current RMS Calculation ......................................................................... 9
2.2.4 Active, Reactive and Apparent Power Calculation ...................................................... 10
2.2.5 Voltage and Current Harmonics and Fundamental Measurement............................... 11
2.2.6 Power Harmonics and Fundamental Measurement .................................................... 11
2.2.7 Power Factor Calculation ........................................................................................... 12
2.2.8 Line Frequency ......................................................................................................... 12
2.2.9 Accumulation Interval ................................................................................................ 12
2.2.10 Zero Crossing Detector ............................................................................................. 12
2.2.11 Sine and Cosine Reference ....................................................................................... 13
2.2.12 High-Pass Filters ....................................................................................................... 13
2.3 Configuration and Control ...................................................................................................... 14
2.3.1 Input Registers .......................................................................................................... 14
2.3.2 Sensors Configuration ............................................................................................... 14
2.3.3 Updating Flash .......................................................................................................... 14
2.3.4 Scaling ...................................................................................................................... 14
2.3.5 Calibration ................................................................................................................. 15
2.3.6 Phase Error Compensation........................................................................................ 16
2.3.7 Limit (Alarms) Settings .............................................................................................. 16
2.3.8 Creep Threshold........................................................................................................ 16
2.3.9 Digital I/O Configuration............................................................................................. 16
3 Serial Peripheral Interface (SPI) .................................................................................................. 17
4 Serial Communication and CLI ................................................................................................... 18
4.1 CLI Interface .......................................................................................................................... 18
5 Register Descriptions .................................................................................................................. 19
5.1 Command Register ................................................................................................................ 19
5.2 Status Register ...................................................................................................................... 20
5.3 Measurement Results Register .............................................................................................. 21
5.3.1 High-Rate Results Registers...................................................................................... 23
5.4 Parameters Configuration ...................................................................................................... 24
5.4.1 Scaling ...................................................................................................................... 24
5.4.2 Alarms Limit Setting................................................................................................... 24
5.4.3 Phase Error Compensation........................................................................................ 24
5.4.4 Digital I/O Configuration............................................................................................. 25
5.4.5 Calibration and Configuration Variables ..................................................................... 25
6 System Connection Diagram Examples ..................................................................................... 26
7 Command Line Interface (CLI) Description ................................................................................ 29
7.1 Identification and Information Commands............................................................................... 29
7.2 Reset Commands .................................................................................................................. 29
7.3 Data Access Commands ........................................................................................................ 29
7.3.1 Individual Address Read ............................................................................................ 30
7.3.2 Consecutive Read ..................................................................................................... 30
7.3.3 Block Reads .............................................................................................................. 30
7.3.4 Concatenated Reads ................................................................................................. 30
7.3.5 Repeat Command ..................................................................................................... 31
8 Contact Information ..................................................................................................................... 32
Revision History .................................................................................................................................. 32
Rev 2 3
78M6631 Firmware Description Document UG_6631_078
Tables
Table 1: Measurement Equations Definitions ........................................................................................... 7
Table 2: SPI Command Description ....................................................................................................... 17
Figures
Figure 1. Simplified Connection Diagram of a 3-Phase Wye System ........................................................ 5
Figure 2. Simplified Connection Diagram of a 3-Phase Delta System ....................................................... 6
Figure 3. Input Stage Signal Processing Path .......................................................................................... 8
Figure 4. Voltage and Current RMS Calculations ..................................................................................... 9
Figure 5. Power and Power Factor Signal Processing Chain .................................................................. 10
Figure 6. Voltage and Current Harmonics and Fundamental Measurements .......................................... 11
Figure 7. Power Harmonic and Fundamental Measurements ................................................................. 11
Figure 8. 3-Phase System Calibration Test Setup Example .................................................................... 15
4 Rev 2
UG_6631_078 78M6631 Firmware Description Document
A
Neutral
B
C
VC
VB
VA
LOAD A
LOAD B
LOAD C
IAP
IAN
IBP
IBN
ICP
ICN
V3P3A
A
Neutral
B
C
78M6631
D/Y
Teridian is a trademark of Maxim Integrated Products, Inc.

1 Introduction

This document describes the 78M6631 firmware (6631_3PH_6S_URT_B21), which can be used with the Teridian™ 78M6631 energy measurement IC. This firmware provides measurements for a 3-phase system along with simple methods for calibration, configuration, and access to metrology data. This document contains the following sections:
Functional Description: Signal Processing Flow, Functions, Calibration, and Operations
Configuration and Control: Configurability and Settings
Communications: Communication Interfaces and Protocols Description
The calculations are done on each of the phases individually and the aggregate measurements are also available as follows:
Voltage rms (Phase A, B, C)
Current rms (Phase A, B, C)
Active Power (Phase A, B, C)
Apparent Power (Phase A, B, C)
Reactive Power (Phase A, B, C)
Power Factor (Phase A, B, C)
Line Frequency
The firmware also provides measurement results on fundamentals and harmonics. Section 2.2.5 describes how to access and configure harmonics measurements.
The firmware supports Delta and Wye Configurations, the configuration is selectable through a dedicated pin (D/Y) of the 78M6631 or by modifying the configuration register.
Figure 1. Simplified Connection Diagram of a 3-Phase Wye System
Rev 2 5
78M6631 Firmware Description Document UG_6631_078
A
B
C
VC
VB
VA
LOAD A-C
IAP
IAN
IBP
IBN
ICP
ICN
V3P3A
A
B
C
78M6631
LOAD A-B
LOAD B-C
D/Y
Figure 2. Simplified Connection Diagram of a 3-Phase Delta System
All measurement calculations are computed by the 78M6631 and accessible through serial interfaces: UART0 on the TX and RX pins and the Serial Peripheral Interface (SPI).
On the UART, the CLI (Command Line Interface) handles the serial communications .The CLI provides access to internal data and allows issuing commands through the serial port. Section 3 provides details on serial port default configuration and Section 4 describes the CLI commands.
Note that the firmware does not support I
2
C, RTC (real-time clock), and battery modes.
6 Rev 2
UG_6631_078 78M6631 Firmware Description Document
Symbol
Parameter
Equation
PF
Power Factor
P/S

2 Functional Description

This section summarizes the functional operation of the 78M6631 firmware. Refer to the IC data sheet and application notes for more information on terminologies and detailed IC operation.

2.1 Initialization and Startup

Upon power-up, both MPU and Compute Engine (CE) cores start executing the application code from designated blocks of flash memory. The parameters and defaults are copied from Flash memory into RAM and accessible (R/W) through the communication interfaces and utilized by the firmware.
After the initialization phase, the firmware starts regular operations and signal processing.
The user can modify any parameters specified as input register, however the modified values are volatile and will be lost during a power-down or reset. To permanently save the value of the input registers it is necessary to store them to flash. A section in this document describes which registers can be saved into flash memory and the relevant command.

2.2 Measurements and Signal Processing Flow

2.2.1 Description of Measurement Equations

The firmware provides the user with continuously updated measurement data. Table 1 lists the basic measurement equations.
Table 1: Measurement Equations Definitions
V RMS Voltage
I RMS Current
P Active Power
Q Reactive Power
S Apparent Power S = V * I
PA N/A Phase Angle ACOS (P/S)
V = √∑
I = √∑
P = ∑
Q = ∑
(i(t) * vq(t))
2
v(t)
2
i(t)
(i(t) * v(t))
The integrated AFE and CE function as a data acquisition system, controlled by the MPU. The low­voltage analog input signals are sampled and stored in CE DRAM where they are processed by the CE. This firmware utilizes an effective sampling rate of 2521 samples per second. The sampling rate is referred to each individual channel.
The CE, a dedicated 32-bit signal processor, performs the computations necessary to perform all the measurements. The CE calculations and processes include:
Multiplication of each current sample with its associated voltage sample to obtain the energy per sample (when multiplied with the constant sample time).
Frequency-insensitive delay cancellation on all channels (to compensate for the delay between samples caused by the multiplexing scheme).
90° phase shifter (for VAR calculations).
Monitoring of the input signal frequency.
Monitoring of the input signal amplitude.
Scaling of the processed samples based on calibration coefficients.
Rev 2 7
78M6631 Firmware Description Document UG_6631_078
SINC
3
DECIMATOR
IA
CROSS-
POINT
∆Σ
MODULATOR
PRECISION
REFERENCE
IA_RAW
VA_RAW
IB_RAW
VA1
F
ADC
+
250mv
ADC
X
X
X
X
VB_RAW
IA1
VA
IB
VB
IC
VC
IC_RAW
VC_RAW
IoffsA
VoffsA
Φ COMP
PCOMPA
TEMPERATURE
SENSOR
Temperature
Compensation
IgainA
+
VgainA
+
VB1
X
X
X
X
IB1
IoffsB
VoffsB
Φ COMP
PCOMPB
IgainB
+
VgainB
+
VC1
X
X
X
X
IC1
IoffsC
VoffsC
Φ COMP
IgainC
+
VgainC
+
PCOMPC
Φ COMP
Φ COMP
Φ COMP
At the end of each accumulation interval, these measurements are provided to the MPU for post­processing. Alternate multiplexer cycles also gather measurements of the IC’s junction temperature for additional compensation in the MPU. Post-processing functions handled by the MPU at the end of every accumulation interval include:
Compensation for environmental variables
Calculation of apparent power, power factor, phase angle, and line frequency
Comparing of measurement outputs to configurable alarm thresholds
Scaling and formatting of output measurement data
Updating of all output registers (data and alarm status)

2.2.2 Front-End and Input Stage

Figure 3 shows the ADC signal path and signal processing for the voltage and current input channels.
Figure 3. Input Stage Signal Processing Path
The gray boxes are the gain calibration input registers. These registers can be modified by the user or by the gain calibration routine for both voltage and current channels.
The voltage and current inputs channels are also temperature compensated. A compensation algorithm based on the reading of an on-chip temperature sensor, corrects the gain in order to maintain the accuracy across the temperature range.
The phase compensation block allows to digitally correct phase errors. These errors are usually introduced by the voltage/current transformers or external filters. The phase error is calibrated by introducing a time delay or a time advance, specified in the phase adjust registers. The registers PCompA, PCompB, and PCompC can be modified by the user.
A configurable high-pass filter (HPF) in both voltage and current signal path removes any DC content (offset) in the inputs.
8 Rev 2
UG_6631_078 78M6631 Firmware Description Document
=
Vn


N
=
In


N
IC_SQ
VC_SQ
IC_SQSUM
VC_SQSUM
IC_RAW
IrmsC
VrmsC
IB_SUM IB_OFFS
VC1
N
N- 1
X
n= 0
N-1
n=0
N-1
n=0
PHASE C
IC1
VC_RAW
VB_SUM
VB_OFFS
N- 1 n= 0
N
N
X
N
+
Iroff
IB_SQ
VB_SQ
IB_SQSUM
VB_SQSUM
IB_RAW
IrmsB
VrmsB
IB_SUM IB_OFFS
VB1
N
N- 1
X
n= 0
N-1
n=0
N-1
n=0
PHASE B
IB1
VA_RAW
VB_SUM
VB_OFFS
N- 1 n= 0
N
N
X
N
+
Iroff
IA_SQ
VA_SQ
IA_SQSUM
VA_SQSUM
IA_RAW
Irms A
Vrms A
IA_SUM
IA_OFFS
VA1
N
X
PHASE A
IA1
VA_RAW
VA_SUM
VA_OFFS
N
N
X
N
+
Iroff
N-1
n=0
N-1
n=0
N-1
n=0
N-1
n=0

2.2.3 Voltage and Current RMS Calculation

As shown in Figure 4, the voltage and current channels ADC output samples are used to continually compute the RMS (root mean square). The RMS is obtained by performing the square sum of the instantaneous samples of voltage and current over a time interval (commonly referred as accumulation time) and then performing a square root of the result:
In Figure 4, the output registers are represented in gray.
Figure 4. Voltage and Current RMS Calculations
Rev 2 9
78M6631 Firmware Description Document UG_6631_078
IC1
VC1
WATTSUM_C
Quadrature
Delay
X
LPF
Σ
(TMP)
LPF
Σ
+
X
WATT C
VAR C
Poff
X
VA C
INVERSE
X
PF C
VqC
N
N
N-1
n=0
VrmsC
IrmsC
(TMP)
PHASE C
IB1
VB1
WATTSUM_B
Quadrature
Delay
X
LPF
Σ
(TMP)
LPF
Σ
+
X
WATT B
VAR B
Poff
X
VA B
INVERSE
X
PF B
VqB
N
N
N-1
n=0
VrmsB
IrmsB
(TMP)
PHASE B
IA1
VA1
WATTSUM_A
Quadrature
Delay
X
LPF
Σ
(TMP)
LPF
Σ
+
X
WATT A
VAR A
Poff
X
VA A
INVERSE
X
PF A
VqA
N
N
N-1
n=0
VrmsA
IrmsA
(TMP)
PHASE A

2.2.4 Active, Reactive and Apparent Power Calculation

Figure 5 shows the signal processing chain for active and reactive power calculations.
Figure 5. Power and Power Factor Signal Processing Chain
Active Power
The instantaneous power is obtained multiplying instantaneous voltage and current samples. The product is then averaged over N conversions (accumulation time) to compute active power (WATTA, WATTB and WATTC), the aggregate value (WATTS) is the sum of the 3 phases active power average.
Apparent Power
The apparent power (VA-A, VA-B, VA-C) is the product of rms voltage (VrmsA, VrmsB, and VrmsC) and rms current (IrmsA, IrmsB, IrmsC):
VA = I
RMS
x V
RMS
Reactive Power
The reactive power is calculated as multiplication of instantaneous samples of current (IA1, IB1, IC1) and the instantaneous quadrature voltage (VqA, VqB, VqC). The quadrature voltage is obtained through a 90°
phase shift (quadrature delay) of the voltage samples. The samples are then averaged over the accumulation time interval and updated in the VARA, VARB, and VARC registers.
10 Rev 2
Loading...
+ 22 hidden pages