Design of Power Fault Monitoring Recorder Based on DSP and LabWindows/CVI

Publisher:谁与争锋1Latest update time:2011-07-02 Keywords:TMS320F28335  LabWindows  CVI  AD7656  FFT  C8051F005 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction
Fault recorder is an important automatic device to improve the safe operation of power system. When the power system fails or oscillates, it can automatically record the changes of various electrical quantities within a certain time before and after the fault point. The fault recorder designed in the reference adopts the method of combining virtual software with data acquisition card. Its disadvantage is that it must rely on computer for calculation and analysis, which makes the equipment inconvenient to move,
and the price of data acquisition card is relatively high, which makes the product application have certain limitations. The reference design is a fault recorder based on the combination of DSP and A/D converter. The A/D converter used cannot synchronously convert 6-channel signals, and there is a certain delay between the measured results. In view of the above shortcomings, the method of combining DSP and AD7656 is now adopted. The waveform and data are displayed by an external LCD, so that it can be used as a handheld device, and it can also be connected to a computer to display in real time on the computer through LabWindows/CVI software. The 6-channel synchronous sampling characteristics of the AD7656 used overcome the disadvantage of delay between measurement results and improve the measurement accuracy.

1 Operation principle and related algorithms
Combining various performance indicators proposed previously, the fault recorder adopts a design method combining hardware and software. The high-speed data acquisition device uses DSP-TMS320F28335 as the core, uses TBC-LXH dual-loop series closed-loop Hall current sensor and CHV-25P Hall voltage sensor to collect signals, and uses high-performance AD7656 to complete the A/D conversion of the signal, uses LCD for waveform display and uses LabWindows/CVI software for control. The addition of LCD to this device is mainly considered to be able to display voltage and current waveforms without a computer, which is convenient for operation.

16a.jpg
This device consists of three parts: detection part, calculation part, and host computer control part. The system block diagram is shown in Figure 1. The system operation is as follows: First, the voltage and current of the power grid are filtered out by filters to remove high-frequency interference and low-frequency drift signals. Then, the voltage and current sensors of the detection part detect the basic parameters of the power grid such as three-phase voltage and current in real time, and the measured 6-channel analog quantity is transmitted to AD7656; TMS320F28335 controls AD7656 to convert the 6-channel analog quantity into digital quantity, and DSP uses FFT algorithm to analyze the digital quantity of voltage and current, extracts the fundamental wave and each harmonic component, and calculates the active power, reactive power and THD value, and then transmits it to C8051F005 microcontroller and terminal computer; the keyboard connected to the microcontroller controls LCD to display waveforms, and the computer uses LabWindows/CVI software to display, store and print waveform data.
This harmonic analysis method adopts fast Fourier transform (FFT). Its implementation method in DSP uses the library function that creates FFT for calculation. The specific implementation method is introduced in detail in the software part.

2 System Hardware Design
The core of this device uses TMS320F28335 and AD7656 devices. The collected signals can communicate with the computer through the RS-485 serial port after DSP operation.
2.1 TMS320F28335 and peripheral circuits
2.1.1 Reset circuit design
The reset circuit of TMS320F28335 uses a power-on reset circuit, and the power supply device gives a reset signal. Once the power is turned on, the system is in a reset state. When XRS is low, the DSP is reset. In order to initialize the DSP correctly, XRS should be kept at a low level and maintained for at least 3 CLKOUT cycles. At the same time, after power-on, the crystal oscillator of the system generally requires a stabilization period of 100 to 200 ms. Once the selected power supply device TPS73HD301 is powered on, its output voltage closely follows the input voltage. When the output voltage reaches the minimum voltage to start RESET (1.5 V at 25°C), the pin RESET outputs a low level and maintains it for at least 200 ms, thus meeting the reset requirement.
2.1.2 Clock circuit design
There are generally two ways to provide clock to DSP: one is to use the crystal oscillator circuit provided inside the DSP, that is, to connect a crystal between the X1 and X2 pins of the DSP to start the internal oscillator; the other method is to directly input the external clock source into the X2/CLKIN pin, leaving X1 floating, and using a packaged crystal oscillator. Considering the resource utilization and simplicity of circuit design, the clock circuit of this minimum application system uses the internal crystal oscillator of TMS320F28335. The specific circuit is shown in Figure 2. The operating frequency of the external crystal oscillator is 30 MHz. TMS320F28335 has a programmable phase-locked loop inside, which the user can program according to the required system clock frequency.

16b.jpg


2.1.3 Power supply circuit design
The power supply requirement of DSP is to supply power to its core and I/O separately. The power supply device TPS73HD301 is used to power DSP. The core power supply voltage is 1.9 V and the I/O port power supply voltage is 3.3 V. [page]

2.2 AD7656 and peripheral circuits
In the power supply design of AD7656, AVcc and DVcc are the analog voltage input and digital voltage input of AD7656. As a 6-channel independent synchronous sampling data converter, AD7656 requires sufficient power during the conversion process, so the decoupling of AVcc is very important in the design. In the actual circuit design, +15 V (or +12 V) voltage can be provided to the Vdd and Vss power input terminals separately, and +5 V can be provided to the AVcc analog voltage terminal at the same time. Connect AVcc to DVcc through a filter (small resistor or magnetic bead). Then supply the system with +5 V power through the filter.
The RANGE of AD7656 is grounded, and the input voltage range is 4 times the reference voltage. The H/S pin and SER/PAR are both grounded to start the hardware control conversion input mode, and the sampling is controlled by the CONVSTA/B/C pin. Among them, REFCAP_A, REFCAP_B and REFCAP_C are all grounded to control the input to be converted in pairs.
2.3 Overall hardware design of the system
2.3.1 Connection between AD7656 and the detection part
The sensors of the detection part use TBC~LxH dual-loop series closed-loop Hall current sensor and CHV-25P Hall voltage sensor. The rated measurement range of the current sensor is 0~150 A, the response time is less than 20μs, and the temperature drift is small; the voltage sensor measurement range is 0~500 V, the response time is less than 10μs, and the linearity is good. Because the input voltage and current have high-order harmonics and noise signals, a pre-filter device is required for anti-aliasing filtering. In addition, in order to meet the 16-bit accuracy requirements of AD7656, the front end should use a high-precision operational amplifier that can handle 10 V bipolar signals for signal processing and filtering. This operational amplifier uses AD8022, as shown in Figure 3. INl is the input end of the initial analog signal, which is transmitted to AD7656 after passing through AD8022. The three-phase voltage and current are connected in the same way.

16c.jpg


2.3.2 DSP and AD7656
The connection between AD7656 and DSP is shown in Figure 4. ADCINA and ADCINB of DSP are multiplexed as I/O ports, connected to D0~D15 data ports of AD7656 for data transmission. GPIOB59 of DSP is connected to BUSY of AD7656 to detect whether AD7656 is in conversion state. GPIOB60 of DSP is connected to CONVST of AD7656, and GPIOB62 is connected to chip select port of AD7656 to control the start and stop of AD7656. GPIOB61 is connected to read and write port of AD7656 to control the reading of converted data of AD7656. GPIOB63 is connected to RST port of AD7656 to control the reset of AD7656. ISSl61LV6416 is an off-chip random access memory.

16d.jpg


2.3.3 Connection between DSP, MCU and computer
DSP's SCIB communicates with computer via serial port. Because: RS-232 has weak anti-interference ability, RS-485 is selected as the communication serial port, and then converted to a level suitable for the computer through a conversion chip. DSP's SCIC serial port is connected to F005 MCU PO. 0 and PO. 1 ports. Its transmission baud rate is set to 9600 b/s.
2.3.4 Connection between DSP and external memory
The extended data memory uses SST25VF040 from SST. SST25VF040 is a serial flash memory with SPI interface of the company. It is a low-power Flash with a storage capacity of 4 MB and works at a voltage of 2.7 to 3.6 V, so it can be directly connected to DSP. Its connection diagram is shown in Figure 5. The receiving and transmitting ends of the SPIA port of DSP are connected to its SI and SO ports for data transmission. GIPIO26 and GIP1027 are used to control the chip selection and reading and writing of the memory respectively.

16e.jpg


2.3.5 Connection between C8051F005, LOD and keyboard
In order to make the fault recorder convenient for mobile use, the method of connecting the F005 single-chip microcomputer of Xinhualong Company to LCD and keyboard for control is adopted. The operation of the fault recorder can be controlled by an external keyboard without a computer. P1.0~P1.7 of F005 is connected to the 8 keys K1~K8 of the external keyboard, which can control the display of 6 kinds of waveforms, set the upper and lower limits of fault records, etc. The LCD uses 240128 E model liquid crystal, P2.0~P2.7 of F005 is connected to DBO~DB7 of LCD for data transmission, and P3.0 and P3.1 are connected to the read-write port of LCD.

3 System software design
The software design includes LabWindows/CVI software program and DSP control A/D conversion program, as well as the program for extracting the fundamental component and each harmonic component using FFT transformation.
3.1 Overall process
The following is a flowchart to explain the software design. As shown in Figure 6, the serial port setting is completed by setting the serial port of the control interface, and the system starts running after the setting is successful.

16f.jpg

[page]

16g.jpg


As shown in Figure 7, there is a button for selecting the time of automatic fault recording on the interface. If 2s is set, the waveform of 4s before and after the fault will be stored. The waveform selection button can be used to select the waveform to be displayed. If the A-phase current is selected, its waveform and harmonic data can be displayed (if the computer is not connected, the relevant values ​​can be set by an external keyboard). When the DSP starts running, the system is initialized, the sensor starts to detect the voltage and current, and the detected analog signal is converted into a 16-bit digital signal by A/D. The DSP performs FFT operation to analyze the harmonic components and calculate the THD value. The calculated maximum value of the fundamental wave is compared with the set standard value. When it is greater than or less than the set value, the alarm device is triggered. After that, the measured data is transmitted to the control interface and single-chip microcomputer of the computer through the serial port. The control interface displays the measured waveform and data, and the fault waveform and data can be saved. The single-chip microcomputer controls the LCD for display. The experimental result in Figure 7 is the A-phase current waveform, which displays the fundamental wave and harmonic values ​​of the A-phase current, and calculates the THD value.
3.2 LabWindows/CVI Partial Program
When the system is running, first configure the serial port, send the current or voltage of a certain phase to be displayed to the serial port, and the DSP will transmit it to the computer according to the instruction requirements. The software interface will display the waveform and its effective value, and can store and print according to the situation. The following functions:

16h.jpg

3.3 Implementation of FFT transformation and calculation of THD value
DSP can perform floating-point operations, and its calibration can realize accurate calculation of values. Calibration simply means converting a decimal into an integer and then performing the operation, which reduces the calculation error. For example, a decimal is 1.123 456 789, and there can be several decimal places after it. If calculated directly, part of the value after the decimal point will be discarded in the operation, which will increase the error. If calibration operation is used, 1.123 456 789 can be converted into an integer 1.123 456 789×225 (select Q25 calibration) and then perform the operation, which will make the calculation result error smaller than before. This is a major advantage of DSP operation, and its operation speed is fast. When using FFT operation, the sampling harmonic frequency can reach as many as 31 times.
DSP initialization program:

16i.jpg

16j.jpg
The command signal of a certain phase voltage or current to be displayed can be sent through the control interface, or the signal waveform to be displayed can be sent through the keyboard. DSP triggers A/D conversion by judging the received interrupt flag and command signal. The interrupt command is as follows:

16l.jpg

Keywords:TMS320F28335  LabWindows  CVI  AD7656  FFT  C8051F005 Reference address:Design of Power Fault Monitoring Recorder Based on DSP and LabWindows/CVI

Previous article:Characteristic Analysis of Wireless Spectrum Analyzer
Next article:Fading performance testing of receivers in mobile devices

Recommended ReadingLatest update time:2024-11-16 17:52

Design of PZT driving circuit based on C8051F005 single chip microcomputer
1 Introduction In the adaptive optical synthetic aperture imaging system, when the original signal phase information of a certain aperture channel changes due to factors such as atmosphere and carrier vibration, the redundant information will reflect the change information of the two channels. The information u
[Microcontroller]
Design of PZT driving circuit based on C8051F005 single chip microcomputer
Latest Test Measurement Articles
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号