As the basic equipment for energy measurement, the energy meter has been paid attention to by the national power department for a long time. The energy meter manufacturers have spared no effort to seek solutions with excellent design and development performance and lower cost. At present, the design of domestic energy meters has gone through the transformation from 8-bit MCU to general DSP and even dedicated DSP. The disadvantage of the application solution of general DSP is that the professional application and embedding level of DSP are not deep enough, and the cost is high; while the functions of dedicated DSP are relatively fixed, which brings difficulties to the design and production of energy meters and the lack of functional differentiation space. ARM-based solutions have also appeared, but the ARM7 TDMI suitable for the application is not satisfactory in performance and has insufficient peripheral resources; while the higher-end ARM9 system is very complex and has a high cost. Choosing a suitable and low-cost microprocessor has become the key to the energy meter industry. Until the emergence of STMicroelectronics (STMicroelectronics, hereinafter referred to as ST) STM32 brought new opportunities and space for the specialization and customization of energy meter design.
1. About CORTEX-M3 and STM32
In 2005, ARM released its latest generation of ARM v7 core, named Cortex. Compared with ARM7/9/10/11, it has a revolutionary breakthrough in architecture and a fundamental leap in performance. The Cortex series includes three series, -A/-R/-M. Cortex-M3 is especially targeted at embedded applications that are sensitive to power consumption and price, and has high performance. It uses an efficient Harvard structure three-stage pipeline to achieve 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, and has a very high code density. Single-cycle 32-bit multiplication and hardware divider ensure that the computing power of Cortex-M3 has been greatly improved. In some occasions where the computing power requirements are relatively low and the embedded requirements are relatively high, STM32 has the potential and even advantages to replace traditional DSP. Cortex-M3 includes a nested vector interrupt controller NVIC, with a maximum interrupt response speed of only 6 cycles, an internal integrated bus matrix, and support for DMA operations and bit mapping.
STM32 is the first product based on the ARM Cortex-M3 core launched by ST in the industry. It inherits the excellent pedigree of the Cortex-M3 core and adds ST's high-performance peripheral resources, FLASH, SRAM memory, rich serial communication interfaces such as IIC, SPI, USART, CAN, USB, etc., as well as 12-bit ADC and DAC modules, and a flexible static memory controller FSMC that supports external memory access.
2. Electricity meter solution based on STM32
According to the requirements of the function and error accuracy of the electricity meter, we selected the enhanced series STM32F103xx of ST's STM32, with a maximum operating frequency of 72MHz. In addition to completing fast data processing in program design, correction and compensation for system nonlinear distortion are also carried out.
The block diagram of the energy meter system is shown in Figure 1:
(I) Data collection, processing and calculation
In practical applications, the power signal is collected into the energy meter through a transformer, and A/D conversion is performed through a 6-channel 16-bit analog front-end processor (AD73360), converted into a digital signal and transmitted to the STM32. AD73360 is a 6-channel synchronous sampling Σ-ΔADC device. It has a built-in basic voltage reference and a built-in independent PGA (programmable gain amplifier) for each channel. It is very suitable for synchronous sampling of three-phase current and voltage signals. When the signal is small, the appropriate dynamic range can be obtained by adjusting the channel PGA to ensure the measurement accuracy of weak signals. The data acquisition block diagram of the energy meter is shown in Figure 2. The
voltage and current input signals first need to be filtered by an RC filter network and data sampled, and then A/D conversion is performed. AD73360 has an independent clock source and can be configured as an automatic data acquisition and transmission mode, and continuously transmits 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 large current signal, we need to convert the sampled signal into a bipolar voltage signal with high fidelity so that it can be discretized by AD circuit. AD73360 is a single-power supply analog front end, so we need to make the input signal located in the middle of the dynamic range of AD73360. The method adopted is: define the ADC operating voltage as 5 volts (dynamic range 0~5V), select the reference voltage of 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. The specific circuit is shown in Figure 3.
In the actual circuit, the phase current signal is converted into a low voltage signal by CT, and the phase voltage is divided by a high-precision resistor network to obtain a linear low voltage signal. The signal amplitude range must be guaranteed to be within 5V.
(III) Interface between AD73360 and STM32
Because the total amount of basic data generated by AD73360 is huge, in order to occupy as little CPU time as possible, it is necessary to use the hardware SPI and DMA units inside STM32 to realize data transmission, and the core of STM32 obtains basic data in batches and starts the data processing program according to the transmission results of DMA. The hardware connection relationship is shown in Figure 4.
The SE and RESET of AD73360 are controlled by the GPIO of STM32, and an external interrupt input pin is used to monitor the frame synchronization signal, so that the byte correspondence of the data frame content can be guaranteed by the program.
In the hardware setting program of STM32, it is necessary to turn off all interrupts of SPI, set SPI to slave mode, and select a DMA channel to work with it, and automatically save the data received in SPI slave mode in the specified memory address. In order for AD73360 to collect data correctly, it is also necessary to configure the internal registers of AD73360 according to the use requirements, so that AD73360 is in data mode and actively sends sampled data to STM32.
3. Calculation of main electric energy parameters
AD73360 is a fixed period 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 DMCLK division factor of 2048. AD73360 is 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:
Where: I - current effective value, n - number of sampling points per cycle, ik - current sampling value
The total power S (i.e. apparent power) is calculated based on the effective value of current and voltage, and 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, and 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:
Single device active power calculation formula:
Where: P - single device active power, n - number of sampling points per cycle, uk - voltage sampling value on the component, ik - current sampling value on the component
Single device reactive power calculation formula:
In the formula: Q - single element reactive power, n - number of sampling points per cycle, uk - voltage sampling value on the element, ik - current sampling value on the element (after 90 degrees phase shift)
Three-phase four-wire three-element active power calculation formula: PΣ=Pu+Pv+Pw
In the formula: PΣ - three-phase active power, Pk - (k=u,v,w) active power of each phase
Three-phase four-wire three-element reactive power calculation formula: QΣ=Qu+Qv+Qw
In the formula: QΣ - three-phase reactive power, Qk - (k=u,v,w) reactive power of each phase
Fourth, compensation and correction of nonlinear distortion
The electromagnetic components (CT or PT) 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 also necessary to use segmented correction and compensation methods. For example, according to the phase shift curve of CT (PT), two appropriate points are selected to divide the entire range into three sections. When the measured value is in different sections, different phase shift parameters are called to perform phase compensation on the measured value.
The method for obtaining linearity compensation parameters and phase compensation parameters (calibration process) 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 all voltage channel input values to the standard voltage value of 220V (RMS) and record the voltage calibration parameters of each phase.
3. Current calibration: set all current channel input values to the demarcation point current and record the calibration parameters of the small current measurement section of each channel. Then set all current channel input values to the maximum value and record the calibration parameters of the large current measurement section of each channel respectively.
4. Phase shift calibration: set the current and voltage channel input phases to differ by 60 degrees respectively, and the current value of the current channel is at the middle point of the phase compensation section, and obtain the phase compensation parameters of the compensation section according to the active energy error.
5. All the compensation parameters obtained are stored in a non-volatile memory, such as the FLASH of STM32.
5. Electricity meter matching circuit
In addition to the measurement and metering functions, the energy meter also needs to realize communication, storage and time management functions. The specific procedures and practices will not be repeated here, but in order to realize the complete energy meter function, the selection of its peripheral devices is critical.
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 the life cycle, eliminating the process of clock calibration of the meter and reducing production costs. The RTC also has battery status monitoring, power-on/power-off timestamp recording functions and built-in digital temperature sensor functions, and can be used in comprehensive power terminal equipment other than the meter.
Voltage reference: Intersil's ISL21009 series is a low-noise, high-stability precision voltage reference, which is 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 with simple peripheral circuit requirements and a wide input voltage range of 40 volts. The energy meter often works under a wide input voltage range. Therefore, NCP3063 is very suitable for 5 volt or 3.3 volt DC voltage regulation behind the power frequency transformer of the energy meter.
Communication interface circuit: Intersil's ISL3152E is a full-featured RS485 interface chip. This interface chip has many characteristic indicators that are particularly suitable for the energy meter AMR system. These include 1/8 standard load drive (256 nodes), positive and negative 16.5 kV ESD protection, hot-swap function (node power supply changes do not affect bus communication), 20Mbps bus rate, support for star topology network, etc.
Conclusion
The three-phase energy meter solution based on CORTEX's STM32 has proven to be the most advantageous mainstream solution at present, and has been widely praised and recognized by the industry. At present, this solution has been successfully applied in the 0.5S electronic three-phase multifunctional watt-hour meter of a large-scale meter manufacturer.
Previous article:Design of a new anti-counterfeiting code reader
Next article:stm32f051(2) system clock setting
Recommended ReadingLatest update time:2024-11-16 13:48
- 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
- Lock-in Amplifier Design
- EEWORLD University ----RISC-V 5th workshop
- What is transparent transmission and point-to-multipoint transmission? What are their classic applications and advantages?
- How to build an undervoltage protection circuit using discrete components
- [Mill MYB-YT507 development board trial experience] + some problems in the compilation experience
- Like this BOOST boost topology, if a lithium battery 4.2V & 1000mA is used, the load current is a momentary signal (no need to...
- [NXP Rapid IoT Review] + When connecting to a device via mobile app, the message "Unable to verify the device's hardware credentials" appears
- EEWORLD University Hall ---- Fundamentals of Control Engineering Guo Meifeng, Tsinghua University
- Development board based on TI AM5728 (floating point dual DSP C66x + dual ARM Cortex-A15)
- Agitek High-tech Joint Electronics Laboratory fully supports the National Undergraduate Electronics Design Competition