Research on Stepper Motor Control System Based on MPC07 Motion Control Card
2026-04-06 07:30:08··#1
Abstract: This paper elucidates the working principle and usage of the MPC07 motion control card; it analyzes the implementation of multi-axis motion control of stepper motors using Visual Basic programming, which features convenient control, reliable motion, and simple development. Keywords: MPC07; stepper motor; control system; VB [b][align=center]The Research of StepMotor Controlling System Based on MPC07 ZHANGWei-xing, WANG Chun-sheng, SHEN Xiao-qiang[/align][/b] 0 Introduction With the continuous development of mechatronics, motion control systems in modern industry are also being updated and upgraded. From PLC, microcontroller, motion control card to professional motion control unit, control methods are becoming more and more advanced, control strategies are becoming more and more numerous, and a new generation of complex and flexible equipment and machines is constantly emerging. The MPC07 motion control card is a host control unit for stepper motors or digital servo motors based on the PCI bus. It forms a master-slave control structure with the PC. The PC is responsible for managing the human-machine interface and real-time monitoring of the control system. The MPC07 card handles various details of motion control, such as outputting pulses and direction signals for each axis, automatically accelerating and decelerating during motion, and setting limit switch signals for protection when returning to the origin. Each MPC07 card can control four stepper motors or digital servo motors, and multiple cards can be shared to control more than four axes. This card is based on FPGA design and provides various motion control functions. Users can develop a human-machine interface according to the requirements of the control system and call the instruction functions in the MPC07 motion function library to develop a multi-axis motion control system that meets the requirements and is cost-effective. 1. Principle of the MPC07 Motion Control Card The MPC07 is equipped with powerful and feature-rich Windows drivers and DLL function libraries. The MPC07 adopts more efficient methods in interpolation algorithms and motion function execution efficiency, improving interpolation accuracy, speed, and real-time performance. The MPC07 motion function library is used for secondary development. Users can use development tools that support Windows standard 32-bit dynamic link libraries (DLLs) in Visual Basic or VC++ to create the required user interface programs and link them with the MPC07 motion library to develop their own multi-axis motion control systems, such as CNC systems, inspection equipment, and automated production lines. The MPC07 motion function library can handle complex details related to motion control: acceleration and deceleration calculations, stroke control, multi-axis interpolation, etc., which can greatly shorten the development cycle of the control system. The motion control function of the MPC07 control card mainly depends on the motion function library. The motion function library provides many motion functions for single-axis and multi-axis stepper or servo control: single-axis motion, multi-axis independent motion, multi-axis interpolation motion, etc. In addition, backlash compensation function is also provided to facilitate the development of motion control systems. Figure 1 shows the application of the MPC07 control card in a three-axis stepper control system. 2 Working Process of Motion Control System Using the MPC07 dynamic link library (DLL), developers can quickly develop motion control systems under the Windows platform. The MPC07 dynamic link library is a standard 32-bit Windows dynamic link library. The selected development tools should support standard 32-bit DLL calls in Windows. First, program initialization is performed, setting motion parameters and board parameters. Motion parameters include various motion speeds, acceleration/deceleration, and acceleration/deceleration types. Board parameters include the number of boards and the number of axes on each board. If the hardware settings are incorrect, software errors will occur during runtime, resulting in call failure and requiring reconfiguration. Stepper motor linear motion includes independent motion and interpolation motion. Independent motion refers to motion without linkage between control axes; it can be single-axis motion or multiple axes moving simultaneously at their own speeds. Point-to-point motion, continuous motion, and homing motion all belong to independent motion. Interpolation motion refers to two or three axes moving in conjunction according to a certain algorithm, with the controlled axes starting simultaneously and reaching the target position simultaneously. Interpolation motion operates using vector velocity, which is divided into constant vector velocity and trapezoidal vector velocity. Multi-axis interpolation motion (Figure 2) involves only linear motion; their speed is determined by vector velocity, with the velocity of each axis being the component of the vector velocity on that axis. The following code snippet performs linear interpolation with constant speeds on both axes: `set_vector conspeed(2000)` sets the constant speed of the vector to 2000 pulses; `con2line2(1, 2000, 2, 2500)` moves axis 1 by 2000 pulses and axis 2 by 2500 pulses. The following code snippet performs linear interpolation with trapezoidal speeds on both axes: `set_vector vector(500, 2000, 1000)` sets the trapezoidal speed of the vector: 500 pulses for low speed, 2000 pulses for high speed, and 1000 pulses for acceleration; `fast_line2(1, 2000, 2, 4000)` moves axis 1 by 2000 pulses and axis 2 by 4000 pulses. 3. Programming The following section uses VB to program the motion of the three-axis motor shown in Figure 1. Motion parameters include axis number, initial velocity, maximum velocity, acceleration, and distance traveled, enabling the three axes to move continuously, return to the origin, and read the current axis number, position, and velocity. Figure 3 shows the functional block diagram of the three-axis motion program written in VB. Part of the program is as follows: Option Explicit Dim AxesNum As Long Axis Number Dim lowspeed As Double Initial Velocity Dim highspeed As Double Maximum Velocity Dim Accel As Double Acceleration Dim Dis As Long Distance Moved '* ... ********** ... get_abs_posAxesNum, pos 'Read position labPos. Caption = pos 'Display position speed = get_rate (AxesNum) 'Read speed labSpeed. Caption = speed 'Display speed End Sub 4 Conclusion This paper introduces the working principle and application of the MPC07 motion control card, demonstrating the motion of a three-axis stepper motor in the VB environment. Of course, the motion function library of the motion control card can also handle complex details related to motion control, such as linear interpolation for acceleration and deceleration, trapezoidal linear interpolation, etc., thus enabling a more complete motion control system. References: [1] Peng Tao, Zhou Xuecai. Open structure robot control system based on domestic MCT8000 motion control card [J]. Manufacturing Automation, 2001, 71 (7): 65267. [2] Wang Zhenhua, Zhu Guoli, Guo Changwang, et al. Research on multi-axis motion controller based on DSP and CNC [J]. Manufacturing Automation, 2000, 22 (3): 10213.