0 Introduction
Distribution automation technology is developing rapidly towards digitalization, intelligence, networking and multi-function. This paper takes the microcontroller LPC2132 chip containing ARM7TDMI-STM CPU as the main controller of the system, and focuses on the collection and data communication of power system data signals and power system status monitoring. It studies and designs a terminal control unit with intelligent power distribution and can monitor ten user circuits at the same time. It has the function of measuring power parameters such as active power, reactive power, energy, voltage, current, power factor, etc. in each circuit.
1 Principle of measurement of power parameters
A symmetrical three-phase power supply is usually composed of three sinusoidal voltage sources with the same frequency, equal amplitude and initial phase angle of 1200 connected in a certain way. The three-phase signals can be called A, B, and C phases in turn, denoted as uA, uB, and uC. Their instantaneous expressions are as follows:
In an AC circuit, the cosine of the phase difference between voltage and current is called the power factor. Numerically, the power factor is the ratio of active power to apparent power, that is:
The power factor reflects the proportion of reactive power in the output power. Improving the power factor of electrical appliances generally has two meanings. One is to reduce the power loss on the transmission line; the other is to give full play to the potential of power equipment (such as generators, transformers, etc.). Therefore, improving the power factor has a positive effect on improving the utilization rate of power equipment, improving power supply quality, and saving electricity.
2 Hardware Design
2.1 Overall Structure
In order to avoid interference of strong electric signals on weak electric signals, this system uses three layers of circuit boards in the overall structure, namely: the signal acquisition circuit board at the bottom, the signal processing circuit board at the middle layer, and the LCD display circuit board at the top layer. Many large and heavy components are arranged on the bottom board, which is conducive to the stability of the entire unit; the main function of the middle layer is to process the signal transmitted from the signal acquisition layer, so this layer is also the main control circuit board of this design; the upper layer mainly realizes the display function, and displays the measurement parameters transmitted from the middle layer in real time. The overall structure of the entire monitoring unit is shown in Figure 1.
2.2 Selection of microcontroller
This system uses LPC2132 as the microcontroller, which is a 32/16-bit ARM7TD-MI-STM CPU microcontroller that supports real-time simulation and embedded tracing, and has 64/128/256/512KB of embedded high-speed Flash memory. LPC2132 has multiple 32-bit timers, 1 (LPC2132) 10-bit 8-channel ADC, 10-bit DAC, PWM channels and up to 47 GPIOs, as well as 9 edge or level-triggered external interrupts. The schematic diagram of the LPC2132 external interface in the system is shown in Figure 2. [page]
2.3 Functions and features of AIT7022B
ATT7022B is a high-precision multifunctional anti-electricity theft fundamental wave three-phase electric energy dedicated metering chip produced by Actions. It can be used to measure the fundamental wave, harmonic and full-wave active power, reactive power, apparent power, active energy, reactive energy, power factor, phase angle parameters, etc. of each phase and combined phase, which can fully meet the needs of three-phase multifunctional electric energy meter with multiple tariff rates. The internal functional structure of AT7022B is shown in Figure 3. Among them, V1P/V1N, V3P/V3N, V5P/V5N are the positive and negative analog input pins of the current channels of phases A, B and C respectively, and V2P/V2N, V4P/V4N, V6P/V6N are the positive and negative analog input pins of the voltage channels of phases A, B and C respectively. V7P/V7N is the positive and negative analog input pin of the seventh ADC. CF1, CF2, CF3, and CF4 are active energy pulse output, reactive energy pulse output, fundamental wave active energy pulse output, and fundamental wave reactive energy pulse output respectively. DIN is the SPI serial data input port, DOUT is the SPI serial data output port, CS is the SPI chip select signal, and SCLK is the SPI serial clock input port. [page]
As can be seen from Figure 3, the internal structure of ATT7022B can be roughly divided into several parts, including A/D analog-to-digital conversion module, digital signal processing module (DSP), SPI communication interface module, pulse generation module, etc. ATT7022B provides an SPI interface to facilitate the transmission of metering parameters and calibration parameters with external controllers. All metering parameters can be read through the SPI interface. Its internal voltage monitoring circuit can ensure normal operation when power is on and off. Its application circuit is shown in Figure 4. [page]
2.4 RS485 bus interface
The RS485 serial communication interface technology used in the communication between the intelligent terminal and the host computer in this design is developed from RS232 and RS422 technologies. The maximum transmission distance of the RS-485 standard is about 1219 meters, and the maximum transmission rate is 10Mbps. RS-485 can achieve the longest cable length capability at a rate of 20kbps. The SN65HVDl2 chip used in this intelligent terminal design can be directly embedded in the actual RS-485 application circuit. The standard serial port of its microprocessor can be directly connected to the R pin of the SN65HVDl2 chip through RXD. Directly connect the D pin of the SP485R chip through TXD, and the specific circuit is shown in Figure 5. [page]
3.1 Modbus Communication Protocol
The communication between this monitoring terminal and the host computer adopts the Modbus communication protocol. This protocol is a universal language used in electronic controllers. Through this protocol, controllers can communicate with each other and with other devices via a network (such as Ethernet). The protocol also supports traditional RS232, RS422 and RS485 interfaces. The traditional Modbus protocol is divided into ASCII mode and RTU mode. Considering the efficiency and safety of the power distribution system, the RTU mode is used here. When using the RTU mode, the message transmission must start with a pause interval of at least 3.5 characters. And after the last transmitted character, a pause of at least 3.5 characters should be used to mark the end of the message. A new message can start after this pause. The entire message frame must be transmitted as a continuous stream. If there is a pause time of more than 1.5 characters before the frame is completed, the receiving device will refresh the incomplete message and assume that the next byte is the address field of a new message. Similarly, if a new message starts within 3.5 characters of the previous message, the receiving device will consider it as a continuation of the previous message, which will result in an error. However, this error can be discovered using CRC checking. The typical RTU message frame is shown in Table 1.
3.2 Software Design
This design uses C language to write the operating software on the Keil C platform to complete the mutual communication between the host computer (PC) and the terminal. The system software mainly includes the main program, initialization program, ATT7022B reset program, SPI communication program, data acquisition program, data transmission program, and interrupt program. Figure 6 shows the main flow of the software program.
The host computer in the system communicates with the system through the RS485 serial port, and its function chip ATT7022B also uses the serial mode to exchange data with the system control core LPC2132. Figure 7 shows the software design structure of this system.
4 Conclusion
Digital and networked power monitoring is an inevitable trend of industrial remote monitoring and monitoring, and is also the best choice for industrial remote monitoring. In the future, efficient, fast, accurate and safe power remote control monitoring system, that is, intelligent power monitoring system, will still be the main object of our research. This paper takes LPC2132 microprocessor as the core, and gives the hardware circuit of the power monitoring unit that measures active, reactive, apparent power, bidirectional active and four-quadrant reactive power, LCD display, and backup automatic transfer function. The next stage of work will be to configure functional software for the system and debug the system so that the system can run safely and effectively in on-site production.
Previous article:Tailoring and transplantation of embedded Linux kernel based on ARM
Next article:ARM Embedded PDA STR710
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
- Can the freewheeling diode be omitted when the MOS tube controls the solenoid valve?
- STEVAL-MKSBOX1V1 (SensorTile.box) firmware download via USB
- HP Prime G2 calculator with MicroPython support
- STM32 output 4-20MA or 0-10V circuit sharing
- LIS2MDL array PCB engineering and code information for magnetic nail navigation AGV car
- Live Review: Rochester Electronics Semiconductor Full-Cycle Solutions (including videos, materials, Q&A)
- How to understand this parameter in the MOS tube specification?
- Why is it necessary to use a four-pin Kelvin connected resistor for current detection?
- Purgatory Legend-12864 LCD War
- Live Review: How to Design High-Performance Servo Drives Using Infineon IGBT7