TIDUF25 june   2023 ADS131M08 , MSPM0G1507

 

  1.   1
  2.   Description
  3.   Resources
  4.   Features
  5.   Applications
  6.   6
  7. 1System Description
    1. 1.1 End Equipment
    2. 1.2 Electricity Meter
    3. 1.3 Power Quality Meter, Power Quality Analyzer
    4. 1.4 Key System Specifications
  8. 2System Overview
    1. 2.1 Block Diagram
    2. 2.2 Design Considerations
      1. 2.2.1 External Supply Voltage Supervisor (SVS) With TPS3840
      2. 2.2.2 Magnetic Tamper Detection With TMAG5273 Linear 3D Hall-Effect Sensor
      3. 2.2.3 Analog Inputs
        1. 2.2.3.1 Voltage Measurement Analog Front End
        2. 2.2.3.2 Current Measurement Analog Front End
    3. 2.3 Highlighted Products
      1. 2.3.1  ADS131M08
      2. 2.3.2  MSPM0G3507
      3. 2.3.3  MSP430FR4131 for Driving Segmented LCD Displays
      4. 2.3.4  TPS3840
      5. 2.3.5  THVD1400
      6. 2.3.6  ISO6731
      7. 2.3.7  ISO6720
      8. 2.3.8  TRS3232E
      9. 2.3.9  TPS709
      10. 2.3.10 TMAG5273
  9. 3System Design Theory
    1. 3.1  How to Implement Software for Metrology Testing
    2. 3.2  Clocking System
    3. 3.3  UART Setup for GUI Communication
    4. 3.4  Real-Time Clock (RTC)
    5. 3.5  LCD Controller in MSP430FR4131
    6. 3.6  Direct Memory Access (DMA)
    7. 3.7  ADC Setup
    8. 3.8  Foreground Process
      1. 3.8.1 Formulas
    9. 3.9  Background Process
    10. 3.10 Software Function per_sample_dsp()
      1. 3.10.1 Voltage and Current Signals
      2. 3.10.2 Frequency Measurement and Cycle Tracking
    11. 3.11 LED Pulse Generation
    12. 3.12 Phase Compensation
  10. 4Hardware, Software, Testing Requirements, and Test Results
    1. 4.1 Required Hardware and Software
      1. 4.1.1 Hardware
      2. 4.1.2 Cautions and Warnings
    2. 4.2 Test Setup
      1. 4.2.1  Connecting the TIDA-010243 to the Metering Test Equipment
      2. 4.2.2  Power Supply Options and Jumper Settings
      3. 4.2.3  Electricity Meter Metrology Accuracy Testing
      4. 4.2.4  Viewing Metrology Readings and Calibration
        1. 4.2.4.1 Viewing Results From LCD
        2. 4.2.4.2 Calibrating and Viewing Results From PC
      5. 4.2.5  Calibration and FLASH Settings for MSPM0+ MCU
      6. 4.2.6  Gain Calibration
      7. 4.2.7  Voltage and Current Gain Calibration
      8. 4.2.8  Active Power Gain Calibration
      9. 4.2.9  Offset Calibration
      10. 4.2.10 Phase Calibration
      11. 4.2.11 Software Code Example
    3. 4.3 Test Results
      1. 4.3.1 SVS Functionality Testing
      2. 4.3.2 Electricity Meter Metrology Accuracy Results
  11. 5Design and Documentation Support
    1. 5.1 Design Files
      1. 5.1.1 Schematics
      2. 5.1.2 BOM
      3. 5.1.3 PCB Layout Recommendations
      4. 5.1.4 Layout Prints
      5. 5.1.5 Gerber Files
    2. 5.2 Tools and Software
    3. 5.3 Documentation Support
    4. 5.4 Support Resources
    5. 5.5 Trademarks
  12. 6About the Author

Formulas

This section describes the formulas used for the voltage, current, power, and energy calculations. As previously described, voltage and current samples are obtained at a sampling rate of 8000 Hz. All of the samples that are taken in approximately one second frames are kept and used to obtain the RMS values for voltage and current for each phase. The RMS values are obtained with the following formulas:

Equation 4. V R M S , p h = K v , p h × n = 1 S a m p l e   C o u n t v p h n   ×   v p h ( n ) S a m p l e   C o u n t - v o f f s e t , p h
Equation 5. I R M S , p h = K i , p h × n = 1 S a m p l e   C o u n t i p h n   ×   i p h ( n ) S a m p l e   C o u n t - i o f f s e t , p h

where

  • ph = Phase parameters that are being calculated [that is, Phase A (= 1) or B (= 2)]
  • 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 within the present frame
  • Kv,ph = Scaling factor for voltage
  • Ki,ph = Scaling factor for current

Power and energy are calculated for active and reactive energy samples of one frame. These samples are phase-corrected and passed on to the foreground process, which uses the number of samples (sample count) to calculate phase active and reactive powers through the following formulas:

Equation 6. P A C T , p h = K A C T , p h n = 1 S a m p l e   C o u n t v n   ×   i p h ( n ) S a m p l e   C o u n t - P A C T _ O f f s e t , p h
Equation 7. P R E A C T , p h = K R E A C T , p h n = 1 S a m p l e   C o u n t v 90 , p h n   ×   i p h ( n ) S a m p l e   C o u n t - P R E A C T _ O f f s e t , p h
Equation 8. P A P P , p h = P A C T , p h 2 + P R E A C T , p h 2

where

  • v90(n) = Voltage sample at a sample instant ‘n’ shifted by 90°
  • KACT,ph = Scaling factor for active power
  • KREACT,ph = Scaling factor for reactive power
  • PACT_offset,ph = Offset used to subtract effects of crosstalk on the active power measurements from other phases and the neutral
  • PREACT_offset,ph = Offset used to subtract effects of crosstalk on the reactive power measurements from other phases and the neutral

Note that for reactive energy, the 90° phase shift approach is used for two reasons:

  1. This approach allows accurate measurement of the reactive power for very small currents
  2. This approach conforms to the measurement method specified by IEC and ANSI standards

The calculated mains frequency is used to calculate the 90 degrees-shifted voltage sample. Because the frequency of the mains varies, the mains frequency is first measured accurately to phase shift the voltage samples accordingly.

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 phase shift implementation of the application 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 test software, a lookup table provides the filter coefficients that are used to create the fractional delays.

In addition to calculating the per-phase active and reactive powers, the cumulative sum of these parameters are also calculated using Equation 9, Equation 10, and Equation 11.

Equation 9. P A C T , C u m u l a t i v e = p h = 1 2 P A C T , p h
Equation 10. P R E A C T , C u m u l a t i v e = p h = 1 2 P R E A C T , p h
Equation 11. P A P P , C u m u l a t i v e = p h = 1 2 P A P P , p h

Using the calculated powers, energies are calculated with the following formulas in Equation 12.

Equation 12. E A C T , p h = P A C T , p h × S a m p l e   C o u n t E R E A C T , p h = P R E A C T , p h × S a m p l e   C o u n t E A P P , p h = P A P P , p h × S a m p l e   C o u n t

From there, the energies are also accumulated to calculate the cumulative energies, by the following Equation 13, Equation 14, and Equation 15.

Equation 13. E A C T ,     C u m u l a t i v e = p h = 1 2 E A C T , p h
Equation 14. E R E A C T , C u m u l a t i v e = p h = 1 2 E R E A C T , p h
Equation 15. E A P P , C u m u l a t i v e = p h = 1 2 E A P P , p h

The calculated energies are then accumulated into buffers that store the total amount of energy consumed since system reset. Note that these energies 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. React. Quad I energy (reactive energy when reactive energy ≥ 0 and active power ≥ 0; inductive load)
  4. React. Quad II energy (reactive energy when reactive energy ≥ 0 and active power < 0; capacitive generator)
  5. React. Quad III energy (reactive energy when reactive energy < 0 and active power < 0; inductive generator)
  6. React. Quad IV energy (reactive energy when reactive energy < 0 and active power ≥ 0; capacitive load)
  7. App. import energy (apparent energy when active energy ≥ 0)
  8. App. export energy (apparent energy when active energy < 0)

The background process also calculates the frequency in terms of samples-per-mains cycle. The foreground process then converts this samples-per-mains cycle to Hertz with Equation 16.

Equation 16. F r e q u e n c y   ( H z ) = S a m p l e   R a t e   ( s a m p l e s   /   s e c o n d ) F r e q u e n c y   ( s a m p l e s   /   s e c o n d )

After the active power and apparent power have been calculated, the absolute value of the power factor is calculated. In the internal representation of power factor of the system, a positive power factor corresponds to a capacitive load; a negative power factor corresponds to an inductive load. The sign of the internal representation of power factor is determined by whether the current leads or lags voltage, which is determined in the background process. Therefore, the internal representation of power factor is calculated with Equation 17.

Equation 17. I n t e r n a l   R e p r e s e n t a t i o n   o f   P o w e r   F a c t o r = P A C T P A p p a r e n t ,   i f   c a p a c i t i v e   l o a d P A C T P A p p a r e n t ,   i f   i n d u c t i v e   l o a d