A Power Factor Online Detection Based on Single Chip Microcomputer Voltage Sampling

Publisher:GoldenDreamLatest update time:2010-07-27 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:A Power Factor Online Detection Based on Single Chip Microcomputer Voltage Sampling

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

The reading of the AC voltage block is very small or only about 1/2 of the normal value.
This phenomenon indicates that the rectifier of the AC circuit is broken down or partially broken down, completely losing its rectification function or becoming half-wave rectification. At this time, the rectifier should be replaced.
[Test Measurement]
Supply voltage monitoring and sequencing for high reliability systems
introduction For most electronic systems, monitoring system voltages with a power-on reset (POR) circuit ensures proper power-up initialization. In addition, monitoring voltage drops with a POR can minimize code execution problems that could cause memory to become unreliable or cause the system to not operate
[Power Management]
Supply voltage monitoring and sequencing for high reliability systems
51 microcontroller learning: ADC analog-to-digital conversion experiment-potentiometer voltage collection
Experiment name: ADC analog-to-digital conversion experiment - potentiometer voltage collection wiring instructions: Experimental phenomenon: After downloading the program, the digital tube displays the voltage value of the AD module collection potentiometer. Notes: *********** ****************************************
[Microcontroller]
MAX9672/MAX9673/MAX9674 Voltage Reference Programmable Gamma Reference System
The MAX9672/MAX9673/MAX9674 output 12/14/16 voltage references for gamma calibration of TFT LCDs, plus a voltage reference for VCOM. Each gamma reference has a 10-bit DAC and buffer to ensure voltage stability. The VCOM reference has a 10-bit DAC and an amplifier to ensure voltage stability when displaying critical lev
[Power Management]
A brief discussion on how to achieve switching frequency control, load and line voltage optimization
   Introduction   Environmental considerations have driven new efficiency requirements for contemporary power supply designs. For example, the 80 PLUS initiative and its bronze, silver, and gold derivatives (see reference ) have forced desktop and server manufacturers to seek innovative solutions. One focus has been
[Power Management]
A brief discussion on how to achieve switching frequency control, load and line voltage optimization
Switching power supply product quality design lecture: Overcoming voltage surge and current surge difficulties
  In order to prevent the distributed inductance and capacitance of the high-speed switching circuit in the switching power supply system from generating surge voltage and noise under the influence of the diode accumulated charge, the paper adopts RC or LC absorption circuit to absorb the surge voltage generated by th
[Power Management]
Switching power supply product quality design lecture: Overcoming voltage surge and current surge difficulties
STSTEVAL-ISV002V23kW Photovoltaic Voltage Conversion Solution
The STEVAL-ISV002V2 demonstration board implements a conversion system for PV applications with the aim of achieving high efficiency and significant reduction in production costs. It consists of a high-frequency isolated input power section which performs the control and control of the MPPT algorithm . DC-DC co
[Power Management]
STSTEVAL-ISV002V23kW Photovoltaic Voltage Conversion Solution
Voltage sag control schematic diagram
The DC DVR device with supercapacitor energy storage combines a bidirectional half-bridge DC-DC converter with a supercapacitor to control the charging and discharging of the supercapacitor through a dual closed-loop method. When a voltage sag occurs in the system, the DC bus voltage supporting the sensitive load is u
[Power Management]
Voltage sag control schematic diagram
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号