Motion control technology is a key technology driving new technological and industrial revolutions, with high speed and high precision always being its goals. The rapid development of motion control technology is mainly attributed to advancements in computers, high-speed digital signal processors (DSPs), automatic control, and network technologies. It is widely applied not only in traditional industries such as CNC machine tools, industrial robots, light industry, textiles, chemicals, and metallurgy, but also in defense, aerospace, and many other fields. CNC technology and robotics technology are important indicators of a country's level of motion control technology development. With the development of the national economy, CNC technology has made significant progress to meet the requirements of different processing fields. However, large-scale, high-precision, and high-speed CNC equipment and systems still need to be imported, greatly restricting the improvement of China's equipment manufacturing industry and processing capabilities.
Currently, open CNC systems based on PCs and motion controllers have seen significant development. The motion controller receives control commands from the PC, processes them, and converts them into control signals for the servo drive, thus rapidly building a CNC platform. Developers can perform secondary development based on the drivers provided by the motion controller to meet various specific user needs. Currently, the core research focus of open CNC systems composed of PCs and motion controllers lies in the key technologies of the motion controller, as the high speed, high precision, and high reliability of CNC machine tools largely depend on the performance of the motion controller. The development of Digital Signal Processors (DSPs) has greatly improved the computational power of motion control processes. Motion controllers developed using DSPs are becoming increasingly stable and powerful. The powerful computational capabilities of DSPs provide excellent support for complex motion control algorithms, enabling motion control systems to effectively perform motion planning, high-speed real-time multi-axis interpolation, error compensation, and more complex kinematic and dynamic calculations, resulting in higher motion control accuracy, faster speed, and smoother motion. Therefore, embedded motion controllers with DSPs as the control core and combined with FPGA modules have become the mainstream development trend.
Motion control algorithms are a key technology in motion controllers , and their complexity, accuracy, and reliability directly affect the control performance of the control system. Therefore, researching relevant motion control algorithms and their implementation in motion controllers is beneficial for achieving high speed, high precision, and high reliability in the control process.
Research content of this project
The main research content of this thesis is the design and research of a motion control card based on the PCI bus and DSP as its core. The hardware portion of the motion control card is designed, and based on this, the software portion is designed, thus providing a good hardware and software platform for the subsequent development and manufacturing of mature products. The main research contents are as follows:
1. Overall Design of Motion Control Card. The overall structure of the motion control card is analyzed, and some main functions are designed using modular design principles. Based on this, the overall design scheme of the motion control card is designed, mainly including the hardware and software design schemes.
2. Hardware Design of the Motion Control Card. Based on the hardware design scheme of the motion control card, the functions and characteristics of key chips such as the DSP chip and PCI interface chip are studied, and suitable chips are selected for this motion control card. On this basis, the hardware design of the motion control card is carried out, including the design of the DSP power supply circuit module, clock circuit module, JTAG interface module, external memory module, stepper motor drive module, upper and lower computer communication module, and input/output interface module. To improve system stability, hardware anti-interference design is required.
3. System Software Design. A modular programming approach was adopted to design the DSP main control program, including the DSP initialization module and the real-time communication module between the DSP and the PC. For the interpolation control algorithm, the minimum deviation method, which has higher accuracy than the point-by-point comparison method, was used to design interpolation algorithms for straight lines and circular arcs, and interpolation flowcharts were provided.
Motion controller design requirements
The motion controller designed in this paper is required to be applicable to CNC industries, robot control systems, and other fields. It needs to have high-speed data processing capabilities, high integration, and high reliability. The main performance indicators and technical requirements are as follows:
(1) It has 4 analog signal outputs with an output voltage range of -10V to +10V, and 4 pulse signal outputs with a pulse output frequency of up to 4MHz. It can control AC and DC stepper motors and servo motors.
(2) It has 4 quadrature encoder signal input interfaces, which can collect 4 incremental photoelectric encoder feedback signals. The acquisition frequency can reach 2MHz, which can realize the real-time detection of motor speed and position, meet the needs of speed closed-loop and control closed-loop control systems, and the position register length reaches 32 bits.
(3) Design a parallel communication interface to achieve high-speed real-time communication with a PC, and design an RS232 communication interface.
(4) It adopts an open modular design and achieves high integration.
(5) It has rich I/O interfaces to realize the control of motor and other switching signals, such as limit signals, alarm signals, origin detection, etc.
(6) It has high-speed computing capabilities, fast system response, and a system clock frequency of 150MHz.
(7) It has motion control modes such as S-curve, T-curve, and electronic gear, and can realize multi-axis interpolation function and implement relatively complex algorithms.
(8) It has a good software interface and a rich function library to meet the needs of various applications. While achieving the above performance and indicators, we should also follow the principles of reliability, modularity, integrity, and low cost in the design to enhance the product's market competitiveness.
Design scheme:
The power supply circuit provides power to all modules, and the DSP is expanded with SRAM and FLASH. The clock circuit provides the clock signals required by the DSP and FPGA. The dual-port RAM is used for parallel communication between the DSP and the PCI bus. The level conversion circuit is responsible for level conversion between RS232 and the DSP. I/O isolation provides opto-isolation for all I/O signals. Dedicated inputs/outputs are necessary I/O signals for motor control, while general-purpose inputs/outputs can be used to control other I/O signals. A D/A conversion circuit, a pulse output circuit, and an encoder input module are designed in the FPGA module.
The pulse output interface module's main task is to send pulse sequences and direction commands to the servo driver, enabling control of the motor's displacement, speed, and direction. The encoder circuit provides feedback on the motor's status, including direction and speed. The A/D and D/A modules primarily handle the processing of analog and digital signals between the motion controller and the servo motor. The I/O interface controls various switching signals. This paper does not include an A/D conversion module because the DSP's built-in A/D conversion interface is sufficient. In high-precision CNC industrial manufacturing, a high-precision A/D conversion chip (such as the AD7663) can be used, transmitting the data to the DSP via an FPGA-designed A/D interface.
Software overall design
The entire motion control software system can be divided into two main parts: the PC layer software and the DSP layer software. The human-machine interface (HMI) primarily provides functions such as process flow, trajectory planning, and status monitoring, offering a user-friendly interface. After program initialization, the data input from the HMI is processed, and the code is compiled to generate corresponding control commands. The device driver interface layer is a hardware-related layer responsible for managing and controlling the motion controller's hardware devices, as well as handling data communication. The DSP layer software parses the instruction code passed down from the PC layer, then performs specific interpolation algorithm calculations and controls the motor movement. Simultaneously, it feeds back the underlying status information to the PC.