Implementation of A Low-Cost Three-Phase Electronic Watt-Hour Meter Using The MSP430F67641
Implementation of A Low-Cost Three-Phase Electronic Watt-Hour Meter Using The MSP430F67641
Implementation of A Low-Cost Three-Phase Electronic Watt-Hour Meter Using The MSP430F67641
ABSTRACT
This application report describes the implementation of a low-cost three-phase electronic electricity meter
using the Texas Instruments MSP430F67641 metering processor. This application report includes the
necessary information with regard to metrology software and hardware procedures for this single-chip
implementation.
The MSP430F67641 source code that is described in this application report can be downloaded from
http://www.ti.com/lit/zip/slaa621.
The MSP430F67641A source code can be downloaded from http://www.ti.com/tool/TIDM-3PH-ENERGY5-
ESD.
The design files for the EVM can be downloaded with the Class 0.5 Three-Phase Smart Meter Reference
Design (TIDM-THREEPHASEMETER-F67641).
WARNING
Failure to adhere to these steps and/or not heed the safety
requirements at each step may lead to shock, injury, and damage
to the hardware.
Contents
1 Introduction ................................................................................................................... 3
2 System Diagrams ............................................................................................................ 3
3 Hardware Implementation .................................................................................................. 5
4 Software Implementation ................................................................................................... 8
5 Energy Meter Demo........................................................................................................ 26
6 Results and Calibration .................................................................................................... 33
7 Schematics .................................................................................................................. 53
List of Figures
1 3-Phase 4-Wire Star Connection Using MSP430F67641 .............................................................. 4
2 Simple Capacitive Power Supply for the MSP430 Energy Meter ..................................................... 5
3 Switching-Based Power Supply for the MSP430 Energy Meter ....................................................... 6
4 Analog Front End for Voltage Inputs ...................................................................................... 7
5 Analog Front End for Current Inputs ...................................................................................... 7
6 Foreground Process ....................................................................................................... 10
7 Background Process ....................................................................................................... 14
8 ADC10 Triggering Process................................................................................................ 16
9 per_sample_dsp() .......................................................................................................... 18
10 Frequency Measurement .................................................................................................. 19
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 1
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com
List of Tables
1 Header Names and Jumper Settings on the EVM430-F67641 ...................................................... 29
2 Displayed Parameters ..................................................................................................... 34
3 Cumulative Phase Active Energy Measurement Error (%) ........................................................... 45
4 Cumulative Phase Reactive Energy Measurement Error (%) ........................................................ 46
5 Phase A Active Energy Measurement Error ............................................................................ 47
6 Phase B Active Energy Measurement Error ............................................................................ 48
7 Phase C Active Energy Measurement Error ............................................................................ 49
8 Cumulative Active Energy Measurement Error, ±10% Nominal Voltage............................................ 50
9 Cumulative Active Energy Measurement Error, 100 V to 270 V, No EVM Modifications ......................... 51
10 Cumulative Active Energy Measurement Error, 100 V to 320 V, Varistors Removed ............................ 52
2 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Introduction
1 Introduction
The MSP430F67641 device is the latest metering system-on-chip (SoC) that belongs to the
MSP430F67xx family of devices. This family of devices belongs to the powerful 16-bit MSP430F6xx
platform, which brings in many new features and provides flexibility to support robust poly-phase
metrology solutions. These devices find their application in energy measurement and have the necessary
architecture to support them.
The F67641 has a powerful 25-MHz CPU with MSP430CPUX architecture. The analog front-end consists
of three 24-bit ΣΔ analog to digital converters (ADC) that are used for sensing current and a 10-bit SAR
ADC for sensing phase voltages. The ΣΔ ADCs are based on a second-order sigma-delta architecture and
they support differential inputs. The sigma-delta ADCs (ΣΔ24_B) operate independently and are capable
of 24-bit results. In addition, it also has an integrated gain stage to support gains up to 128 for
amplification of low-output current sensors In contrast, the 10-bit SAR supports single-ended inputs and
performs sequential sampling of the three different phase voltages, the integrated temperature sensor, the
voltage of the active supply powering the chip (VDSYS), and an additional optional auxiliary power supply
(selected by the AUXADCSELx bits). The ΣΔ24_B on the F67641 module has a trigger generator that
triggers the ADC10 to ensure that the timing between the ADC10 and ΣΔ modules are grouped and
synchronized.
A 32-bit x 32-bit hardware multiplier on this chip can be used to further accelerate math intensive
operations during energy computation. The software energy library supports calculation of various
parameters for up to three-phase energy measurement. The key parameters calculated during energy
measurements are: RMS current and voltage, active and reactive power and energies, power factor, and
frequency. The library also provides the option to obtain raw samples of voltages and currents for
advanced metering data such as harmonic analysis and total harmonic distortion (THD).
Complete metrology source code is provided. The MSP430F67641-based software can be downloaded
from http://www.ti.com/lit/zip/slaa621. The MSP430F67641A-based software can be downloaded from
http://www.ti.com/tool/TIDM-3PH-ENERGY5-ESD.
2 System Diagrams
Figure 1 shows a block diagram of the high level interface used for a three-phase energy meter
application using the F67641. A three-phase four-wire star connection to the AC mains is shown in this
case. Current sensors are connected to each of the current channels and a simple voltage divider is used
for corresponding voltages. The CT has an associated burden resistor that must be connected at all times
to protect the measuring device. The choice of the CT and the burden resistor is done based on the
manufacturer and current range required for energy measurements. The CTs can be easily replaced by
Rogowski coils with minimal changes to the front-end.
The trigger generator of the ΣΔ is used to trigger the ADC10 to perform conversions, thereby
synchronizing it with the ΣΔ converter's timings. For the voltage sensor, a combination of a voltage divider
and level shifter are used to ensure that the input voltage to the ADC fits within the single-ended voltage
range of operation. The range of operation is determined by the chosen reference voltage source of the
SAR ADCs. The choice of voltage divider resistors for the voltage channel is selected to ensure the mains
voltage is divided down to the normal input ranges that are valid for the SAR ADC, based on the selected
reference voltage. See the MSP430x5xx and MSP430x6xx Family User's Guide (SLAU208) and the
device-specific data sheet for these values.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 3
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
System Diagrams www.ti.com
Load +
A
B
-
TOTAL kWh
Phase C
Phase A
VCC Sx,COMx
Neutral
Phase B
RST MSP430F67641
VSS
+
CT I1 6' Modulator
- Px.x
STATUS LEDs
+ Px.x
CT I2 6' Modulator
-
XIN
+
CT I3 6' Modulator
-
XOUT
32,768 Hz
Level
Shifted USCIA1 UART/SPI for Wired Comms
Voltage
Divider V2 ADC10
Channels
Level USCIA2 UART/SPI for Wireless Comms
Shifted
Voltage
V3
Divider
USCIB0 SPI/I2C for External Memory
Neutral
Phase A
Phase C
Source
Figure 1. 3-Phase 4-Wire Star Connection Using MSP430F67641
4 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Hardware Implementation
3 Hardware Implementation
This section describes the hardware for the design of a working three-phase energy meter that uses the
F67641.
Figure 2. Simple Capacitive Power Supply for the MSP430 Energy Meter
Appropriate values of resistors (R92, R93, and R94) and capacitors (C39, C46, and C50) are chosen
based on the required output current drive of the power supply. Voltage from mains is directly fed to a RC
based circuit followed by a rectification circuit to provide a dc voltage for the operation of the MSP430.
This dc voltage is regulated to 3.3 V for full-speed operation of the MSP430. The design equations for the
power supply are given in the application report Improved Load Current Capability for Cap-Drop Off-Line
Power Supply for E-Meter (SLVA491). The above configuration allows all three phases to contribute to the
current drive, which is approximately three times the drive available from only one phase. If even higher
output drive is required, the same circuitry can be used followed by an NPN output buffer. Another option
would be to replace the above circuitry with a transformer-based or switching-based power supply.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 5
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Hardware Implementation www.ti.com
6 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Hardware Implementation
Figure 4 shows the analog front end for the voltage inputs for a mains voltage of 230 V. The voltage is
brought down to a range within VREF volts, where VREF is selected to be the 2.0 V reference produced
by the chip's reference module. The maximum voltage that is fed to the ADC is usually a certain margin
below the maximum VREF voltage. As an example, when the 2.0 V reference is selected, the front-end
may be built to produce a maximum voltage of 1.4-1.6 V when the maximum Mains voltage is applied.
This margin helps prevents ADC clipping when the meter is exposed to harmonics or an over-voltage
condition.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 7
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
Resistor R24 is the burden resistor that is selected based on the current range used and the turns ratio
specification of the CT. The value of the burden resistor for this design is 12.4 Ω. The antialiasing circuitry,
consisting of resistors and capacitors, follows the burden resistor. The input signal to the converter is a
fully differential input with a voltage swing of ±877 mV maximum when the maximum current rating of the
meter (100 A) is applied.
4 Software Implementation
The software has three projects: one for mathematical routines, another primarily for metrology (including
calculation of voltage, current, and power), and an application wrapper that deals mainly with application-
processor functionality (such as communication, RTC, and LCD display). The separation of the metrology
and application processor enables easy porting from TI's EVM to a customer's board with minimal
changes to the metrology code. Also, if it is desired to get the readings of the metrology parameters to
make any further additions to the code, the "metrology-readings.h" file could be used to view the different
functions that could be called from the application project to retrieve the newest set of metrology
parameters. Refer to "metrology-types.h" to see the associated units of these returned metrology
parameters.
In the following subsections, the software for the implementation of three-phase metrology is described.
The first subsection describes the setup of various peripherals of the MSP430. Subsequently, the entire
metrology software is described as two major processes: the foreground process and background
process.
8 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 9
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
RESET
HW setup:
Clock, AUX, SD24_B, Port pins, RTC_C,
eUSCI, LCD
YY
oµoZ[u}o}PÇ]vP
LCD management
The initialization routines involve the setup of the analog to digital converter, clock system, auxiliary supply
system, general purpose input/output (port) pins, RTC module for clock functionality, LCD, and the
USCI_A0 for UART functionality. In addition, if ZigBee™ communication is enabled, USCI_A2 is
configured.
After the hardware is setup, any received frames from the GUI are processed. Subsequently, the
foreground process checks whether the background process has notified it to calculate new metering
parameters. This notification is done through the assertion of the "PHASE_STATUS_NEW_LOG" status
flag whenever a frame of data is available for processing. The data frame consists of the processed dot
products that were accumulated for one second in the background process. This is equivalent to
accumulation of 50 or 60 cycles of data synchronized to the incoming voltage signal. In addition, a sample
counter keeps track of how many samples have been accumulated over this frame period. This count can
vary as the software synchronizes with the incoming mains frequency.
10 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
The processed dot products include the VRMS, IRMS, active power, and reactive power. These dot
products are used by the foreground process to calculate the corresponding metrology readings in real-
world units. Processed voltage dot products are accumulated in 48-bit registers. In contrast, processed
current dot products, active energy dot products, and reactive energy dot products are accumulated in
separate 64-bit registers to further process and obtain the RMS and mean values. Using the foreground's
calculated values of active and reactive power, the apparent power is calculated. The frequency (in Hertz)
and power factor are also calculated using parameters calculated by the background process using the
formulas in Section 4.2.1.
The foreground process also takes care of updating the LCD. The LCD display item is changed every two
seconds. For more information, about the different items displayed on the LCD, see Section 6.1.
¦v
n 1
ph (n) * v ph (n)
VRMS, ph K v, ph
v offset , ph
Sample count
Sample
count
¦i
n 1
ph (n) * i ph (n)
I RMS, ph K i, ph
i offset , ph
Sample count
where
• ph = Phase whose parameters are being calculated [that is, Phase A(=1), B(=2), or C(=3)]
• vph(n) = Voltage sample at a sample instant n
• voffset,ph = Offset used to subtract effects of the Additive White Gaussian Noise from the voltage converter
• iph(n) = Each current sample at a sample instant n
• ioffset,ph = Offset used to subtract effects of the Additive White Gaussian Noise from the current converter
• Sample count = Number of samples in one second
• Kv,ph = Scaling factor for voltage
• Ki,ph = Scaling factor for each current (1)
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 11
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
Sample
count
¦ v(n) u i
n 1
ph (n)
PACT, ph K ACT, ph
Sample count
Sample
count
¦v
n 1
90 (n) u i ph (n)
PREACT, ph K REACT, ph
Sample count
where
• v90,ph (n) = Voltage sample at a sample instant n shifted by 90 degrees
• KACT,ph = Scaling factor for active power
• KREACT,ph = Scaling factor for reactive power (2)
For reactive power, the 90° phase shift approach is used for two reasons:
• It allows accurate measurement of the reactive power for very small currents.
• It conforms to the international specified measurement method.
The calculated mains frequency is used to calculate the 90 degrees-shifted voltage sample. Because the
frequency of the mains varies, it is important to first measure the mains frequency accurately to phase
shift the voltage samples accordingly (see Section 4.2.1.3).
To get an exact 90° phase shift, interpolation is used between two samples. For these two samples, a
voltage sample slightly more than 90 degrees before the current sample and a voltage sample slightly less
than 90 degrees before the current sample are used. The application's phase shift implementation
consists of an integer part and a fractional part. The integer part is realized by providing an N samples
delay. The fractional part is realized by a one-tap FIR filter. In the software, a lookup table provides the
filter coefficients that are used to create the fractional delays.
After calculating the active and reactive power, each phase's apparent power is calculated by the following
formula:
2 2
PAPP, ph PACT, ph PREACT, ph (3)
In addition to calculating the per-phase active, reactive and apparent powers, the cumulative sum of these
parameters are calculated by the below equations:
3
PACT, Cumulative ¦P
ph 1
ACT, ph
3
PREACT, Cumulative ¦P
ph 1
REACT, ph
3
PAPP, Cumulative ¦P
ph 1
APP, ph
(4)
The calculated powers for each phase are then converted to energy by the following equations:
E ACT, ph PACT, ph u Samplecount
E REACT, ph PREACT, ph u Samplecount
E APP ph PAPP ph u Samplecount (5)
From there, they are also accumulated to calculate the cumulative energies, as shown by the below
equations:
12 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
3
EACT, Cumulative ¦E
ph 1
ACT, ph
3
EREACT, Cumulativel ¦E
ph -1
REACT, ph
3
E APP, Cumulativel ¦E
ph -1
APP, ph
(6)
The calculated energies are then accumulated into buffers that store the total amount of energy consumed
since meter reset. Note that these energy are different from the working variables used to accumulate
energy for outputting energy pulses. There are four sets of buffers that are available: one for each phase
and one for the cumulative of the phases. Within each set of buffers, the following energies are
accumulated:
1. Active import energy (active energy when active energy ≥ 0)
2. Active export energy (active energy when active energy < 0)
3. Reactive Quad I energy (reactive energy when reactive energy ≥ 0 and active power ≥ 0; inductive
load)
4. Reactive Quad II energy (reactive energy when reactive energy ≥ 0 and active power < 0; capacitive
generator)
5. Reactive Quad III energy (reactive energy when reactive energy < 0 and active power < 0; inductive
generator)
6. Reactive Quad IV energy (reactive energy when reactive energy < 0 and active power ≥ 0; capacitive
load)
7. Apparent import energy (apparent energy when active energy ≥ 0)
8. Apparent export energy (apparent energy when active energy < 0)
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 13
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
4.2.1.5 Temperature
Temperature is calculated using the TLV entries on the F67641. The measured values for 30°C ±3°C and
85°C ±3°C for the 2.0 V reference are used for calculating temperature. The exact formula that is used to
calculate temperature is shown below:
§ 85 30 ·
Temp ( ADC (raw) CAL _ ADC _ 20T 30) u ¨¨ ¸¸ 30
© CAL _ ADC _ 20T 85 CAL _ ADC _ 20T 30 ¹
(9)
The temperature is measured in units of Celsius. More information on this method of calculating
temperature could be found in the User's Guide.
SD24_B Interrupt
YY N
N
Trigger to ADC10 generated?
per_sample_dsp()
per_sample_energy_pulse_processing()
14 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
When a trigger is generated, the next set of ADC10 conversions occur in parallel to the activity in the
background process. This parallel activity is shown in Figure 8, where the green items represent items that
are done automatically by the configuration of the ADC10, DMA, and ΣΔ modules. For these green items,
CPU intervention is not required.
As is represented in the Figure 8, whenever the ADC10 is triggered, the ADC10 enters autoscan mode
and samples all of its 16 ADC channels once. After each channel has a conversion result, the DMA
automatically places these results in memory and the next channel's conversion is automatically started.
For each converter, there is a memory location that stores the conversion results for that particular
converter. The procedure of sampling a converter and storing the results in memory is repeated until the
last converter (ADC10INCH=0) is sampled. Since the clock to the ADC10 is set to 4MHz, the sample and
hold time for each converter is 8 cycles, and the conversion time is 12 cycles, there is a total of
approximately 20 cycles (approximately 5 µs) delay between conversion results of adjacent converters.
To sense the internal temperature sensor using the ADC10, a recommended sample period of at least 30
µs must be used. As a result, the temperature reading measured in the autoscan mode may be invalid
since the sample time used is not sufficient. To mitigate this, a single conversion of the ADC10
temperature channel is triggered. This is triggered in the DMA ISR when all of the autoscan ADC results
have been placed in the proper memory locations. After a temperature reading has been received, the
ADC10 ISR is triggered. In this ISR, the temperature reading is stored and the ADC10 settings are then
reset to support autoscan mode. The ADC10 enters autoscan mode again at the next trigger from the ΣΔ's
trigger generator.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 15
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
N
N
YY
Conversion completed
N
N
All ADC10 channels sampled?
YY
Trigger
Trigger temperature
temperature conversion
conversion
Store
Store temperature
temperature reading
reading and
and re-
re-
initialize
initialize ADC10
ADC10 for
for autoscan
autoscan mode
mode
16 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
4.3.1 per_sample_dsp()
The flowchart for the per_sample_dsp function is shown in Figure 9. In this function, the per_sample_dsp
function is used to calculate intermediate dot product results that are fed into the foreground process for
the calculation of metrology readings. The ADC10 is configured to represent the 10-bit voltage results as a
16-bit signed result. Because 16-bit voltage samples are used, the voltage samples are further processed
and accumulated in dedicated 48-bit registers. In contrast, since 24-bit current samples are used, the
current samples are processed and accumulated in dedicated 64-bit registers. Per-phase active power
and reactive power are also accumulated in 64-bit registers.
After sufficient samples (approximately one second's worth) have been accumulated, then the foreground
function is triggered to calculate the final values of VRMS, IRMS, active, reactive, and apparent powers,
active, reactive, and apparent energy, frequency, temperature, and power factor. In the software, there are
two sets of dot products: at any given time, one is used by the foreground for calculation and the other
used as the working set by the background. After the background process has sufficient samples, it swaps
the two dot products so that the foreground uses the newly acquired dot products that the background
process just calculated and the background process uses a new empty set to calculate the next set of dot
products.
Whenever there is a leading-edge zero-crossing (- to + voltage transition) on a voltage channel, the
per_sample_dsp functhion is also responsible for updating the corresponding phase's frequency (in
samples/cycle) and voltage sag/swell conditions. For the sag conditions, whenever the RMS voltage is
below a certain user-defined threshold percentage, the number of Mains cycles where this condition
persists is logged as the sag duration. The number of periods in time where there was a sag condition is
logged as the sag events count. Note that the sag duration corresponds to the total number of cycles in a
sag condition since reset, and is therefore, not cleared for every sag event. Also, when the RMS voltage is
above a certain threshold percentage, swell events and duration are logged in a similar way.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 17
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
Zu}À]µo(}Z[À}oPZv
µZ[sRMS dot product
Zu}À]µo(}Z[µvZv
µZZ[}}µ(}/ZD^, active
power, and reactive power
N
N
Leading-edge zero-crossing
on voltage channel?
YY
Voltage Sag/Swell Detection
N
N
All three phases done?
YY
N
N
1 second of energy calculated
for any of the phases?
YY
Return
Figure 9. per_sample_dsp()
The following sections describe the various elements of electricity measurement in the per_sample_dsp
function.
18 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
The resulting instantaneous voltage and current samples are used to generate the following intermediate
dot product results:
• Accumulated squared values of voltages and currents, which is used for VRMS and IRMS calculations,
respectively.
• Accumulated energy samples to calculate active energies.
• Accumulated energy samples using current and 90° phase shifted voltage to calculate reactive
energies.
These accumulated values are processed by the foreground process.
good samples
linear interpolation
Because noise spikes can also cause errors, the application uses a rate of change check to filter out the
possible erroneous signals and make sure that the two points are interpolated from are genuine zero
crossing points. For example, with two negative samples, a noise spike can make one of them positive,
and therefore, make the negative and positive pair looks as if there is a zero crossing.
The resultant cycle-to-cycle timing goes through a weak low-pass filter to further smooth out cycle-to-cycle
variations. This results in a stable and accurate frequency measurement that is tolerant of noise.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 19
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
This application uses average power to generate these energy pulses. The average power (calculated by
the foreground process) is accumulated every ΣΔ interrupt, thereby spreading the accumulated energy
from the previous 1 second time frame evenly for each interrupt in the current 1 second time frame. This is
equivalent to converting it to energy. When the accumulated energy crosses a threshold, a pulse is
generated. The amount of energy above this threshold is kept and new energy value is added on top of it
in the next interrupt cycle. Because the average power tends to be a stable value, this way of generating
energy pulses are very steady and free of jitter.
The threshold determines the energy "tick" specified by meter manufacturers and is a constant. It is
usually defined in pulses per kWh or just in kWh. One pulse is generated for every energy "tick". For
example, in this application, the number of pulses generated per kWh is set to 1600 for active and reactive
energies. The energy "tick" in this case is 1 kWh/1600. Energy pulses are generated and available on a
header and also via LEDs on the board. General-purpose I/O (port) pins are used to produce the pulses.
In the EVM, the LEDs that are labeled "Phase 1", "Phase 2", "Phase 3", and "Active" correspond to the
active energy consumption for phase A, phase B, phase C, and the cumulative three-phase sum,
respectively. "Reactive" corresponds to the cumulative three-phase reactive energy sum. The number of
pulses per kWh and each pulse duration can be configured in software. Figure 11 shows the flow diagram
for pulse generation. This flow diagram is valid for pulse generation of individual or accumulative phase
active, reactive, and apparent energy.
SD interrupts at
4096 Hz
Energy
Accumulator+=
Average Power
Energy Accumulator =
Energy Accumulator ±
1 tick
Generate 1
pulse
Proceed to other
tasks
The average power is in units of 0.001 W and the 1 kWh threshold is defined as:
1 kWh threshold = (1 / 0.001) × 1 kW × (number of interrupts per second) × (number of seconds in one
hour) = 1000000× 4096 × 3600 = 0xD693A400000
20 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
4.4.1 metrology-calibration-template.h
The metrology-calibration-template file contains the default calibration values that are first programmed
into a meter before calibration. This file is located within the "emeter-metrology\emeter-metrology-67641"
directory.
In the project settings, the calibration factors are set so that they are automatically deleted and set to the
default calibration values whenever the meter firmware is reflashed. If it is desired to reflash the meter and
maintain the same calibration values, the project settings could be changed so that only main memory is
erased and information memory is retained. Alternatively, the default calibration values could be replaced
with the meter's current calibration values. The relevant calibration factor macros are described below:
1. CALADC10_20V_30C: This macro references the TLV structure to obtain the necessary information to
calculate temperature. This particularly refers to the temperature calibration data when the ADC10
uses a reference voltage of 2.0 V and the temperature is 30°C±3°C. For higher precision
measurements, an external temperature sensor could be used instead.
2. CALADC10_20V_85C: This macro references the TLV structure to obtain the necessary information to
calculate temperature. This particularly refers to the temperature calibration data when the ADC10
uses a reference voltage of 2.0 V and the temperature is 85°C±3°C. For higher precision
measurements, an external temperature sensor could be used instead.
3. DEFAULT_V_RMS_SCALE_FACTOR_A: This macro holds the scaling factor for voltage at phase A.
Set this factor to an approximately correct value, and it will be fine tuned during calibration.
4. DEFAULT_V_DC_ESTIMATE_A : This macro holds an estimate for the dc level of the voltage channel
of phase A. Using this estimate helps reduce the initial settling time of the dc voltage filter for phase A.
5. DEFAULT_V_AC_OFFSET_A: This macro removes the effect of the Additive White Gaussian Noise
from the voltage ADC of phase A. Additive White Gaussian Noise is orthogonal to everything except
itself. This results in the noise squaring when performing calculations for RMS voltage. When
performing calculations for RMS voltage, this macro is subtracted out from the mean-squared voltage
before its square root is taken to produce RMS voltage. Set this factor to an approximately correct
value, and it will be fine tuned during calibration.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 21
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
6. DEFAULT_V_RMS_SCALE_FACTOR_B: This macro holds the scaling factor for voltage at phase B.
Set this factor to an approximately correct value, and it will be fine tuned during calibration.
7. DEFAULT_V_DC_ESTIMATE_B: This macro holds an estimate for the dc level of the voltage channel
of phase B. Using this estimate helps reduce the initial settling time of the dc voltage filter for phase B.
8. DEFAULT_V_AC_OFFSET_B: This macro removes the effect of the Additive White Gaussian Noise
from the voltage ADC of phase B. Additive White Gaussian Noise is orthogonal to everything except
itself. This results in the noise squaring when performing calculations for RMS voltage. When
performing calculations for RMS voltage, this macro is subtracted out from the mean-squared voltage
before its square root is taken to produce RMS voltage. Set this factor to an approximately correct
value, and it will be fine tuned during calibration.
9. DEFAULT_V_RMS_SCALE_FACTOR_C: This macro holds the scaling factor for voltage at phase C.
Set this factor to an approximately correct value, and it will be fine tuned during calibration.
10. DEFAULT_V_DC_ESTIMATE_C: This macro holds an estimate for the dc level of the voltage channel
of phase C. Using this estimate helps reduce the initial settling time of the dc voltage filter for phase C.
11. DEFAULT_V_AC_OFFSET_C: This macro removes the effect of the Additive White Gaussian Noise
from the voltage ADC of phase C. Additive White Gaussian Noise is orthogonal to everything except
itself. This results in the noise squaring when performing calculations for RMS voltage. When
performing calculations for RMS voltage, this macro is subtracted out from the mean-squared voltage
before its square root is taken to produce RMS voltage. Set this factor to an approximately correct
value, and it will be fine tuned during calibration.
12. DEFAULT_I_RMS_SCALE_FACTOR_A: This macro holds the scaling factor for current at phase A.
Set this factor to an approximately correct value, and it will be fine tuned during calibration.
13. DEFAULT_I_DC_ESTIMATE_A : This macro holds an estimate for the dc level of the current channel
of phase A. Using this estimate helps reduce the initial settling time of the dc current filter for phase A.
14. DEFAULT_I_AC_OFFSET_A: This macro removes the effect of the Additive White Gaussian Noise
from the current ADC of phase A. Additive White Gaussian Noise is orthogonal to everything except
itself. This results in the noise squaring when performing calculations for RMS current. When
performing calculations for RMS current, this macro is subtracted out from the mean-squared current
before its square root is taken to produce RMS current. Set this factor to an approximately correct
value, and it will be fine tuned during calibration.
15. DEFAULT_I_RMS_SCALE_FACTOR_B: This macro holds the scaling factor for current at phase B.
Set this factor to an approximately correct value, and it will be fine tuned during calibration.
16. DEFAULT_I_DC_ESTIMATE_B: This macro holds an estimate for the dc level of the current channel
of phase B. Using this estimate helps reduce the initial settling time of the dc current filter for phase B.
17. DEFAULT_I_AC_OFFSET_B: This macro removes the effect of the Additive White Gaussian Noise
from the current ADC of phase B. Additive White Gaussian Noise is orthogonal to everything except
itself. This results in the noise squaring when performing calculations for RMS current. When
performing calculations for RMS current, this macro is subtracted out from the mean-squared current
before its square root is taken to produce RMS current. Set this factor to an approximately correct
value, and it will be fine tuned during calibration.
18. DEFAULT_I_RMS_SCALE_FACTOR_C: This macro holds the scaling factor for current at phase C.
Set this factor to an approximately correct value, and it will be fine tuned during calibration.
19. DEFAULT_I_DC_ESTIMATE_C: This macro holds an estimate for the dc level of the current channel
of phase C. Using this estimate helps reduce the initial settling time of the dc current filter for phase C.
20. DEFAULT_I_AC_OFFSET_C: This macro removes the effect of the Additive White Gaussian Noise
from the current ADC of phase C. Additive White Gaussian Noise is orthogonal to everything except
itself. This results in the noise squaring when performing calculations for RMS current. When
performing calculations for RMS current, this macro is subtracted out from the mean-squared current
before its square root is taken to produce RMS current. Set this factor to an approximately correct
value, and it will be fine tuned during calibration.
21. DEFAULT_P_SCALE_FACTOR_A: This macro holds the scaling factor for active power at phase A.
Set this factor to an approximately correct value, and it will be fine tuned during calibration.
22. DEFAULT_P_SCALE_FACTOR_B This macro holds the scaling factor for active power at phase B.
Set this factor to an approximately correct value, and it will be fine tuned during calibration.
22 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
23. DEFAULT_P_SCALE_FACTOR_C: This macro holds the scaling factor for active power at phase C.
Set this factor to an approximately correct value, and it will be fine tuned during calibration
24. DEFAULT_BASE_PHASE_A_CORRECTION: This macro holds the value for phase correction to
compensate for delay due to the current transformer/front-end circuitry at phase A. This can be set to a
value that is in fairly acceptable range, and it will be fine tuned under phase correction during
calibration.
25. DEFAULT_BASE_PHASE_B_CORRECTION: This macro holds the value for phase correction to
compensate for delay due to the current transformer/front-end circuitry at phase B. This can be set to a
value that is in fairly acceptable range, and it will be fine tuned under phase correction during
calibration.
26. DEFAULT_BASE_PHASE_C_CORRECTION: This macro holds the value for phase correction to
compensate for delay due to the current transformer/front-end circuitry at phase C. This can be set to a
value that is in fairly acceptable range, and it will be fine tuned under phase correction during
calibration.
4.4.2 metrology-template.h
The metrology-template file contains the different user-configurable metrology-related options. This file is
located within the "emeter-metrology\emeter-metrology-67641" directory. The relevant user-configurable
options are below:
1. NUM_PHASES: This selects the maximum number of phases that the EVM supports. This value
should be left at the default value of 3. It should not be changed.
2. TWENTYFOUR_BIT: This selects the resolution of the current channels. If it is defined, 24-bit samples
are used for current. If it is not defined, 16-bits are used for voltage. Since there is no benefit in using a
smaller resolution, this macro should be left defined and not be disabled.
3. PHASE_1_CURRENT_ADC_CHANNEL: This defines the Sigma Delta converter number that
corresponds to Phase 1 (phase A).
4. PHASE_1_VOLTAGE_ADC_CHANNEL: This defines the ADC10 channel that is associated with
phase 1 (phase A).
5. PHASE_2_CURRENT_ADC_CHANNEL: This defines the Sigma Delta converter number that
corresponds to Phase 2(phase B).
6. PHASE_2_VOLTAGE_ADC_CHANNEL: This defines the ADC10 channel that is associated with
phase 2 (phase B).
7. PHASE_3_CURRENT_ADC_CHANNEL : This defines the Sigma Delta converter number that
corresponds to Phase 3 (phase C).
8. PHASE_3_VOLTAGE_ADC_CHANNEL: This defines the ADC10 channel that is associated with
phase 3 (phase C).
9. SD_LIVE_CURRENT_GAIN: This macro defines the gain of the ΣΔ24_B's internal programmable gain
amplifier (PGA) for all the three currents. In this application it is set to 1.
10. SD_CLOCK_DIVISION: This defines the ratio of the ADC clock source's frequency and the ADC clock
frequency. Since a 25 MHz clock is used to produce a modulation clock of approximately 1 MHz, the
division factor is 24. This macro could only have a value of 8, 16, 20, or 24 and it should not be
changed if the software's default clock frequency is used.
11. MAINS_NOMINAL_FREQUENCY: The nominal mains frequency, in Hz that is used to prime the
mains frequency filter to make it settle more quickly.
12. MAINS_NOMINAL_VOLTAGE: This selects the nominal voltage used for sag/swell detection.
13. VCC_MEASURE_SUPPORT: Defining this macro supports the storing of the VDSYS/2 reading into
the "vcc" variable.
14. MAINS_BASIS_CURRENT: This selects the basis current.
15. MAINS_MAXIMUM_CURRENT: This selects the maximum operating current.
16. IEC_THD_SUPPORT: This selects support for IEC style THD readings. If this is not defined, IEEE
style readings will be produced for any THD readings.
17. MAINS_FREQUENCY_SUPPORT: The macro configures the meter to measure the frequency of the
AC mains.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 23
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Software Implementation www.ti.com
18. VRMS_SUPPORT: This macro is used to configure the meter to calculate VRMS from the voltage
samples.
19. SAG_SWELL_SUPPORT: This selects support for sag and swell detection.
20. SAG_SWELL_WINDOW_LEN: This selects the number of mains cycles over which sag and swell
detection works.
21. SAG_THRESHOLD: This selects the percentage fall from the nominal voltage for sag detection.
22. SWELL_THRESHOLD: This selects the percentage rise above the nominal voltage for swell detection.
23. FUNDAMENTAL_VRMS_SUPPORT: This selects support for fundamental RMS voltage
measurement.
24. VOLTAGE_THD_SUPPORT: This selects support for measuring the THD in the voltage waveform.
25. IRMS_SUPPORT: This macro is used to configure the meter to calculate IRMS from the current
samples.
26. FUNDAMENTAL_IRMS_SUPPORT: This selects support for fundamental RMS current measurement.
27. CURRENT_THD_SUPPORT: This selects support for measuring the THD in the current waveform.
28. FUNDAMENTAL_ACTIVE_POWER_SUPPORT: This selects support for fundamental active power
measurement.
29. REACTIVE_POWER_SUPPORT: This selects support for reactive power measurement.
30. REACTIVE_POWER_BY_QUADRATURE_SUPPORT: This selects support for reactive power
measurement through quadrature processing. This is only effective when
REACTIVE_POWER_SUPPORT is enabled.
31. FUNDAMENTAL_REACTIVE_POWER_SUPPORT: This selects support for fundamental reactive
power measurement.
32. APPARENT_POWER_SUPPORT: The selects support for apparent or VA power measurement.
33. POWER_FACTOR_SUPPORT: This macro is used to configure the meter to calculate the power
factor for both lead and lag. A frequency independent method, based on the ratio of scalar dot
products, is used.
34. RESIDUAL_POWER_CUTOFF: Tiny power levels should not record energy at all, as they may just be
rounding errors, noise, or the consumption of the meter itself. This value is the cutoff level in milliwatts
(this is the cutoff per phase).
35. TOTAL_RESIDUAL_POWER_CUTOFF: Tiny power levels should not record at all, as they may just
be rounding errors, noise, or the consumption of the meter itself. This value is the cutoff level, in 0.01W
increments (this is the cutoff for the aggregate power).
36. ACTIVE_ENERGY_SUPPORT: This switch selects support for measuring the active energy
consumption on a phase by phase basis. This will allow the GUI to display each phase's active energy
consumption in kWh.
37. ACTIVE_ENERGY_PULSES_PER_KW_HOUR: This macro defined the total number of pulses per
1 kWh of active energy at each phase. In this application it is defined to 1600 if pulses generation for
each individual phase has been enabled. If the value of this macro is increased, it may be necessary to
decrease the pulse duration.
38. REACTIVE_ENERGY_SUPPORT: This switch selects support for measuring the reactive energy
consumption on a phase by phase basis. This will allow the GUI to display each phase's reactive
energy consumption in kvarh.
39. APPARENT_ENERGY_SUPPORT: This switch selects support for measuring the apparent energy
consumption on a phase by phase basis. This will allow the GUI to display each phase's apparent
energy consumption in kVA.
40. TOTAL_ACTIVE_ENERGY_SUPPORT: This switch selects support for measuring the total active
energy consumption. This will allow the GUI to display the cumulative phase's active energy
consumption in kWh.
41. TOTAL_REACTIVE_ENERGY_SUPPORT: This switch selects support for measuring the total reactive
energy consumption. This will allow the GUI to display the cumulative phase's reactive energy
consumption in kvarh.
24 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Software Implementation
42. TOTAL_APPARENT_ENERGY_SUPPORT: This switch selects support for measuring the total
apparent energy consumption. This will allow the GUI to display the cumulative phase's apparent
energy consumption in kVA.
43. TOTAL_ACTIVE_ENERGY_PULSES_PER_KW_HOUR: This sets the number of pulses per kilo-watt
hour the meter will produce at its total active energy pulse. It does not affect the energy accumulation
process. The default setting for this macro is 1600.
44. TOTAL_REACTIVE_ENERGY_PULSES_PER_KVAR_HOUR: This sets the number of pulses per kilo-
var hour the meter will produce at its total reactive energy pulse. It does not affect the energy
accumulation process. The default setting for this macro is 1600.
45. ENERGY_PULSE_DURATION: The duration of the LED on time for an energy pulse. This is
measured in ADC samples (that is, increments 1/4096s). The maximum allowed is 255, giving a pulse
of about 62ms. The default value for this macro is 80. For higher pulses/kwh constants, the value for
this macro may need to be reduced.
46. TEMPERATURE_SUPPORT: This switch enables use of the MSP430's internal temperature diode to
measure the meter's temperature.
47. PRECALCULATED_PARAMETER_SUPPORT: Normally the meter software only calculates the
properly scaled values for voltage, current, etc. as these values are needed. This define enables
additional global parameters, which are regularly updated with all the metrics gathered by the meter.
This is generally less efficient, as it means calculating things more often than necessary. However,
some may find this easier to use, so it is offered as a choice for the meter designer.
48. custom_adc_interrupt():This is called every ADC interrupt, after the main DSP work has finished. It
can be used for things like custom keypad operations. It is important this is a very short routine, as it is
called from the main ADC interrupt.
4.4.3 emeter-template.h
The emeter-template file contains the different user-configurable application-related options. This file is
located within the "emeter-app\emeter-app-67641" directory. The relevant user-configurable options are
below
1. SERIAL_CALIBRATION_SUPPORT: This switch, in combination with the calibrator switch, enables
calibration with the meter cooperating with an external reference, through a UART port.
2. SERIAL_CALIBRATION_REF_SUPPORT: This switch enables the sending of the current readings,
through a UART port, for use in cooperative calibration with other meters.
3. RTC_SUPPORT: This selects real time clock support.
4. IHD430_SUPPORT: This macro allows ZigBee communication to an IHD430 in-home display. A
CC2530 transmitter must be placed in the EVM's RF connector to enable this. For more information,
see Section 6.2.
5. DLT645_SUPPORT: This macro enables DLT645 communciation.
6. custom_active_energy_pulse_start: This macro defines the command used to turn on the active energy
LED for a pulse.
7. custom_active_energy_pulse_end: This macro defines the command used to turn off the active energy
LED for a pulse.
8. custom_reactive_energy_pulse_start: This macro defines the command used to turn on the reactive
energy LED for a pulse.
9. custom_reactive_energy_pulse_end: This macro defines the command used to turn off the reactive
energy LED for a pulse.
10. OUTPUT_RTCCLK: If this macro is defined, the active pulse capability is disabled and the RTCCLK,
which is used for calibration, is output on the header normally used for active power pulses.
In addition to the above macros, there are also various macros for defining the display properties of the
EVM's LCD and the values of the LCD display registers. Also there are macros that are used to initialize
the values of the DIR, SEL, OUT, and REN registers of each port. In the software, these values are set to
values to correspond to the hardware of this EVM.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 25
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Energy Meter Demo www.ti.com
Figure 12. Top View of the Three Phase Energy Meter EVM
26 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Energy Meter Demo
Danger High Voltage Electric shock possible when connecting board to live wires. Board should be
handed with care by a professional.
For safety, use of isolated test equipment with overvoltage and overcurrent
protection is highly recommended.
CAUTION
Do note leave EVM powered when unattended.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 27
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Energy Meter Demo www.ti.com
AC voltage or currents can be applied to the board for testing purposes at these points:
• Pad LINE_1 corresponds to the line connection for phase A.
• Pad LINE_2 corresponds to the line connection for phase B.
• Pad LINE_3 corresponds to the line connection for phase C.
• Pad NEUTRAL corresponds to the Neutral voltage.
The voltage between any of the three line connections to the neutral connection can be up to 230 V AC at
50/60 Hz.
• I1+ and I1- are the current inputs after the sensors for phase A. When a current sensor is used, make
sure that the voltage across I1+ and I1- does not exceed 920 mV. THIS IS CURRENTLY
CONNECTED TO A CT ON THE EVM.
• I2+ and I2- are the current inputs after the sensors for phase B. When a current sensor is used, make
sure that the voltage across I2+ and I2- does not exceed 920 mV. THIS IS CURRENTLY
CONNECTED TO A CT ON THE EVM.
• I3+ and I3- are the current inputs after the sensors for phase C. When a current sensor is used, make
sure that the voltage across I3+ and I3- does not exceed 920 mV. THIS IS CURRENTLY
CONNECTED TO A CT ON THE EVM.
Figure 14 and Figure 15 show the various connections that need to be made to the test setup for proper
functionality of the EVM.
When a test AC source needs to be connected, the connections must be made according to the EVM
design. Figure 14 shows the connections from the top view. VA+ , VB+, and VC+ corresponds to the line
voltage for phases A, B, and C, respectively. VN corresponds to the neutral voltage from the test AC
source.
Figure 14. Top View of the EVM With Test Setup Connections
28 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Energy Meter Demo
Figure 15 shows the connections from the front view. IA+ and IA- correspond to the current inputs for
phase A, IB+ and IB- correspond to the current inputs for phase B, and IC+ and IC- correspond to the
current inputs for phase C. VN corresponds to the neutral voltage from the test setup.
Figure 15. Front View of the EVM With Test Setup Connections
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter Using 29
Submit Documentation Feedback the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Energy Meter Demo www.ti.com
30 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter Using SLAA621C – March 2014 – Revised August 2015
the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Energy Meter Demo
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 31
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Energy Meter Demo www.ti.com
Within the emeter-app-67641 folder in the emeter-app folder, the emeter-app-67641.ewp project
corresponds to the application code. Similarly, within the emeter-metrology-67641 folder in the emeter-
metrology folder, the emeter-metrology-67641.ewp project corresponds to the portion of the code for
metrology. Additionally, the folder emeter-toolkit-67641 within emeter-toolkit has the corresponding toolkit
project file emeter-toolkit-67641.ewp. For first time use, it is recommended that all three projects be
completely rebuild by performing the following steps:
1. Open the IAR IDE.
2. Open the F67641 workspace, which is located in the "Source" folder.
3. Within IAR's workspace window, click the "Overview" tab to have a list view of all the projects.
4. Right-click the "emeter-toolkit-67641" option in the workspace window and select Rebuild All, as shown
in Figure 17.
5. Right-click the "emeter-metrology-67641" option in the workspace window and select Rebuild All, as
shown in Figure 18.
6. Within IAR's workspace window, click the "emeter-app-67641" tab.
7. Within the workspace window, select "emeter-app-67641", click Rebuild All as shown in Figure 19, and
then download this project onto the MSP430F67641.
NOTE: If any changes are made to any of the files in the toolkit project and the project is compiled,
the metrology project must be recompiled. After recompiling the metrology project, the
application project must then be recompiled. Similarly, if any changes are made to any of the
files in the metrology project and the project is compiled, the application project must then be
recompiled.
32 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
Figure 17. Toolkit Project Figure 18. Metrology Project Figure 19. Application Project
Compilation Compilation Compilation
Aggregate results (such as cumulative active and reactive power) and parameters that are independent of
phase (such as time and date) are denoted by clearing all of the phase symbols on the LCD.
The bottom line of the LCD is used to denote the value of the parameter being displayed. The text to
denote the parameter being shown is displayed on the top line of the LCD. Table 2 shows the different
metering parameters that are displayed on the LCD and the associated units in which they are displayed.
The "Designation" column shows which characters correspond to which metering parameter.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 33
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
Reactive Volt-Ampere Reactive This parameter is displayed for each phase. The aggregate
Power (var) reactive power is also displayed.
Apparent
Volt-Ampere (VA) This parameter is displayed for each phase.
Power
Constant between 0
Power Factor This parameter is displayed for each phase.
and 1
Total
Consumed kWh This parameter is displayed for each phase.
Active Energy
Total
Consumed This parameter is displayed for each phase. This displays the
kVarh
Reactive sum of the reactive energy in quadrant 1 and quadrant 4.
Energy
34 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
Figure 21 shows an example of phase A's measured frequency of 49.99 Hz displayed on the LCD.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 35
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
This ZigBee module is connected by the UART, which is configured to 115.2 kbaud to the MSP430F67641
on the transmit portion and the MSP430F4618 on the receive portion (IHD430).
36 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 37
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
4. Run calibrator.exe in the /Source/GUI folder. If the COM port in calibration-config.xml was changed in
the previous step to the com port connected to the EVM, the GUI opens (see Figure 25).
If the GUI connects properly to the EVM, the top left button is green. If there are problems with
connections or if the code is not configured correctly, the button is red. Click the green button to view
the results.
38 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
From the results window, the total-energy consumption readings and sag/swell logs can be viewed by
pressing the "Meter Consumption" button. When this button is pressed, the meter events and consumption
window opens (see Figure 27).
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 39
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
6.3.3 Calibration
Calibration is key to any meter's performance, and it is absolutely necessary for every meter to go through
this process. Initially, every meter exhibits different accuracies due to silicon-to-silicon differences, sensor
accuracies, and other passive tolerances. To nullify the effects of these differences, every meter must be
calibrated. For calibration to be performed accurately, an accurate AC test source and a reference meter
must be available. The source should be able to generate any desired voltage, current, and phase shift
(between V and I). To calculate errors in measurement, the reference meter acts as an interface between
the source and the meter that is being calibrated. This section describes a simple and effective method of
calibration of this three-phase EVM.
The GUI that is used for viewing results can also be used to calibrate the EVM. During calibration,
parameters called calibration factors are modified in software to give least error in measurement. For this
meter, there are six main calibration factors for each phase: voltage scaling factor, voltage AC offset,
current scaling factor, current AC offset, power scaling factor, and the phase compensation factor. The
voltage, current, and power scaling factors translate measured quantities in metrology software to real-
world values represented in volts, amps, and watts, respectively. The voltage AC offset and current AC
offset are used to eliminate the effect of Additive White Gaussian Noise associated with each channel.
This noise is orthogonal to everything except itself. As a result, it is present only when calculating RMS
voltages and currents. The last calibration factor is the phase compensation factor, which is used to
compensate any phase shifts introduced by the current sensors and other passives. Note that the voltage,
current, and power calibration factors are independent of each other. Therefore, calibrating voltage does
not affect the readings for RMS current or power.
When the meter software is flashed with the code (available in the zip file), default calibration factors are
loaded into these calibration factors (see Section 4.4.1 for the macros associated with each calibration
factor). These values will be modified via the GUI during calibration. The calibration factors are stored in
INFO_MEM, and therefore, would remain the same if the meter is restarted. However, if code is re-flashed
during debug, the calibration factors will be replaced and the meter must be recalibrated. One way to save
the calibration values is by clicking on the "Meter calibration factors" button shown in Figure 28. The meter
40 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
calibration factors window displays the latest values and this could be used to directly replace the macro
definition of these factors in the source code. The "Voltage" , "Voltage AC off" , "Current", "Current AC
offset", and "Active Power" calibration factors shown in the calibration factors window could be copied
directly into the corresponding macros in the source code. However, for phase correction, a conversion
must be made from microseconds to register units since the software's phase correction parameters are in
units of modulation clock cycles instead of microseconds. To convert the value displayed by the GUI into a
value that can be used by the associated macro in emeter-template, multiply the "Phase correction"
variable on the GUI by 8.338608, round the resulting number to the nearest integer, and then right-shift
by 3.
Calibrating any of the scaling factors is referred to as gain correction. Calibrating any of the phase
compensation factors is referred to as phase correction. Calibrating the offset is referred to as offset
calibration. For the entire calibration process, the AC test source must be on, meter connections must be
made as shown in Section 5.1.1, and the energy pulses must be connected to the reference meter.
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 41
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
4. Calculate the correction values for each voltage and current. The correction values that need to be
entered for the voltage and current fields are calculated by:
§ value observed ·
Correction (%) ¨¨ 1 ¸¸ u 100
© value desired ¹
where
• valueobserved is the value measured by the TI meter
• valuedesired is the calibration point configured in the AC test source (11)
5. After calculating Correction(%) for all voltages and currents, input these values as is (±) for the fields
"Voltage" and "Current" for the corresponding phases.
6. Click Update meter and the observed values for the voltages and currents on the GUI settle to the
desired voltages and currents.
6. Enter the error obtained in the above step into the "Active" field under the corresponding phase in the
GUI window. This error is already the Correction(%) value and does not need to be calculated.
7. Click Update meter and the error values on the reference meter settle to a value close to zero.
Merror u106
correction
f Mains u 360 (12)
5. Enter the calculated correction into the "Phase" field for the phase that is being calibrated.
6. Click Update meter.
7. If this error is not close to zero, or is unacceptable, fine-tune the phase correction by following these
steps:
(a) Enter a small value as an update for the "Phase" field for the phase that is being calibrated.
Usually, a small positive or negative integer should be entered to bring the error close to zero.
Additionally, for a phase shift greater than 0 (for example, +60°), a positive (negative) error would
require a positive (negative) number as correction.
(b) Click Update meter and monitor the error values on the reference meter.
(c) If this measurement error (%) is not accurate enough, fine tune by incrementing or decrementing by
a value of 1 based on Step 4a and 4b. Note: When the error is very close to zero, changing the
fine-tuning value by 1 can result in the error oscillating on either side of zero. Select the value that
has the smallest absolute error.
(d) Change the phase to -60° and check if this error is still acceptable. Ideally, errors should be
symmetric for same phase shift on lag and lead conditions.
After performing phase correction, calibration is complete for one phase. Note that the gain calibration
and phase calibration are completed in sequence for each phase before moving on to other
phases. These two procedures must be repeated for each phase, unlike voltage and current
calibration.
This completes calibration of voltage, current, and power for all three phases. View the new calibration
factors by clicking the Meter Calibration factors button of the GUI metering results window (see Figure 30).
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 43
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
The configuration of the meter can also be viewed by clicking Meter features to open the screen shown in
Figure 31 (this is only an example).
44 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
0.8
0.6
0.4
0.2
0
Error (%)
-0.2
-0.4
-0.6
-0.8
-1
0 10 20 30 40 50 60 70 80 90 100
Current (A)
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 45
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
46 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
Figure 34, Figure 35, and Figure 36 show the active error over a current dynamic range of 2000:1 for
phases A, B, and C, respectively. Table 5, Table 6, and Table 7 show the corresponding error for phases
A, B, and C, respectively.
1
0.8
0.6
0.4
0.2
0
Error (%)
-0.2
-0.4
-0.6
-0.8
-1
0 10 20 30 40 50 60 70 80 90 100
Current (A)
0 degrees 60 Degrees -60 degrees
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 47
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
0.8
0.6
0.4
0.2
0
Error (%)
-0.2
-0.4
-0.6
-0.8
-1
0 10 20 30 40 50 60 70 80 90 100
Current (A)
0 degrees 60 Degrees -60 degrees
48 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
0.8
0.6
0.4
0.2
0
Error (%)
-0.2
-0.4
-0.6
-0.8
-1
0 10 20 30 40 50 60 70 80 90 100
Current (A)
0 degrees 60 Degrees -60 degrees
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 49
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
Figure 37 shows the cumulative active energy results when varying the 230-V nominal voltage by ±10% at
different currents and power factors. Table 8 shows the corresponding error.
Figure 37. Cumulative Active Energy Measurement Error, ±10% Nominal Voltage
50 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Results and Calibration
Figure 38 shows the active energy results from 100 V to 270 V, and Table 9 shows the corresponding
errors. Note that no changes were made to the EVM to produce these results. Figure 39 shows the active
energy results from 100 V to 320 V, and Table 10 shows its corresponding error.
In comparison to the results in Figure 38 and Table 9, the results for Figure 39 and Table 10 were
generated with one change made to the hardware. Because 275-V varistors are used in the EVM's voltage
front end, these varistors were removed to allow testing beyond 275 V. Other than removing these
varistors, no other changes were made to the EVM for generating the results in Figure 39 and Table 10.
Figure 38. Cumulative Active Energy Measurement Error, 100 V to 270 V, No EVM Modifications
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter 51
Submit Documentation Feedback Using the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Results and Calibration www.ti.com
Figure 39. Cumulative Active Energy Measurement Error, 100 V to 320 V, Varistors Removed
52 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter SLAA621C – March 2014 – Revised August 2015
Using the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Schematics
7 Schematics
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
AUXVCC1
AUXVCC2
VDSYS
DVCC
AVCC
VCORE
VASYS
VREF
R58
LED_PHASE_1R22
LED_PHASE_2R57
LED_PHASE_3R21
LED_REACT R20
100
100
100
100
100
100K
100K
R49
R50
B B
R36
DVCC
10R
LED_ACT
C29 C31 C32 C28 C30 C4 C5 C6 C7 C14 C15 C16 C17 C33 BTN1 BTN2
4.7uF 100nF 4.7uF 100nF 100nF 4.7uF 100nF 4.7uF 100nF 4.7uF 100nF 4.7uF 100nF 470nF
BTN1
BTN2
2
LED_PHASE_1
LED_PHASE_2
LED_PHASE_3
REACT
ACT
1
1
C GND C
GND GND
GND GND
D D
GND
3 VDSYS
2 AUXVCC3 DVCC
VDSYS
REACT
1 4 3 AUXVCC2 LCD1
GND
ACT
S19
S20
S21
S22
S23
S24
S25
S26
S27
S28
S29
S30
S31
S32
S33
S34
S35
S36
S37
S38
S39
JP15 2 1 AUXVCC1
D37 1 1 S39 44 1 S0
HD1 JP16 2 2 S38 S1
C63
+
43 2
1F
2 3 3 S37 42 3 S2
DVSS 75
DVSYS 74
P6.0/S19 73
P5.7/S20 72
P5.6/S21 71
P5.5/S22 70
P5.4/S23 69
P5.3/S24 68
P5.2/S25 67
P5.1/S26 66
P5.0/S27 65
P4.7/S28 64
P4.6/S29 63
P4.5/S30 62
P4.4/S31 61
P4.3/S32 60
P4.2/S33 59
P4.1/S34 58
P4.0/S35 57
P3.7/PM_SD2DIO/S3656
P3.6/PM_SD1DIO/S3755
P3.5/PM_SD0DIO/S3854
P3.4/PM_SDCLK/S3953
P3.3/PM_TA0.2 52
P3.2/PM_TACLK/PM_RTCCLK51
1 4 4 S36 41 4 S3
E S35 40 5 S4 E
DVCC DGND S34 39 6 S5
GND GND GND GND S33 38 7 S6
S32 37 8 S7
S31 36 9 S8
S30 35 10 S9
S29 34 11 S10
S28 33 12 S11
S27 32 13 S12
I2C Pullups Watch Crystal S26 31 14 S13
F S25 30 15 S14 F
S24 29 16 S15
76 DVCC
S18 P6.1/S18 P3.1/PM_TA2.1/S30/BSL_RX50 RF_GPIO2 COM0 COM0 17 S16
S17 77 P6.2/S17 P3.0/PM_TA2.0/S31/BSL_TX49 RF_GPIO1 12pF COM1 COM1 18 S17
S16 78 P6.3/S16 P2.7/PM_TA1.1/S32 48 RF_RESETCC XIN COM2 COM2 19 S18
S15 79 P6.4/S15 P2.6/PM_TA1.0/S33 47 IR_SD COM3 COM3 20 S19
S14 80 P2.5/PM_UCA2CLK/S3446 RF_CLK C37 S23 S20
XT1
P6.5/S14 24 21
S13 81 P2.4/PM_UCA1CLK/S3545 RF_CS 12pF S22 S21
R40
R41
10K
10K
P6.6/S13 23 22
S12 82 P6.7/S12 P2.3/PM_UCA2TXD/PM_UCA2SIMO/S36 44 RF_SIMO XOUT
S11 83 P7.0/S11 P2.2/PM_UCA2RXD/PM_UCA2SOMI/S37 43 RF_SOMI
G S10 84 P7.1/S10 P9.0/TACLK/RTCCLK42 RF_SFD SCL 1 JP2 C40 G
S9 85 U4 41 RF_CCA SDA 2 GND DNP
P7.2/S9 P8.7/TA2.1
S8 86 P7.3/S8 P8.6/TA2.0 40 LED_PHASE_1
S7 87 P7.4/S7 P2.1/PM_UCB0SIMO/PM_UCB0SDA/COM7/S38 39 SDA
S6 88 P7.5/S6 P2.0/PM_UCB0SOMI/PM_UCB0SCL/COM6/S39 38 SCL
S5 89 P7.6/S5 P1.7/PM_UCB0CLK/COM537 BTN1/RF_VREG_EN
S4 90 P7.7/S4 P1.6/PM_UCA0CLK/COM436 BTN2
S3 91 P8.0/S3 COM3 35 COM3
S2
S1
92
93
P8.1/S2
P8.2/S1
MSP430F67641_PZ_100 COM2 34
COM1 33
COM2
COM1 Voltage Monitor Temp Monitor JTAG H
H S0 94 P8.3/S0 COM0 32 COM0
TEST/SBWTCK 95 P8.5/TA1.1 31 LED_PHASE_3
P1.3/PM_UCA0TXD/PM_UCA0SIMO/R03
1 JP10
TEST/SBWTCK
P1.2/PM_UCA0RXD/PM_UCA0SOMI/A0
2
3
DTMS 98 PJ.2/ADC10CLK/TMS P1.5/PM_UCA1TXD/PM_UCA1SIMO/R23 28 IR_TXD
DTCK 99 27 IR_RXD C49 Vsupply DVCC
PJ.3/ACLK/TCK P1.4/PM_UCA1RXD/PM_UCA1SOMI/LCDREF/R13
DRESET 100 *RST/NMI/SBWTDIO AUXVCC3 26 AUXVCC3 TDO 1 2 INT
4.7uF
P1.1/PM_TA0.1/VEREF+/A1
TDI 3 4 EXT
R51
47K
P1.0/PM_TA0.0/VEREF-/A2
TMS 5 6
TCK 7 8 TEST/SBWTCK
9 10
DNP
I GND I
R45
R19
10K
11 12
RESET 13 14
VSENSE VTEMP
1
10K Thermistor
RESET
0.1uF JTAG
AUXVCC2
AUXVCC1
DVSS_2
P9.1/A5
P9.2/A4
P9.3/A3
VCORE
VDSYS
VASYS
SD0N0
SD1N0
SD2N0
C53
SD0P0
SD1P0
SD2P0
2
DNP
RTH
DVCC
XOUT
R44
AVCC
VREF
R48
AVSS
TCK
XIN
12
13
14
15
16
17
18
19
20
21
22
23
24
25
11
1
2
3
4
5
6
7
8
9
23 - JTAG TEST/SBWTCK 3 K
GND GND
RS232_RXD
RS232_TXD
AUXVCC2
AUXVCC1
VSENSE
VTEMP
VCORE
VDSYS
VASYS
DVCC
I1+_IN
I2+_IN
I3+_IN
V1_IN
V2_IN
VREF
AVCC
V3_IN
XOUT
GND
XIN
TIDM-THREEPHASEMETER-F67641
L
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
A A
SMAJ5.0CA
C C
PMLL4148
S20K275
S20K275
S20K275
47p
TVS2
D29 C23
12.4
R24
D30 PMLL4148
R1
R2
R3
PMLL4148 GND 15n
D4 GND L6 EXCML20A
PMLL4148 NEUTRAL
0 R27
I1- I1-_IN
R/L10 1K GND D
D D12 C20 AVCC
PMLL4148
47p
D31
PMLL4148 D44
GND GND 1N4148DO35-7
AVCC AVCC
GND LINE_V1 R116 V1_IN
R117 R118 1K
E D6 10 20K D45 E
PMLL4148 C8 C1 1N4148DO35-7
R119
D1 10uF 100nF 10K
PMLL4148 0 R6
I2+ I2+_IN
AVCC R/L1 1K C2
D2 GND GND GND GND
SMAJ5.0CA
PMLL4148
47p
TVS1
F D7 C10 F
12.4
R5
D8 PMLL4148
PMLL4148 GND 15n AVCC
D5 GND
PMLL4148 0 R7 I2-_IN D46
I2- 1N4148DO35-7
R/L2 1K
D10 C3 AVCC
PMLL4148 LINE_V2 R120 V2_IN
G 47p G
R123 R121 1K
D9
PMLL4148 10 20K D47
GND GND C36 C9 1N4148DO35-7
AVCC R122
GND 10uF 100nF 10K
D16
PMLL4148 GND GND GND GND H
H
D13
PMLL4148 0 R9
I3+ I3+_IN
AVCC
AVCC R/L3 1K C11
D14
SMAJ5.0CA
PMLL4148
47p
D48
TVS3
D32 C13
12.4
1N4148DO35-7
R8
D33 PMLL4148
I PMLL4148 GND 15n AVCC I
LINE_V3 R124 V3_IN
D15 GND R127 R125 1K
PMLL4148 0 R10 I3-_IN 10 20K D49
I3- C43 C38 1N4148DO35-7
R/L4 1K
D35 C12 R126
PMLL4148 10uF 100nF 10K
47p
K
D34
PMLL4148 K
GND GND GND GND GND GND
GND
TIDM-THREEPHASEMETER-F67641
L
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
54 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter Using SLAA621C – March 2014 – Revised August 2015
the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Schematics
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
A A
B B
0.1uF
C47
1mH
C39 R92 VCC_PL
LINE_1 0.22uF/305VAC D18
Vsupply L7
100 1N4007 U3 C62
B160
0.22uF/305VAC C46 R93 TPS54060_DGQ_10
D23
C LINE_2 D20 C
51.1
R96
LINE_3 0.22uF/305VAC R94 BOOT PH
D22 2 9
100uF/100V
VIN GND
100 D21 1N4007 3 EN COMP 8
4 7
1N4757A SS/TR VSENSE
C102
C48 5 6 GND
R35
RT/CLK PWRGD
22.1K
1M
D19
R95
1N4757A
2.2uF
1N4757A D17
R39 D
D NEUTRAL
0 C60 C61
33.2K
31.6K
GND C45
R37
R38
R97
1M
.056uF 100pF
0.01uF
E E
R98
10K
GND
F F
JP3
LINE_3 L L 26 26
3
2
1
NEUTRAL N N VCC_PL G
G C100 4.7u/400V
22 22 VCC_ISO
C42
ZD3
SMAJ5.0ABCT
NC VO- H
H NC VO-
GND
I I
K
K
TIDM-THREEPHASEMETER-F67641
L
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
SLAA621C – March 2014 – Revised August 2015 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter Using 55
Submit Documentation Feedback the MSP430F67641
Copyright © 2014–2015, Texas Instruments Incorporated
Schematics www.ti.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
A A
B B
R47
47
TXD R72
IR_RXD RXD ACT 2 3 ACT
LL103A IR_SD SD JP121 1K
C51 VCC1 TIL191
2
R78
D26 4.7uF C52
GND VCC
1K
DVCC LL103A IRDA
DB9_+12V 0.1uF GND OPTO1
U2 1 4 2
8 2 D25 1
R68 DVCC 2
LL103A
7 C55 3 D
D
R71 GND GND GND REACT REACT
D27
C57 6 1K
10uF G2 JP111 TIL191
2.2K
0.1uF 5 3 DB9_GND 5 9 2
4 8
DNP
RX_EN
R70
PS8802 C56 3 7
DGND GND 2 6 EEPROM GND
0.1uF
10uF 1
C54
2
1
RS232_RXD D24 G1
UART_RX DB9_-12V RS1 DVCC
E E
0.1uF
LL103A
C41
DVCC
U1
R63
10K
R65 2 8
7 R66 IC1 GND
8
68 R62
6 DNP Q1 SCL 6 SCL VCC
EEPROM
BC857BSMD 7
TX_EN
1K WP
3 5
F 3 SDA 5 SDA F
Array
A2
PS8802 2 A1
R69
2
1
RS232_TXD UART_TX Q2 1
R64
A0
220
BC857BSMD GND
2.2K
4
R67 24C02CSN
1.5K
GND GND GND
G G
RF Daughter Card
JP13
JP14
DVCC
2
1
2
1
10uF
C58
H
H RF_FIFO RF_SIMO
RF_FIFOP RF_SOMI
DVCC
0.1uF
C59
6 5 RF_VREG_EN
1 2 1 2 4 3
RF_VREG_EN R74 0 3 4 3 4 0 R73 2 1
RF_RESETCC R76 0 5 6 0 R75 RF_FIFO 5 6 0 R77
I RF_FIFO R80 0 7 8 0 R81 RF_FIFOP R79 0 7 8 GND JP17 I
RF_FIFOP R82 0 9 10 0 R83 RF_CCA 9 10
11 12 0 R84 RF_SFD 11 12 GND 3
13 14 0 R85 RF_CS 13 14 2 BTN1/RF_VREG_EN
15 16 0 R86 RF_CLK RF_RESETCC R87 0 15 16 1 BTN1
17 18 0 R88 RF_SIMO 17 18 0 R89 RF_GPIO2 JP1
19 20 0 R91 RF_SOMI RF_GPIO1 R90 0 19 20
RF2 RF1
K
GND
K
TIDM-THREEPHASEMETER-F67641
L
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
56 Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter Using SLAA621C – March 2014 – Revised August 2015
the MSP430F67641 Submit Documentation Feedback
Copyright © 2014–2015, Texas Instruments Incorporated
www.ti.com Revision History
Revision History
NOTE: Page numbers for previous revisions may differ from page numbers in the current version.
WARNING
Always follow TI's setup and application instructions, including use of all interface components within their
recommended electrical rated voltage and power limits. Always use electrical safety precautions to help
ensure your personal safety and those working around you. Contact TI's Product Information Center
http://support/ti./com for further information.
Save all warnings and instructions for future reference.
Failure to follow warnings and instructions may result in personal injury, property damage, or
death due to electrical shock and burn hazards.
The term TI HV EVM refers to an electronic device typically provided as an open-framed unenclosed
printed circuit board assembly. It is intended strictly for use in development laboratory environments,
solely for qualified professional users having training, expertise, and knowledge of electrical
safety risks in development and application of high voltage electrical circuits. Any other use
and/or application are strictly prohibited by Texas Instruments. If you are not suitably qualified, you
should immediately stop from further use of the HV EVM.
1. Work Area Safety
(a) Keep work area clean and orderly.
(b) Qualified observer(s) must be present anytime circuits are energized.
(c) Effective barriers and signage must be present in the area where the TI HV EVM and its interface
electronics are energized, indicating operation of accessible high voltages may be present, for the
purpose of protecting inadvertent access.
(d) All interface circuits, power supplies, evaluation modules, instruments, meters, scopes and other
related apparatus used in a development environment exceeding 50Vrms/75VDC must be
electrically located within a protected Emergency Power Off EPO protected power strip.
(e) Use stable and nonconductive work surface.
(f) Use adequately insulated clamps and wires to attach measurement probes and instruments. No
freehand testing whenever possible.
2. Electrical Safety
As a precautionary measure, it is always a good engineering practice to assume that the entire EVM
may have fully accessible and active high voltages.
(a) De-energize the TI HV EVM and all its inputs, outputs and electrical loads before performing any
electrical or other diagnostic measurements. Revalidate that TI HV EVM power has been safely de-
energized.
(b) With the EVM confirmed de-energized, proceed with required electrical circuit configurations,
wiring, measurement equipment connection, and other application needs, while still assuming the
EVM circuit and measuring instruments are electrically live.
(c) After EVM readiness is complete, energize the EVM as intended.
WARNING: WHILE THE EVM IS ENERGIZED, NEVER TOUCH THE EVM OR ITS ELECTRICAL
CIRCUITS AS THEY COULD BE AT HIGH VOLTAGES CAPABLE OF CAUSING ELECTRICAL
SHOCK HAZARD.
3. Personal Safety
(a) Wear personal protective equipment (for example, latex gloves or safety glasses with side shields)
or protect the EVM in an adequate lucent plastic box with interlocks to protect from accidental
touch.
Limitation for safe use:
EVMs are not to be used as all or part of a production unit.
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other
changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest
issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and
complete. All semiconductor products (also referred to herein as “components”) are sold subject to TI’s terms and conditions of sale
supplied at the time of order acknowledgment.
TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s terms
and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary
to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily
performed.
TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products and
applications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information
published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or
endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the
third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration
and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered
documentation. Information of third parties may be subject to additional restrictions.
Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service
voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice.
TI is not responsible or liable for any such statements.
Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements
concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support
that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which
anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause
harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use
of any TI components in safety-critical applications.
In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is to
help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and
requirements. Nonetheless, such components are subject to these terms.
No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties
have executed a special agreement specifically governing such use.
Only those TI components which TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use in
military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components
which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and
regulatory requirements in connection with such use.
TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of
non-designated products, TI will not be responsible for any failure to meet ISO/TS16949.
Products Applications
Audio www.ti.com/audio Automotive and Transportation www.ti.com/automotive
Amplifiers amplifier.ti.com Communications and Telecom www.ti.com/communications
Data Converters dataconverter.ti.com Computers and Peripherals www.ti.com/computers
DLP® Products www.dlp.com Consumer Electronics www.ti.com/consumer-apps
DSP dsp.ti.com Energy and Lighting www.ti.com/energy
Clocks and Timers www.ti.com/clocks Industrial www.ti.com/industrial
Interface interface.ti.com Medical www.ti.com/medical
Logic logic.ti.com Security www.ti.com/security
Power Mgmt power.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defense
Microcontrollers microcontroller.ti.com Video and Imaging www.ti.com/video
RFID www.ti-rfid.com
OMAP Applications Processors www.ti.com/omap TI E2E Community e2e.ti.com
Wireless Connectivity www.ti.com/wirelessconnectivity
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2015, Texas Instruments Incorporated