1. Introduction
Power factor is an important parameter in AC circuits, an important indicator for measuring whether the power system is operating economically, and an important detection quantity for the online monitoring system of power supply lines. It needs to be measured in real time in the power factor compensation system [1]. Therefore, it is very necessary to design a power factor online detection circuit with simple structure and high detection accuracy. The measurement of power factor generally requires sampling the voltage and current of the circuit under test, and then processing and extracting the power factor signal. It usually consists of voltage and current sampling circuits, shaping circuits, synchronous cycle measurement, phase measurement, etc. Its disadvantages are that the structure is complex and difficult to repair. Sometimes the power factor measurement accuracy is not high [2]. To this end, the author analyzes and calculates the power factor of the circuit under test based on voltage sampling, and displays the size of the power factor through the display circuit, and transmits the measured power factor over a long distance through the communication interface circuit. This not only simplifies the structure of the power factor measurement circuit, improves the measurement accuracy of the power factor, but also enhances the function of the power factor detection circuit.
2. Principle Analysis
The principle of detecting the power factor by extracting the voltage is shown in Figure 1 (a). First, three high-precision WB series digital AC voltage true RMS sensors are used to detect the power supply voltage U1 of the circuit under test, the voltage U2 across the additional adjustable resistor RP, and the load voltage U3. The function of the adjustable resistor RP is to make the additional resistance as small as possible to reduce the impact on the load under test, and to obtain a voltage U2 with an appropriate value to meet the requirements of power factor calculation. According to circuit theory [3], the phasor diagram of voltages U_1, U_2 and U_3 can be drawn as shown in Figure 1 (b), and COSφ is the power factor of the load under test.
Figure 1 Schematic diagram of voltage measurement principle and voltage phasor diagram
According to the cosine theorem in geometry,
From formula (2), we can know that the power factor COS? of the load can be obtained by calculating the voltages U1, U2, and U3. In order to reduce the hardware cost of the measurement circuit, the data processing and calculation are completed by the microcontroller software.
3. Single chip microcomputer input and output circuit design
The input and output circuit of the single-chip microcomputer mainly processes the voltage signal detected by the sensor, including signal conversion, calculation, storage, power factor display and data transmission. To this end, we designed a circuit composed of a single-chip microcomputer and related components as shown in Figure 2.
The voltage sensor detects the voltage, wherein the 1-3 terminal is used to detect the power supply voltage U1, the 1-2 terminal is used to detect the additional resistor voltage U2, and the 2-3 terminal is used to detect the load voltage U3.
The PIC16F877 microcontroller is one of the microcontrollers with the most integrated peripheral modules and the most powerful functions [4]. The microcontroller chip has an 8-channel, 10-bit resolution digital-to-analog converter ADC module and a 4K FLASH program memory. The RA port is a bidirectional I/O port with only 6 pins. It combines the A/D converter function on the basis of the basic input/output function. The port direction controller can define the port pin as input or output. RB and RC are 8-pin input/output programmable interfaces respectively. Each I/O port can provide or absorb 20mA current, can directly drive light-emitting diodes and solid-state relays, and has a watchdog circuit. It has the characteristics of simple external circuit structure, easy use and reliable performance. The power factor is directly output by the microcontroller through a 4-bit red high-brightness digital tube to display the power factor with a display accuracy of 0.001.
The three detection voltages are input to the microcontroller through the RA0, RA1, and RA2 pins of the input interface RA. The power factor is first converted into a digital signal through the A/D converter and saved, and the converted data is displayed in real time through the RC and RB interfaces. In addition, it can also communicate with the monitoring system through the serial interface to transmit the power factor of the line to the monitoring system in a timely manner. There are currently two commonly used serial communications [5], one is RS-232 serial communication, and the other is RS-485 serial communication. However, since the serial input and output interfaces of the PIC16F877 microcontroller are both TTL or CMOS levels, and the PC of the monitoring system usually uses the RS-232 standard external bus standard serial interface and uses negative logic, the serial input and output interface levels of the PIC16F877 microcontroller do not match and need to be converted. Here, the MAX232 chip is used to implement the level conversion function. The peripheral circuit of the MAX232 chip is simple, and only four 0.1μF capacitors are required.
4. Software design[6]
The main task of the software is to complete A/D conversion, data calculation, display and communication, etc. For convenience, the software is written in a modular structure. The main program mainly includes program initialization, subroutine calling, display, etc.
(1) A/D conversion subroutine
The subroutine mainly selects the A/D input channel and the A/D conversion clock; sets the A/D interrupt and opens the corresponding interrupt enable bit; waits for the required sampling time; starts the A/D; waits for the A/D to complete; reads the A/D conversion result and stores it in the specified storage unit.
(2) Digital filtering subroutine
In order to avoid the interference noise generated in the industrial field causing errors in the power factor measurement, digital filtering is added in the software design. Usually there are many digital filtering methods, and the median filtering method is used here. That is, the voltages U1, U2, and U3 are sampled 5 times continuously, and then these sampled values are sorted and the middle value is selected. This filtering method is more effective in filtering out pulse interference.
(3) Operation subroutine
First, the voltages U1, U2, and U3 after digital filtering are read in, and then the square operation is completed through the multiplication instruction to obtain U12, U22, and U32. Finally, after subtraction, multiplication, and division operations , the measured power factor is obtained.
The task of the communication subroutine is to complete the initialization of serial communication. The synchronous asynchronous receiving and transmitting module (USART) of the PIC16F877 microcontroller uses the RC6 and RC7 pins of the C port as a two-wire serial communication interface. In order to make the USART work in the sending and receiving states respectively, when programming, first set the bit 7 of the USART receiving status and control register and the bit 7 of the TRISC register to 1, and set the bit 6 of the TRISC register to 0. Secondly, to make the USART work in asynchronous communication mode, the sending and receiving rate, that is, the baud rate, must also be set. Finally, by setting the bit 4 of the sending status and control register TXSTA to "0", the USART works in asynchronous communication mode.
5. Test and result analysis
To verify the accuracy of online power factor measurement, the author built a test platform as shown in Figure 4. In the figure, COS? is a single-phase power factor meter with an accuracy level of 0.2. During the test, two different loads, incandescent lamps and electric fans, were used as measurement objects to carry out power factor measurement tests, and the experimental results were compared with the readings of the power factor meter.
Figure 4 Schematic diagram of the test circuit
S1 is the power switch, S2 is the transfer switch. When S2 is closed in the lower position, the direct reading of the power factor meter can be obtained; when S2 is closed in the upper position, the power factor measurement value of the online measurement circuit can be obtained. The test results and calculated values are shown in Table 1.
As shown in Table 1, the measured value obtained by the measurement circuit is very close to the reading of the power factor meter, indicating that the measurement circuit has good measurement accuracy. Incandescent lamps are pure resistive loads, while electric fans are inductive loads. The test shows that the power factor measurement circuit has good versatility and is suitable for both resistive loads and inductive loads.
5 Conclusion
The scheme of measuring power factor based on voltage sampling simplifies the structure of the power factor online detection circuit, reduces the cost, and improves the detection accuracy. In addition, this idea of detecting power factor also has good practical value, because in practice, voltmeters are more common than power factor meters. When there is no power factor meter at hand, the voltmeter can be used to measure the corresponding three voltages. The power factor of the load can also be calculated by formula (2), which solves the difficulty of not being able to measure the power factor without a power factor meter, and brings great convenience to the measurement of power factor. However, this measurement circuit also has shortcomings. When measuring, an additional adjustable resistor needs to be connected in series, so the measurement is not very convenient. In addition, it will affect the work of the load. Therefore, when using it, the resistance value should be adjusted as small as possible to obtain an appropriate voltage. Through experiments, we believe that the voltage can be adjusted to about 10V, which can meet the measurement requirements and will not cause too much impact on the load.
The author's innovation: By sampling the voltage of the circuit under test and calculating it, the power factor of the circuit under test can be obtained, which simplifies the structure of the power factor measurement circuit and improves the measurement accuracy of the power factor. It overcomes the traditional power factor measurement process that requires voltage and current detection, and then the voltage and current waveform transformation to obtain the voltage and current phase difference, and finally the power factor of the circuit under test can be obtained.
Previous article:Servo control of bionic robot fish based on PIC microcontroller
Next article:A Power Factor Online Detection Based on Single Chip Microcomputer Voltage Sampling
Recommended ReadingLatest update time:2024-11-16 22:47
- Popular Resources
- Popular amplifiers
- Microgrid Stability Analysis and Control Microgrid Modeling Stability Analysis and Control to Improve Power Distribution and Power Flow Control (
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- New Energy Vehicle Control System Inspection and Maintenance (Edited by Bao Pili)
- Intelligent Control Technology of Permanent Magnet Synchronous Motor (Written by Wang Jun)
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
- [Atria AT32WB415 Series Bluetooth BLE 5.0 MCU] Part 2: Preliminary understanding of hardware + Bluetooth control of light switches
- Characterization of Integrated RF Hardware in 5G Applications
- Giant microbit (giga:bit)
- Renesas CPK-RA6M4 Development Board Review + Unboxing and Building Environment
- Has anyone used the ionizing radiation sensor module? Discuss some technical issues
- RS-485 communication interface encoder
- FPGA Implementation of Fully Parallel FFT
- RT-Thread has been ported to W600
- MakeCode now supports STM103
- Please help me with the trip zone configuration of TI's 28034!!!