introduction
In the computer and network era, utilizing computer and network technologies to transform traditional industries has become an inevitable trend. Virtual instrument systems are a product of the integration of computer and network technologies with traditional instrumentation technologies. Virtual instruments (VI) are currently a hot research topic in the field of automation instrumentation and are receiving increasing attention. With the continuous development of science and technology, traditional instruments are increasingly revealing their shortcomings and deficiencies. To improve experimental conditions, reduce experimental costs, and update experimental content, introducing virtual instruments into experimental teaching has become an inevitable trend. The application of virtual instruments in university experimental teaching is still in its initial stage, but its significant economic and practical advantages have already demonstrated its enormous potential. In recent years, due to the rapid development of virtual instruments and network technologies, it has become possible to construct virtual laboratories via the network, and it is not far off that distance learners will be able to conduct remote experiments via the network. The emergence and development of virtual instruments will bring about new experimental methods and drive a major transformation in educational approaches.
Developing virtual oscilloscopes using virtual instrument technology has been a research topic for engineers in various fields. This typically involves referencing a physical oscilloscope and programming it to create a virtual oscilloscope with the same interface and functions as the physical oscilloscope, completely replacing the traditional oscilloscope. Virtual oscilloscopes do not use a tube or fluorescent screen to display waveforms; instead, they use a powerful microcomputer to process signals and display waveforms. Software technology is used to design a convenient and realistic instrument panel on the screen, performing various signal processing, manipulation, and analysis, and representing measurement results in various ways (such as data, graphs, and charts) to complete measurement tasks of various scales.
Currently, servo control systems are widely used not only in industrial and agricultural production and daily life, but also in many high-tech fields, such as laser processing, robotics, CNC machine tools, large-scale integrated circuit manufacturing, office automation equipment, satellite attitude control, radar and various military weapon servo systems, flexible manufacturing systems, and automated production lines. AC servo motors are among the most frequently used motors in marine equipment, and also have a relatively high failure rate. Even slight changes in parameters can cause system vibration, seriously affecting navigation safety. Performance testing of these motors is crucial for improving the maintenance and support capabilities of shipboard navigation equipment, with rotational speed being a key performance parameter.
1. System composition and signal flow
The speed testing system designed in this paper mainly includes the following components: an industrial control computer, a PCI-6251 data acquisition card, a drive amplification unit, and an infrared photodiode. The block diagram of the control system is shown in Figure 1.
Figure 1 Block diagram of the control system
The test signal flow for a servo motor (excitation voltage U3, control voltage U4) includes 5 parts:
(1) The industrial computer outputs two strictly in-phase AC signals U1 and U2 through AO0 and AO1 (analog output) of the data acquisition card PCI-6251;
(2) U1 and U2 are amplified in voltage and power by the driving amplifier unit to become U3 and U4;
(3) U3 and U4 are connected to the excitation terminal and control terminal of the AC servo motor respectively, and the motor starts to rotate;
(4) The rotation of the motor drives the self-made gear disk connected to its central shaft to rotate. The teeth on the gear disk will intermittently block the emitter of the diode (5) and the receiver of the transistor of the infrared pair, so that the transistor outputs a pulse signal.
(5) The pulse signal is transmitted to the AI (analog input) of the data acquisition card PCI-6251 and displayed on the industrial control computer in waveform form. At the same time, the speed of the AC servo motor is obtained through the program.
2. Speed Measurement Principle
2.1 Infrared photocells
Infrared photodiodes are a collective term for infrared emitting diodes and infrared receiving diodes. They are photoelectric sensors commonly used in automatic detection and control. The Toshiba infrared photodiode used in this article consists of an infrared emitting diode and an infrared sensing transistor. Its basic working principle is shown in Figure 2.
Figure 2 Working principle of infrared photodiode
An infrared diode emits infrared radiation of a specific wavelength. When there is no obstruction between the emitting and receiving diodes, the infrared-sensitive transistor conducts due to the received infrared radiation, resulting in a low output level. When there is an obstruction between the emitting and receiving diodes, the infrared-sensitive transistor is cut off, resulting in a high output level. Therefore, the presence or absence of an obstruction between the infrared diodes can be easily determined by observing the output level. In Figure 2, RL is used to adjust the intensity of the infrared light emitted by the infrared diode, and RE is used to adjust the receiving sensitivity of the infrared transistor.
2.2 Pulse Signal Generation and Acquisition
A self-made gear disk with 60 teeth is fixed to the central shaft of the motor. Using a tooling fixture, the outer edge of the gear disk is fixed between the emitter and receiver of the infrared pair, as shown in Figure 3.
Figure 3 Schematic diagram of tooling
When the servo motor is energized and controlled by voltage, the central shaft drives the gear disc to rotate at a constant speed. The teeth on the outer edge of the gear disc intermittently block the emitter and receiver of the infrared photodiode, causing it to generate pulse signals. The AI of the PCI-6251 is used to measure the pulse signals and calculate the number of pulses, thereby calculating the rotational speed.
In the formula, V is the rotational speed (unit: revolutions per minute), n is the number of pulses collected within 5 seconds, and k is the number of teeth on the gear disk.
3. Motor drive
During servo motor speed testing, the motor first needs to be supplied with excitation and control voltages (with a 90° phase difference between them). Since the motor is being tested offline, there is no readily available operating voltage available, and the motor tested in this paper is an imported motor with an expensive matching imported driver. Therefore, a self-developed servo motor driver was used.
The programmable servo motor driver mainly consists of a PCI-6251 data acquisition card and a drive amplifier unit. Since the peak signal voltage output by the 6251 is only 10V and its power is very low, it is insufficient to directly provide the excitation and control voltage for the AC servo motor. Therefore, the drive amplifier unit must amplify the voltage and power of the signal from the AO port. The drive amplifier unit contains two similarly structured circuits: one for amplifying the excitation voltage and the other for amplifying the control voltage. The 90° phase difference between the excitation and control voltages is achieved through capacitors in the amplifier board.
4. System Software Design
4.1 Introduction to Virtual Instruments
Virtual instruments are a product of the integration of modern computer technology and instrumentation technology, and are an important technology in the field of computer-aided testing. Virtual instruments effectively combine computer hardware resources, instrument and measurement control system hardware resources, and virtual instrument software resources.
LabVIEW is a graphical programming language and development environment. Graphical programming languages, represented by LabVIEW, are also known as "G" languages. It utilizes terminology, icons, and concepts familiar to engineers to provide a convenient way to program instruments and acquire data systems.
On the front panel, select the model of the motor under test from the drop-down menu on the left, and click the "Start" button to run the program. The infrared phototransistor pulse signal acquired by AI is displayed in the waveform graph in the middle, and the motor speed is displayed in both speedometer and digital formats. At the same time, the "Test Results" in the middle left shows whether the AC servo motor speed is qualified. The front panel is shown in Figure 4.
Figure 4 Front Panel
4.2 System Software Design
4.2.1 Software Flowchart
After starting the test, first select the model of the motor under test, and then the AO outputs a signal. After a 2-second delay, once the motor is running stably, the AI measures the infrared phototransistor pulse signal, calculates the actual rotational speed, and repeats this process 5 times to improve test accuracy. Finally, the average of the 5 measured rotational speeds is taken. The measured value is then judged to be within the ideal range. If it is within the range, the motor speed is qualified; otherwise, it is unqualified. The software flowchart is shown in Figure 5.
Figure 5 System software flowchart
4.2.2 Program Design
(1) Control signal generation
The program controls the PCI-6251 data acquisition card to generate two sinusoidal signals with specified voltage and frequency of 400Hz via AO0 and AO1.
In program diagram 6, DAQmxCreateChannel is set to AO0 and AO1, and the maximum and minimum voltages are set to +10V and -10V, respectively; DAQTiming is set to the time for generating waveforms, samplemode is set to ContinuousSample; and DAQWrite is set to generate two sine waves with frequencies of 4V 400Hz and 2V 400Hz, respectively.
Figure 6 Control signal generation program
(2) Pulse signal acquisition
After the servo motor starts working, the infrared photodiode outputs a pulse, which is acquired by the AI port of the PCI-6251 data acquisition card. In program diagram 7, the input terminal is configured as Differential, the sampling mode is ContinuousSamples, and the sampling rate is 1,000,000. DAQmxRead is set to AnalogWfm1ChanNSamp (single-channel multi-sample analog waveform), and what is acquired is a pulse waveform.
Figure 7 Pulse signal acquisition program
(3) Rotation speed conversion
After acquiring the pulse signal, the waveform is analyzed and processed to obtain the number of pulses. Because pulse signals are susceptible to interference, the pulse waveform is first digitally filtered using FIR filtering; then the number of pulses is calculated. (See Figure 8.)
Figure 8 Pulse Count Calculation Program
5. Conclusion
This paper describes a method using LabVIEW software to program and send signals through the AO port of a PCI-6251 microcontroller. These signals are processed by a drive amplification unit to drive the motor. The speed of the servo motor is then measured by the AI function of the PCI-6251 data acquisition card and converted by the program. The method for driving AC servo motors and measuring their speed described in this paper has been successfully applied in a specific engineering project.
This paper describes a method using LabVIEW software to program and send signals through the AO port of a PCI-6251 microcontroller. These signals are processed by a drive amplification unit to drive the motor. The speed of the servo motor is then measured by the AI function of the PCI-6251 data acquisition card and converted by the program. The method for driving AC servo motors and measuring their speed described in this paper has been successfully applied in a specific engineering project.
For more information, please visit the Server Systems channel.