Multi-axis stepper motor control system based on virtual instrument technology
2026-04-06 08:09:34··#1
This paper introduces a multi-axis stepper motor control system based on virtual instruments. The hardware utilizes a PC-based NIPCI7354 motion control card to generate pulse and direction signals, and an NIPCI7604 to drive and amplify these signals. The software employs LabVIEW 7 graphical programming software to design the user interface and control program. By calling the motion function library in the control card, the pulse frequency and direction signals can be dynamically changed to control the motor's speed and direction, thus achieving simultaneous control of different axis stepper motors in an open-loop control state. This improves real-time performance and speed while also being convenient and practical. In recent years, virtual instrument technology has been widely applied in many fields such as aviation, aerospace, marine, communications, automotive, semiconductors, and biomedicine. From simple instrument control and data acquisition to cutting-edge measurement and control and industrial automation, from university laboratories to industrial sites, from exploratory research to technology integration, numerous examples of virtual instrument technology applications can be found. Domestic and foreign scholars have conducted extensive research and published many related articles or papers, but there has been relatively little discussion on motion control. Therefore, this paper would like to share some preliminary explorations and experiences regarding the application of virtual instrument technology in stepper motor control systems. I. Virtual Instruments and Motion Control 1. Virtual Instruments and Graphical Programming Languages - LabVIEW A virtual instrument (NI) is a computer-based instrument that adds software and/or hardware to a general-purpose computer, allowing the user to operate the computer as if it were a custom-designed traditional electronic instrument. In a virtual instrument system, hardware is merely for signal input and output; software is the key to the entire system. Any user can easily modify the software to change, add, or remove functions and scale of the instrument system, hence the saying "software is the instrument." The emergence of virtual instrument technology has completely broken the traditional model where instruments are defined by manufacturers and cannot be changed by users. Virtual instrument technology gives users a space to fully utilize their talents and imagination. Users (not manufacturers) can design their own instrument systems according to their needs, meeting diverse application requirements. Virtual instrument systems are a product of the combination of computer system and instrument system technologies. It leverages the powerful graphical programming environment and online help functions of a PC, combined with corresponding hardware, to quickly create a virtual instrument panel with a human-computer interaction interface. This allows for the control, data analysis, and display of instruments or equipment, improving instrument functionality and efficiency, significantly reducing instrument prices, and enabling users to define instrument functions according to their needs, facilitating maintenance, expansion, and upgrades. LabVIEW is a 32-bit virtual instrument software development platform developed by National Instruments (NI) using virtual instrument technology, primarily targeting the computer measurement and control field. LabVIEW is also a powerful graphical programming language, but unlike traditional text-based programming languages (such as C), it employs a flowchart-based graphical programming approach, hence it is also known as the G language (graphical language). This graphical programming style facilitates rapid program development for engineers without software expertise. LabVIEW also differs from the sequential execution of traditional text-based programming languages, using a data flow execution method. This method requires the program to execute only after each node has obtained all its data. Multi-task parallel processing is generally achieved through multi-threading technology, where different tasks are processed "simultaneously" by taking turns using CPU time slices through their respective threads. LabVIEW also employs multithreading technology, and compared to traditional text-based programming languages, it has two major advantages: LabVIEW completely abstracts threads, eliminating the need for programmers to create, destroy, or synchronize threads; LabVIEW uses a graphical data flow execution method, allowing programmers to intuitively see the parallel execution status of the code during program debugging, making it easy to understand the concept of multitasking. The LabVIEW graphical programming language effectively utilizes the click-based features of today's graphical user interfaces. Programming involves only the following simple steps: (1) Select the instrument function as an object using the mouse; (2) Describe the relationship between the test steps and the object; (3) Establish initial conditions. 2. Motion Control The motion control card is a PC-based upper-level control unit used in various motion control applications (including displacement, velocity, acceleration, etc.). Its emergence is mainly due to: (1) to meet the requirements of standardization, flexibility and openness of new CNC systems; (2) in the research and development and transformation of automated control systems for various industrial equipment, national defense equipment (such as tracking and positioning systems), intelligent medical devices and other equipment, there is an urgent need for a hardware platform for motion control modules; (3) the widespread application of PCs in various industrial sites also prompts the equipping of corresponding control cards to give full play to the powerful functions of PCs. Motion control cards usually use professional motion control chips or high-speed DSPs as the core of motion control, and are mostly used to control stepper motors or servo motors. Generally, the motion control card and the PC form a master-slave control structure: the PC is responsible for the management of the human-computer interaction interface and the real-time monitoring of the control system (such as the management of the keyboard and mouse, the display of system status, motion trajectory planning, the sending of control commands, the monitoring of external signals, etc.); the control card completes all the details of motion control (including the output of pulse and direction signals, the processing of automatic acceleration and deceleration, the detection of signals such as origin and limit, etc.). Motion control cards are equipped with open function libraries for users to develop and construct the required control systems on the corresponding system platform. Therefore, this type of open-structure motion control card can be widely used in various fields of equipment automation in manufacturing. A stepper motor is an actuator that converts electrical pulses into angular displacement. When a stepper driver receives a pulse signal, it drives the stepper motor to rotate a fixed angle (called the "step angle") in a set direction. Its rotation is done step by step at fixed angles. The amount of angular displacement can be controlled by controlling the number of pulses, thereby achieving accurate positioning; simultaneously, the speed and acceleration of the motor can be controlled by controlling the pulse frequency, thereby achieving speed regulation. Stepper motors can be used as special motors for control. Due to their low rotor inertia, high positioning accuracy, no cumulative error, and simple control, stepper motors have become one of the main actuators in control systems. Stepper motor control methods include open-loop control and closed-loop control. II. Overall Structure and Principle of a Stepper Motor Control System Based on Virtual Instruments A general motion control system mainly consists of five parts: the mechanical equipment being moved, the motor (servo or stepper) for motion I/O, the motor drive unit, the intelligent motion controller, and the programming/operation interface software. The goal of this system is to utilize the existing National Instruments (NI) PCI 7354 servo/stepper motion control card and its accompanying software, NI 7604 servo/stepper driver and its accompanying software, two-phase stepper motors, LabVIEW software, multi-axis precision electric stage (load), and PC in the author's laboratory to build a stepper motor motion control system. This system will achieve single-axis, two-axis, three-axis, and four-axis motion control. The system is required to have the basic functions of a CNC system, enabling linear and circular interpolation, speed control, and electronic drive functions in different coordinate systems for experimental teaching applications. The overall system structure diagram is shown in Figure 1. 1. NI PCI 7354 Motion Control Card The NI PCI 7354 control card can simultaneously control four-axis motion, including AC and stepper motors, and can achieve functions such as point-to-point position control, speed control, three-dimensional linear, circular, helical, and spherical motion, electronic drive, mixed motion, return and limit control, trigger input, and breakpoint output. The NI PCI 7354's embedded firmware is based on an RTOS (Real-Time Operating System) kernel, offering strong real-time performance. It provides integrated solutions and capabilities through a simple and easy-to-use motion controller, software, and peripherals, delivering precise and high-performance motion functions for general servo and stepper applications. This motion controller can be programmed using LabVIEW, Measurement Studio (LabWindows/CVI, Visual Basic), and C/C++, all supporting Windows 2000/NT/Me/XP operating systems. The NI PCI 7354 motion control card is a high-performance PCI stepper/servo controller suitable for all motion control systems. Employing advanced technology, it provides hybrid motion trajectory control and fully cooperative circular, linear, point-to-point, gear, and space vector control in embedded real-time motion or host-centric programming environments. Its rich functionality meets the most demanding requirements. Key features of the NI PCI 7354 motion control card: Communication with the host computer via PCI bus; 68-pin VHDCI output cable; Standard digital output voltage: 0-32V; High level 3.5-30V, Low level 0-2V; Maximum pulse rate: 100kHz; Operating current: 3-14mA; Maximum trigger output pulse rate: 1MHz; 2. Motion control software: Powerful motion control programs can be developed using the NI LabVIEW graphical programming language and various application software. The motion controller is equipped with LabVIEW VI, firmware updaters, and DLL programs provided by the NI-Motion driver software. Motion control applications can be developed using other development tools (such as Measurement Studio, LabWindows CVI) or other programming languages. NI Motion Assistant is an add-on tool that uses LabVIEW code generation methods, allowing you to develop LabVIEW motion control applications with minimal or no programming. 3. NI 7604 Driver: The NI 7604 driver amplifies the four-axis motion control signals provided by the NI 7354 to drive two-phase stepper motors, which in turn move a precision electric stage. This driver connects the motion controller to application-specific motors, encoders, limit switches, and user I/O. A single control cable connects the motion controller and the driver, providing a channel for all command sets and feedback signals. Key features of the NI 7604: Input voltage: 115V/23V, 2/1A, 60/50Hz; Stepper amplifier: IM481H; Current per phase: 0.2–1.4A; Continuous output power capacity: 80W; Input cable: 68-pin VHDCI type; Output voltage: 24V DC; +5V output: 1A. 4. Motion Control Peripherals: Four two-phase stepper motors and one four-axis precision electric stage. The electric stage uses a ball screw/nut drive structure. The system schematic is shown in Figure 2. III. System Working Principle The target position, acceleration, speed, and deceleration of the stepper motor are set via a data terminal device on a host computer (PC) (i.e., a motion control task is issued). The NI PCI7354 motion control card controls the motor's movement time (number of output pulses) and direction according to the set information; that is, the control card completes real-time motion planning. The NI 7604 driver amplifies the pulse signal to drive the motor. During motor operation, the frequency f of the control pulses should be changed constantly to meet the needs of low-speed start-stop and high-speed operation. The pulse frequency is determined by the baud rate (B) of the transmitted data. Each pulse requires two binary bits, 1 and 0, to form its high and low levels, so f = B/2. The frequency of the transmitted control pulses can be changed by adjusting the baud rate of the transmitted data. When transmitting data at a conventional baud rate series, the frequency of the control pulses generated varies greatly and cannot meet the requirements of normal motor start-stop and speed regulation. Therefore, the computer needs to transmit data at a non-standard baud rate to generate control pulses of arbitrary frequency. Generally, the baud rate is adjusted once for each byte transmitted during the motor start-up and stop phases to make the motor start-stop as smooth as possible. IV. Software Research and Implementation After the system hardware was constructed, the software research and development of single-axis linear motion control, two-axis planar motion control, and three-axis spatial motion control systems were gradually completed. The control software was designed using LabVIEW 7, a virtual instrument software development platform. Each program consists of a front panel and a block diagram program. The front panel is used to set control parameters and display the control process and results, while the block diagram program contains the program code. The front panel for two-axis planar helical motion is shown in Figure 3, and the block diagram program (partial) for two-axis planar helical motion is shown in Figure 4. The front panel and block diagram program (partial) for three-axis spatial motion are shown in Figures 5 and 6, respectively. V. Conclusion Experimental results show that the stepper motor control system performs well and operates reliably. With a multi-functional human-machine interface, it can achieve visualized operation and control of position (starting point and target point), speed, acceleration, and deceleration. By changing the target position of the load online, precise positioning control can be achieved. By adjusting the speed and acceleration/deceleration values online, rapid speed adjustment can be achieved. Currently, open-loop multi-axis control has been achieved. Given the need for closed-loop control of stepper motors, this paper plans to further research a multi-axis motion control system based on closed-loop control of stepper motors. Multi-axis stepper motor control system based on virtual instrument technology: PDF