Application of National Instruments LabVIEW and Common Data Acquisition Card in Servo Motor Parameter Test
- 2020-06-24-

LabVIEW is a laboratory virtual instrument integrated environment (Laboratory Virtual Instrument Engineering Workbench) based on graphics compilation language (G language) developed by National Instruments (NI).

LabVIEW has a large number of functions for data acquisition, which is convenient for developers to develop [1]. NI Company sells its own data acquisition boards while making software, but the price of data acquisition cards produced by NI Company is relatively high, which is obviously not affordable for small and medium-sized projects. Although ordinary data acquisition cards are not as convenient as NI data cards in use, most data acquisition cards come with LabVIEW library functions. Due to the existence of these library functions, for program developers, there is no need to develop low-level functions, and use Convenience. This test system uses the USB_DAQV1.2 data acquisition card produced by Hengkai Technology Company. The data acquisition card not only provides library functions such as VC++, VB, but also LabVIEW library functions[2-3].

The test system consists of servo motors, servo drives, industrial computers, data acquisition cards and other related components. The structure of the test system is shown in Figure 1.

As can be seen from the structure diagram, the test system is mainly composed of an industrial computer installed with host computer software, a controller responsible for motor movement, a USB_DAQ V1.2 data acquisition card responsible for data acquisition, and the research object servo drive and servo motor . The execution sequence of the entire control system is: the controller sends corresponding instructions to the servo drive, the servo drive drives the servo motor to move, and there are corresponding I/O output ports on the servo drive. These I/O output ports can output the corresponding speed and current. Wait for the analog quantity, connect these analog quantities to the analog input interface of the corresponding data acquisition card of USB_DAQ V1.2, write the corresponding LabVIEW program in the upper computer, and display the speed and current of the motor in real time through the waveform display window. This real-time display can understand the working characteristics of the motor and provide a corresponding basis for the improvement of the control system.

1 Hardware access

Due to the particularity of the servo drive, the signal tested by this test system is output by the corresponding I/O port of the servo drive. The test system uses a Panasonic servo drive. For the corresponding settings, please refer to the servo drive manual. By setting the corresponding I/O, the corresponding I/O connection of the servo drive can use twisted-pair shielded cables and differential inputs. Method, the PC output port is set as the output of speed and current. For differential input, AI0 and AI8, AI1 and AI9 form a group, and the rest can be deduced by analogy. The shield wire is connected to AGND.

2 Software writing

After installing the USB_DAQ V1.2 data acquisition card, you also need to install the USB_DAQ V1.2 data acquisition card driver. According to the different systems installed on the computer, choose different versions of the driver to install. On the premise that the hardware is connected and the driver is installed successfully, the software of the host computer can be written. In the process of writing the upper computer software, data collection is carried out according to the non-empty query mode, and the data collection flow chart of the non-empty query mode is shown in Figure 3.

3 Application of the test system in a certain rotating table

With the development of industry, rotary tables are becoming more and more common in industrial applications. However, during the working process of rotary tables, the accuracy of the motor and the related performance requirements of the motor are relatively strict. Once a problem occurs in a certain station, it will affect the entire The work of the production line, therefore, users often need to know the corresponding working parameters of the rotary table motor, so as to better understand the working characteristics of the rotary table.

3.1 Data processing

In the received data, considering that there may be ambiguity values ​​due to external interference during the work of the board, in addition to the use of shielded cables on the hardware, and the use of anti-interference differential input in the connection method, use in the software In this aspect, median filtering is used. The idea of ​​LabVIEW median filtering is

yi=med(Ji),i=0,1,2,K, n -1. iy: represents the filtered x of the output sequence; n: represents the input sequence

The number of elements in column x; i J: represents the subset centered on the i-th element in the input sequence x, and x

Index elements that are equal to zero outside the range. Where: i {i rl i rl J xx =--{{4}},, 1 iiikxxx-{{6}},,,,, 1 1 k, xi+rr-1, xi+rr},rl: Represents the left rank of the filter; rr: Represents the right rank of the filter; considering the data conversion and anti-interference, the final editing

The LabVIEW data processing program written is shown in Figure 4.

3.2 The compilation of the user program The way in which the integrated data acquisition card collects data, as well as the data processing performed during the data collection process, and the final test program written

4 Conclusion

This test system uses the combination of LabVIEW and ordinary data acquisition card to set the relevant parameters of the motor. Because LabVIEW is a typical graphical programming language, the development cycle of the host computer is shortened, and the LabVIEW library functions provided by the ordinary data acquisition card realize The seamless connection with LabVIEW reduces the cost of project development. At the same time, the data processing function provided by LabVIEW is used to directly call the corresponding function on the collected data, which provides convenience for developers and eliminates the need for developers to write classic algorithms. Practice shows that the test system is simple, easy to operate and reliable in operation.