1 Introduction
In the power system, voltage and frequency are two important parameters that reflect the power quality of the power system. At the same time, in the relay protection industry, voltage and frequency are also important criteria for corresponding actions of relay protection, measurement and control, synchronized closing and other devices. In power systems, generally in order to save frequency measurement loops, frequency measurement has traditionally used the sampling instantaneous value of voltage to calculate frequency [2] [3] . This method has limited sampling accuracy and harmonics, although various methods are used. Despite this compensation measure, the actual measurement accuracy still cannot meet the requirements of devices that use frequency or frequency difference as action criteria, such as automatic synchronization. Voltage calculations traditionally use the Fourier algorithm. The Fourier algorithm has the advantage of separating the fundamental wave and each harmonic component, and can obtain the size of each component, so it has been widely used. However, the correlation coefficient in this algorithm is fixed, and when the frequency of the measured signal changes, it will bring about larger measurement errors. For this situation, there is a method of using a phase-locked frequency multiplier sampling trigger circuit [4][5] to ensure that the same number of sampling points is obtained in each signal period and improve the calculation accuracy. However, at the same time, this specialized phase-locked multiplier The frequency sampling trigger circuit increases the design cost and debugging difficulty. This article proposes a method to measure the frequency of signals using the HIS (High Speed Input) of 80C196. The measurement accuracy is high. The voltage sampling frequency is changed accordingly based on the measured frequency to achieve frequency tracking and greatly improve the voltage calculation. Accuracy. This method not only simplifies the circuit design, but also improves the voltage calculation accuracy while obtaining high-precision frequency measurement. 2 Hardware design 2.1 Hardware composition In the power system, the three-phase voltage frequencies are the same, and any one of the phases can be selected as the frequency measurement signal. The hardware structure is shown in Figure 1.
Frequency measurement signals require filtering and shaping circuits. Filtering is to filter out harmonics and ripples and provide better detection signals for shaping. The shaping circuit converts the filtered sinusoidal signal into a square wave signal. Voltage measurements do not require filtering in order to retain more waveform information.
2.2 Filtering and shaping circuit
Because measuring frequency only requires periodic signals without phase information, the shaping circuit does not require zero-crossing detection. Taking this into account, the shaping circuit is more convenient to implement. In the actual design, in order to simplify the circuit, the filter circuit and shaping circuit functions are completed by an integrated chip MC1489. MC1489 is a monolithic integrated four-channel level converter, each of which can achieve shaping function, and an external capacitor plays a filtering role. The circuit is shown in Figure 2.
3 Software implementation
3.1 Frequency measurement principle and error analysis
Using HSI events to implement frequency measurement is actually a method of measuring the cycle. For the 80C196 microcontroller, that is, within the triggering time, the signal cycle is counted every 8 crystal oscillator cycles. When the crystal oscillation frequency is 20 MHz, the internal crystal oscillator period is 0.1 μs (because the internal frequency division is divided by 2), and it counts every 0.8 μs. It can be seen from this that the absolute maximum error of measurement is 1.6 μs for the front and rear boundaries of the signal. For a 50 Hz signal with a period of 20 ms, the maximum error is converted to a frequency of about 0.004 Hz. Therefore, the frequency measurement accuracy can reach 0 .01 Hz. When the crystal oscillation frequency is higher or the period of the measured signal is longer, the relative error will be smaller.
3.2 Implementation idea of frequency measurement
HSI events can be read in interrupt mode and query mode. Because the sampling interrupt interval needs to be changed while measuring frequency, it is more convenient and concise to implement it in query mode during sampling interrupt.
In query mode, HSI events are mainly realized by configuring or reading the contents of registers IOC0, HSI MODE, IOS1, HSI STATUS and HSI TIME. IOC0 is used for event pin selection. There are four trigger modes for external events input by the HSI pin, namely negative transition trigger, positive transition trigger, positive and negative transition trigger, and every 8 positive transition triggers. Each trigger mode is set through HSI MODE. IOS1 records the information about whether the register data saved by the HSI component is valid. HSI STATUS stores two types of information for each input pin. One is to indicate whether an event occurs on the pin, and the other is to record the current level status of the pin. HSI TIME stores the time value of the event stored in the holding register [1] .
It is assumed that HSI only uses HSI. 0. During initialization, set IOC0 to 01H and select HSI. 0 is the event input pin. Set the HSI MODE register to 01H, that is, each positive transition becomes an event trigger mode. To read the time value in the sampling interrupt, first query IOS1.7. If this bit is 1, it means that the holding register has been loaded and the HSI event can be read. Read the HSI STATUS and HSI TIME registers and process them.
3.3 Frequency calculation and sampling tracking
For the sake of clarity, the frequency measurement and frequency tracking program source code is given here. This program adds the function of preventing sampling errors caused by errors in the frequency measurement loop.
Among them, t — freq, tcy, tcy+2, ltcy, iosl — map, freq — err, freq are the defined general registers of 80C196, SH — Point, Tcy — Normal are the prescribed constants, which are the number of sampling points in a week and HSI normal count value at 50Hz. t — freq is the frequency measurement count, which represents the actual count value of HIS within the trigger time. In applications, the count can be divided by different values according to different measurement accuracy requirements to obtain the frequency value. For a 50 Hz signal, the count in one cycle is theoretically 25 000. Divide this value by 125 000000 (Constant freqhl) to get the fixed-point operation value freq of frequency measurement with a measurement accuracy of 0.01Hz (as above) shown in the program).
4. Tracking Capability Analysis
From the above frequency tracking implementation process, when the signal frequency is stable at a certain frequency, HSI will generate a data valid event as long as one cycle of the signal passes, and the sampling frequency can track the signal frequency, thereby improving Voltage calculation accuracy. For signals that change frequency with a certain slip, there is a real-time problem of sampling and tracking. It can be known from the experiment that when frequency tracking is not implemented, when the deviation of the signal frequency from the 50 Hz reference frequency is less than 0.5 Hz, the voltage calculation accuracy is still high and can meet the behavioral needs of each device. To increase computational redundancy, it can be limited to 0.3 Hz. Because the frequency tracking of this algorithm is that the signal is tracked once a week, for the power system, that is, it is tracked once every 20 ms. Therefore, as long as the slip is less than 0.3Hz/20ms=15Hz/s, the voltage sampling can track the signal frequency without affect calculation accuracy. In fact, the frequency slip of 15Hz/s does not exist at all in the power system. Therefore, this algorithm is feasible. 5. The impact of frequency tracking on voltage calculation and conclusion. The author used an 80C196, 12-bit A/D microcontroller system to program a 12-point weekly sampling calculation simulation test for a 50 Hz, 100 V voltage signal. When the signal frequency When the deviation from 50 Hz is large, using the sampling frequency to track the signal frequency has higher accuracy than the voltage calculation without this method. By observing the real-time display data, the calculation and comparison diagram of the two when the frequency is 55 Hz is shown in Figure 3.
In addition, for signals whose frequency continuously changes with a certain slip, the voltage calculation still has high accuracy because the sampling frequency has a real-time tracking function.
The frequency measurement method proposed in this article has simple software and hardware implementation and high measurement accuracy. The sampling frequency tracks the signal frequency, making the sampled values better suited to the Fourier algorithm, thereby improving voltage calculation accuracy. It is suitable for high-precision frequency and voltage measurements in various relay protection devices in power systems.
1 Wang Jian, Sun Kaikai, Zhang Shuhan. MCS-96 series microcontroller principle and application technology. Wuhan: Huazhong University of Science and Technology Press, 1999
2 Suonanjiale, Ge Yaozhong, Wang Ding'an, et al. A new frequency measurement method that is not affected by voltage zero crossing. Journal of Electric Power Systems and Automation, 1996, 8(4): 19~21
3 Li Ruisheng. A method for calculating power system frequency based on digital sampling. Relay, 1997, 25(1): 26~28
4 Du Guangyu, Chen Xiaoqiao, Wan Zhongtian. Application of phase-locked frequency multiplication and quasi-synchronous sampling methods in harmonic measurement. Journal of Wuhan University (Engineering Edition), 2001, 34(5): 39~44
5 Chen Zhenhui, Cai Canyong, Yan Kai, et al. Phase-locked loop frequency multiplier software implementation and application in power harmonic parameter detection system. Electronic Measurement Technology, 2001(4)
Previous article:Frequency measurement based on 80C196 and its application in voltage sampling
Next article:Application of single chip microcomputer in micro printer
Recommended ReadingLatest update time:2024-11-16 18:08
- 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
- Let's publish an original hydrology article "L-band small PA"
- Adafruit LIS2MDL Triple Axis Magnetometer Manual with Code
- PS2 Interface.pdf
- TDC - Time to Digital Converter
- How to locate the pins of LCD display?
- Problems with the amplifier analog signal output circuit
- TI bidirectional DC-DC converter solution
- Senior Electronic Engineer (FPGA) Recruitment
- Should I choose a slow-blow or fast-blow fuse for the power module?
- Join [Micron VIP] and win a 200 yuan JD card!