Smart test
Design Scheme of Relay Test System Based on LabVIEW
Abstract: This article introduces a design scheme of a relay test system. It is designed based on LabVIEW, which solves the problem of inaccurate measurement of small currents, reduces the error rate of relay testing, accurate measurement data, convenient use, and completely intelligent testing. Effectively improve work efficiency.
1 Introduction
Relay is one of the key components of automatic control system, remote control and telemetry system and communication system. It is widely used in aviation, aerospace, electronics, communication, machinery and other equipment. The reliability of relay directly affects the equipment and system composed of it. Reliability, relay testing is an important technology to ensure its reliability.
There are many relay test systems in China, but most of them are not perfect. The manual test system is complicated to operate, easily affected by subjective factors, and the test results have large errors:
Other test systems have single functions, poor flexibility, long development cycles and difficult maintenance. These test systems are difficult to accurately measure ultra-small currents, and cannot accurately measure the state of multiple sets of relays. The relay has a high rate of misjudgment and is not reliable enough.
This system adopts Lab-VIEW8.5 software released by NI, and realizes automatic testing and data acquisition of relays through the control of Advantech's function boards. The system eliminates the influence of human subjective factors, and the high-resolution Advantech function board also greatly improves the accuracy of the test results; the measurement of ultra-small currents uses Hall current sensors to measure, which solves the test problems of small currents; special The circuit design can detect the quality of multiple sets of contacts of the relay, which reduces the false judgment rate of the relay: the test data is automatically stored in the corresponding data table of the database, and there is no need to manually record the test data, which liberates the experimenter from the complicated and tedious test. Come out, save working time and improve work efficiency.
2. Design scheme of relay integrated test system
The design scheme of the relay integrated test system introduced in this article solves the problems of two major types of relays-voltage relay and time relay testing and the storage of test data. The parameters to be tested for voltage relays mainly include suction table voltage, release voltage, current consumption, and coil resistance; test parameters for time relays include on-delay time, hold time, and off-delay time.
2.1 Test plan for pull-in/release voltage
The system uses LabVIEW software to control Advantech's function boards. The programmable voltage source is controlled by the Advantech function board to make it output voltage, and this voltage is sent to the coil of the relay under test. Gradually increase or decrease the output voltage, while monitoring the normally open and normally closed contact status of the relay. When the contact status of the product changes, read the voltage value of the programmable voltage source voltage read-back port at this time, that is, the measured suction On/off voltage.
2.2 Test plan for current consumption/coil resistance
When supplying 27 volts to the relay, use the Hall current sensor to measure the current consumption, and the measurement result is directly read by the Advantech function board; when measuring the coil resistance, first measure the coil current, and then use the formula R=U/I to get the coil resistance value .
2.3 Test plan for delay time
Using the counter 0 on the Advantech function board to output a series of square waves, read the number of high and low levels of the square wave signal through software, and read the count value of the counter when the relay state changes, and calculate the delay time.
2.4 Data processing plan
Use the ActiveX automation function of LabVIEW to store the test data in the Access database, and use the LabVIEW toolkit LabSQL to access the data.
3. The hardware design of the relay integrated test system
3.1 Hardware system composition
The hardware system of the system is composed of Advantech industrial computer, Advantech function board, Chaoyang power supply, test interface box and Hall sensor.
3.1.1 Advantech Industrial Computer
Industrial PC is the system control and data processing center. The industrial computer adopts a 4U high 14-slot rack-mounted industrial machine, a universal 14-slot passive bottom plate, 4 PCI, 8 ISA, cooling fan, front-end wiring USB and PS/2 keyboard, I/O interface Various external devices can be connected. It has the characteristics of stability, scalability and strong heat dissipation.
3.1.2 Advantech Function Board
Advantech PCI-1716 board is used to collect and process the signal of the product under test. It is a powerful high-resolution, multi-functional PCI data acquisition card. In the system, we use the analog output terminal of PCI-1716 to output a voltage value to control the programmable voltage source, and send the back-tested voltage value and current value of the programmable voltage source to the analog input terminal and A/D converter of PCI-1716: The state of the product contact is read in the PCI-1716 digital input terminal, and all the delay time is completed by the counter in the PCl-1716. The PCI-1716 board has the following characteristics:
·The PCI bus master performs data transmission.
·16 single-ended or 8 differential A/D inputs.
·16-bit A/D converter, sampling rate up to 250KS/S.
·The gain of each channel is programmable.
·Used for onboard sampling FIFO buffer. IK sampling rate.
·16-bit digital input and 16-bit digital output.
·Two 16-bit D/A outputs.
·Onboard programmable counter/timer. One of the counters is used as an event counter to count the events or pulse triggers of the input channel, and the other two are cascaded together to be used as 32-bit timers when the pulse is triggered.
·Automatic channel/gain scanning. The user sets the corresponding gain value for each channel according to the needs of the input voltage range.
3.1.3 Chaoyang Power
In the system, we use the voltage output terminal of Chaoyang Programmable Power Supply to power the relay, and read the voltage data from its voltage feedback terminal. It can provide 0~35V, 10A wide voltage and high current. It has the characteristics of remote control, voltage and current back-testing, overvoltage and overcurrent protection with preset voltage and current protection values, and also has automatic and manual adjustment functions.
3.1.4 Test interface box
The product socket box is the interface part. When testing the product, you only need to insert the product directly into the corresponding product socket of the corresponding model. No additional wiring is required. After the test is completed, the product can be removed. The socket box is also equipped with a relay. Contact status (normally open, normally closed) indicator lights, and a set of relay contact terminals, including normally open, normally closed, middle knife, coil +, coil -, for relays without proprietary sockets, these can be passed The binding posts are connected with the relay to complete the test, and these binding posts are also used for calibration.
3.1.5 Hall sensor
If the current consumption of the coil of the tested product is below 50 mA, the current range of the programmable power supply is too large, and the small current signal cannot be accurately measured, so the Hall current sensor is used as the small current measurement. This system uses a Hall current sensor with an input current range of 0-200mA and an output of 0-5v.
The working principle of the Hall current sensor is: when the primary side wire passes through the current sensor, the primary side current Ip will produce magnetic velvet. The primary side magnetic field lines are concentrated around the magnetic core air gap, and the Hall power is built into the magnetic core air gap. The chip can generate an induced voltage proportional to the magnetic field lines of the primary side and the magnitude is only a few millivolts. This tiny signal can be converted into the secondary side current Is through the subsequent electronic circuit, and there is the following relationship: Is*Ns=Ip* Np. Among them, Np-the number of turns of the primary coil: Ns-the number of turns of the secondary coil, generally Np=1. The output signal of the current sensor is the secondary current Is, and the output current passes through the measuring resistance Rm, and you can get a Compared with other detection current components, the Hall current sensor has the characteristics of non-contact, long life, high precision, small size, light weight, good linearity, and fast response.
The principle block diagram of the test system is shown in Figure 1.
3.2 Circuit Design
Figure 2 shows the circuit schematic diagram of the relay integrated test system.
As shown in Figure 2: The middle knife of the tested relay is connected to the digital ground terminal of the PCI-1716 board, and the normally open contact (CK) and normally closed contact (CB) are connected to the digital input terminal of the board. Relays with only one set of contacts can be directly tested by this method, but most relays generally have two or more than two sets of contacts. In order to avoid judging a relay with a certain set of contacts as qualified, this test system uses The circuit connection method shown in Figure 3.
This circuit is the connection circuit of two sets of contact relays.
Connect the middle blades of the two sets of relay contacts in series, and connect the normally closed contacts of one group with the normally open contacts of the other group as the middle blade, which is connected to the DGND terminal of the Advantech board. The remaining normally closed and normally open contacts are connected to the digital input terminals of the Advantech board and the light-emitting diodes, as the basis and instructions for judging the status of the relay contacts. When the power supply supplies power to the coil and reaches the relay-on state, the normally open contact is connected to the middle knife and pulled to a low level, while the normally closed contact is disconnected from the middle knife, and the potential rises (Advantech board number When the input terminal is floating, it is high level). If one group of contacts is damaged and cannot be converted, both the middle knife and the normally open and normally closed contacts of the relay are disconnected, and the relay judges that it is not connected, so that all the two groups of relay contacts are detected. The principle of the relay of more than two sets of contacts is the same. The two sets of contact connection circuits of the relay can be regarded as one of the set of contacts and the following set of contacts are also composed of a relay with only "two sets of contacts", and so on, until A set of contacts. During the test, as long as one of the contacts is damaged, the state of the relay will not change, and the relay can be judged as unqualified. This method has been tested in practice and has greatly reduced the false positive rate of the relay test.
The wiring ports of the programmable voltage source are integrated in the DB9 interface except for the voltage output, including voltage regulation, voltage feedback signal, current feedback signal, output switch, current TTL and other ports. The test system connects the voltage output terminal of the programmable voltage source to the coil of the relay, and connects the voltage signal conditioning terminal to the analog output and analog ground of the Advantech PCI-1716 board; the voltage feedback terminal is sent to the analog input channel of the PCI-1716, and the output switch The terminal is connected with the digital output channel of PCl-1716. The system controls the output voltage of the programmable voltage source by controlling the Advantech PC-1716 board to output a voltage value. The voltage feedback terminal of the programmable power supply reads the voltage when the relay is turned on or off, and realizes the control of the output of the programmable voltage source through the control of the digital port.
Pass the positive end of the relay coil according to the current direction marked by the Hall sensor, and connect the output terminal “M” of the Hall sensor directly to the analog input terminal of the PCI-1716 board. During the test, read the current consumption of the relay from this terminal. Out.
The measurement of the delay relay is carried out using the timer/counter 82C53 that comes with the PCI-1716, so that the counter 0 works in the square wave rate generator mode, and the output of the counter 0 is connected to the digital input of the PCI-1716 and read by software The number of occurrences of this square wave is added to the reading of counter 0 to measure time.
4. The software design of the relay test system
The design of the test program is based on the LabVIEW driver functions provided by Advantech's board. First, the commonly used functions are packaged into subvi. It is easy to call during programming, which not only simplifies the program sequence, but also saves programming time. Commonly used driver functions are DeviceOpen.vi (open the device specified by the device number); DeviceClose.vi (close the device): DioWritePortByte.vi (write data to the specified digital port); DIOReadPortByte.Vi (read data from the specified teaching port )Wait. Commonly used files after packaging have read contact status. vi, power switch. vi, input voltage. vi etc.
The program flow chart is shown in Figure 4:
During the test, the voltage and current measurement results are collected multiple times and averaged to ensure the accuracy of the measurement results. At the same time, in the test method, the delay is appropriately increased to eliminate jitter factors to ensure the reliability of the measurement.
5 Conclusion
The design scheme of the relay test system based on LabVIEW has been verified by multiple devices. Because of its friendly system interface, simple operation, convenient maintenance, stable measurement, and strong scalability, it has solved two major types of relays-voltage relays. The test of the box time relay and the storage of test data have high practical application value. (Author: Guan Huayun, He Ping)