SLAA494B May   2011  – September 2023 MSP430AFE221 , MSP430AFE222 , MSP430AFE223 , MSP430AFE231 , MSP430AFE232 , MSP430AFE233 , MSP430AFE251 , MSP430AFE252 , MSP430AFE253

 

  1.   1
  2.   Implementation of a Single-Phase Electronic Watt-Hour Meter Using the MSP430AFE2xx
  3. Trademarks
  4. Introduction
  5. Block Diagram
  6. Hardware Implementation
    1. 4.1 Power Supply
      1. 4.1.1 Resistor Capacitor (RC) Power Supply
      2. 4.1.2 Switching-Based Power Supply
    2. 4.2 Analog Inputs
      1. 4.2.1 Voltage Inputs
      2. 4.2.2 Current Inputs
  7. Software Implementation
    1. 5.1 Peripherals Setup
      1. 5.1.1 SD24 Setup
    2. 5.2 Foreground Process
      1. 5.2.1 Formulas
        1. 5.2.1.1 Voltage and Current
        2. 5.2.1.2 Power and Energy
    3. 5.3 The Background Process
      1. 5.3.1 Voltage and Current Signals
      2. 5.3.2 Phase Compensation
      3. 5.3.3 Frequency Measurement and Cycle Tracking
      4. 5.3.4 LED Pulse Generation
    4. 5.4 Energy Meter Configuration
  8. Energy Meter Demo
    1. 6.1 EVM Overview
      1. 6.1.1 Connections to the Test Setup or AC Voltages
      2. 6.1.2 Power Supply Options
    2. 6.2 Loading the Example Code
      1. 6.2.1 Opening the Project
  9. Results
    1. 7.1 Viewing Results on PC
    2. 7.2 Viewing Results During Debug
  10. Important Notes
  11. Schematics
  12. 10References
  13. 11Revision History

Power and Energy

Power and energy are calculated for a frame's worth of active and reactive energy samples. These samples are phase corrected and passed on to the foreground process that uses the number of samples (sample count) and use the formulae listed below to calculate total active and reactive powers.

GUID-3BB4CD8F-801F-4057-81D4-F056CFA6CC7B-low.gif
GUID-68FAFBDE-7F1C-4496-9352-AEDFA2CBDBD5-low.gif

v90 (n) = Voltage sample at a sample instant ‘n' shifted by 90°

Kp = Scaling factor for power

The consumed energy is then calculated based on the active power value for each frame, similar to the way the energy pulses are generated in the background process except that:

EACT = PACT × Sample count

For reactive energy, use the 90° phase shift approach for two reasons:

  • It allows accurate measurement of the reactive power with very small currents.
  • It conforms to international specified measurement method.

Because the frequency of the mains varies, it is important to first measure the mains frequency accurately and then phase shift the voltage samples accordingly. This is discussed in Section 5.3.3.

The phase shift 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 fractional delay filter (see Section 5.3.2).