background
The electric energy meter is an instrument used to measure electric energy, also known as watt-hour meter, fire meter, energy meter, kilowatt-hour meter, which refers to the instrument that measures various electrical quantities. ARM-based solutions have appeared, but the ARM7 TDMI suitable for the application is not satisfactory in performance and has insufficient peripheral resources; while the more advanced ARM9 system is very complex and expensive. Therefore, we need to study a cheap electric energy meter that meets customer needs to fill this gap.
1. About CORTEX-M3 and STM32
The latest generation of ARM v7 core, named Cortex, has a revolutionary breakthrough in architecture compared with ARM7/9/10/11. It uses an efficient Harvard structure three-stage pipeline, reaching 1.25DMIPS/MHz, and the power consumption is 0.06mW/MHz. Cortex-M3 uses the Thumb-2 instruction set, automatic 16/32-bit mixed arrangement. Single-cycle 32-bit multiplication and hardware divider ensure that the computing power of Cortex-M3 is greatly improved. Cortex-M3 includes a nested vector interrupt controller NVIC, with the fastest interrupt response speed of only 6 cycles, an internal integrated bus matrix, and supports DMA operations and bit mapping.
The STM32 system is divided into two different series according to performance: STM32F103 "Enhanced" series and STM32F101 "Basic" series. The clock frequency of the Enhanced series reaches 72MHz, which is the highest performance product among similar products; the clock frequency of the Basic series is 36MHz, which has significantly improved performance than 16-bit products at the price of 16-bit products.
2. Electricity meter solution based on STM32
According to the function and error accuracy requirements of the energy meter, we selected STM32F103xx with a maximum operating frequency of 72MHz.
1. Data collection, processing and calculation
In practical applications, power signals are collected into the energy meter through a transformer, and then converted into digital signals through a 6-channel 16-bit analog front-end processor (AD73360) for A/D conversion and transmitted to the STM32. The AD73360 is a 6-channel synchronous sampling Σ-Δ ADC device with a built-in basic voltage reference and independent PGA for each channel. By adjusting the channel PGA, a suitable dynamic range can be obtained to ensure the measurement accuracy of weak signals.
The voltage and current input signals first need to be filtered by an RC filter network and sampled, and then A/D converted. AD73360 has an independent clock source and can be configured as an automatic data acquisition and transmission mode, continuously transmitting data to STM32 through the SPI bus. The Cortex-M3 core in STM32 processes the input digital signal, completes digital filtering, zero-crossing detection, obtains basic current and voltage data, and obtains the corresponding electric energy measurement through time integration calculation and conversion.
(II) Sampling circuit and filtering network
Since the sampled signal is a high voltage signal and a high current signal, we need to convert the sampled signal into a bipolar voltage signal with high fidelity so that it can be discretized by the AD circuit. We need to make the input signal be located in the middle of the dynamic range of AD73360. The method used is: define the ADC operating voltage as 5 volts, select the reference voltage as 2.5 volts, connect the negative end of the AD differential input directly to the reference voltage input, and connect the positive end of the differential input to the measured signal. For circuit analysis, refer to Figure 3:
[page]
(III) Interface between AD73360 and STM32
In order to minimize the CPU time, the hardware SPI and DMA units inside the STM32 are used to realize data transmission, and the STM32 core obtains basic data in batches and starts the data processing program according to the DMA transmission results. The hardware connection relationship is shown in Figure 4.
3. Calculation of main electrical energy parameters
AD73360 is a fixed-cycle acquisition. We use 150Hz or 160Hz, that is, 150/160 points are collected per cycle. For this reason, the clock used by AD73360 is 6.000MHz or 16.384MHz. The configuration of AD73360 in the system is that the DMCLK division factor is 2048. AD73360 is a differential acquisition, which is very convenient for zero-crossing detection and DC component adjustment to ensure signal amplitude symmetry, thereby reducing system errors.
Voltage measurement (effective value) calculation formula:
Where: U-voltage effective value, n-number of sampling points per cycle, uk —voltage sampling value
Current measurement (effective value) calculation formula:
The total power S is calculated based on the effective values of the current and voltage. The active power P is obtained by integrating the current and voltage product over time. The reactive power Q is the difference between the total power S and the active power P. The power factor is the ratio of the active power P to the total power S.
The calculation of active power and reactive power for single device and three-phase four-wire star load is summarized as follows:
The calculation formula of active power of a single element is:
Where: P-active power per unit, n-number of sampling points per cycle, uk-voltage sampling value on the element, ik-current sampling value on the element
The calculation formula of reactive power of a single element is:
Where: Q-unit reactive power, n-number of sampling points per cycle, uk-voltage sampling value on the component, ik-current sampling value on the component (after 90 degrees phase shift)
Three-phase four-wire three-element active power calculation formula: PΣ=Pu+Pv+Pw
Where: PΣ-three-phase active power, Pk -(k=u,v,w) each phase active power
Three-phase four-wire three-element reactive power calculation formula: QΣ=Qu+Qv+Qw
Where: QΣ-three-phase reactive power, Qk -(k=u,v,w) reactive power of each phase
[page]
4. Compensation and correction of nonlinear distortion
The electromagnetic components that may exist in the process of electrical signal acquisition will cause phase distortion and linear distortion between the acquired signal and the actual signal. In order to compensate and correct the errors caused by these distortions, it is necessary to use segmented correction and compensation methods.
The method for obtaining the linearity compensation parameters and phase compensation parameters is as follows:
1. Zero bias calibration: Set all channel inputs to zero and record the zero position of each channel respectively.
2. Voltage calibration: Set the input value of all voltage channels to the standard voltage value of 220V (RMS) and record the voltage calibration parameters of each phase.
3. Current calibration: Set the input value of all current channels to the demarcation point current, and record the calibration parameters of the small current measurement section of each channel. Then set the input value of all current channels to the maximum value, and record the calibration parameters of the large current measurement section of each channel.
4. Phase shift calibration: The input phases of the current and voltage channels are set to differ by 60 degrees respectively, and the current value of the current channel is at the middle point of the phase compensation section. The phase compensation parameters of the compensation section are obtained based on the active energy error.
5. All the compensation parameters obtained are stored in non-volatile memory.
5. Electric energy meter matching circuit
Real-time clock circuit: Intersil's ISL12022M is a high-reliability fully automatic temperature compensation RTC chip with a built-in clock crystal. The RTC relies on factory pre-calibration and automatic temperature compensation in the full industrial temperature range to ensure the timing accuracy of electronic products throughout their life cycle. The RTC also has battery status monitoring, power-on/power-off timestamp recording functions, and a built-in digital temperature sensor function, and can be used in comprehensive power terminal equipment other than electricity meters.
Voltage Reference: Intersil's ISL21009 series is a low-noise, high-stability precision voltage reference used to provide a higher stability (5ppm) reference voltage for the measurement system when the stability of the AD73360 built-in reference (50ppm) is not enough.
Power management circuit: ON Semiconduction's NCP3063 is a low-cost, high-efficiency DC/DC regulator that has simple peripheral circuit requirements and a wide input voltage range of 40 volts. Electric energy meters often operate under a wide input voltage range, so NCP3063 is very suitable for use behind the power frequency transformer of the electric energy meter to perform 5 volt or 3.3 volt DC voltage regulation.
Communication interface circuit: Intersil's ISL3152E is a full-featured RS485 interface chip that has many characteristics that are particularly suitable for the AMR system of electric energy meters, including 1/8 standard load drive (256 nodes), positive and negative 16.5 kV ESD protection, hot-swap function, 20Mbps bus rate, support for star topology network, etc.
Conclusion
The three-phase energy meter solution based on CORTEX's STM32 has a certain reputation in the market, so this solution has successfully solved various existing problems and has high competitiveness in the market. Enterprises will tend to choose this cheap, convenient and fast system.
Previous article:Design of an integrated two-phase stepper motor driver based on CAN bus
Next article:Wireless network system design based on STM32L152 and S14432
Recommended ReadingLatest update time:2024-11-16 15:22
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- USB TYPE C interface problem urgent help
- Can't find header file when compiling
- NXP Smart Car Northeast Competition First Prize, we will open source after the competition
- Cumulative error analysis and clock frequency optimization for UART communication in MSP430FR2311
- Guess the price and win a surprise - how much does this "good" phone cost? Let's find out!
- ucos ii based on Cortex-M0 can run source code project
- Looking for a logic device like 74HC595
- UDP protocol peer-to-peer (P2P) communication (or NAT traversal) example
- TI-TM4C123x learning record: reading high and low levels
- Competition and adventure in digital circuits