Share this

Research and Development of DSP-based Motion Controller

2026-04-06 03:43:19 · · #1
Abstract: Due to the integration of high-speed real-time processing capabilities and rich peripheral functions, DSP-based embedded motion controllers have become the mainstream of open motion controller development and are widely used. This paper studies the basic functions of motion controllers and, based on the analysis and assimilation of existing DSP-based motion controller hardware resources, develops a motion controller software system and details the software design. Keywords: Software development; DSP; Motion control 1. Hardware Structure of Motion Controller The hardware structure of this motion controller mainly consists of the following modules: a DSP+CPLD main control module, including a DSP core module and a CPLD driver and expansion module; a communication interface module, including a PCI bus, USB bus, and serial port; an I/O input/output interface module; and a peripheral memory module, including SRAM and FLASH. The hardware structure of this motion controller is shown in Figure 1. [align=center] Figure 1 Hardware structure diagram of motion controller[/align] 1.1 DSP+CPLD main control module This system uses TI's TMS320F2812 DSP as the control core. It is one of the first 32-bit control-dedicated digital signal processors in the industry, containing FLASH and a main frequency of up to 150MHz, and is specifically designed for applications such as industrial automation, optical networks and automatic control. The TMS320F2812 adopts a Harvard bus architecture with independent program and data spaces; it possesses strong computing power, capable of processing many complex control algorithms in real time; it has abundant on-chip memory, supporting 45 peripheral-level interrupts and 3 external interrupts, extracting interrupt vectors and saving the context in just 9 clock cycles, resulting in rapid response; it integrates a variety of advanced peripherals, including two event managers (EVs), a 12-bit A/D converter, two serial communication interfaces (SCIs), one serial peripheral interface (SPI), and one multi-channel buffered serial interface (McBSP); its general-purpose input/output multiplexer (GPIO) has up to 56 I/O ports. These abundant peripheral resources were utilized in the system's software development to achieve the various functions required by the system. The CPLD selected in this system is the Altera MAX3000A series EPM3128, a high-performance, low-power EEPROM-based PLD. Since the controlled object of this system is a stepper motor, the design mainly utilizes the GPIO ports of the TMS320F2812 for motor control interface and I/O interface input/output. However, because the TMS320F2812 is a low-power processor, its GPIO pin output drive capability is limited. Furthermore, since the DSP is the main control core and has a large load, all output signals are driven by the CPLD before output to improve signal drive capability. In addition, the CPLD is also used for system circuit decoding, increasing the flexibility and scalability of the system design. 1.2 Communication Interface Module When used as a plug-in motion control system, this system utilizes the PCI bus to achieve communication between the DSP and the PC. The PCI (Peripheral Component Interconnect) bus is a local bus launched in 1992 by Intel and more than 100 other companies based on a new generation of processors. It is a high-performance 32/64-bit data/address multiplexed bus that provides high-performance data to the CPU and peripherals. The PCI bus has strict specifications, with PCI V1.0 and V2.1 specifications already released, ensuring good compatibility. The PCI bus is CPU-independent and clock frequency-independent, making it suitable for various platforms and supporting multiprocessors and concurrent operation. The PCI bus offers extremely high data transfer rates and excellent scalability. Therefore, the PCI bus is widely used in computer bus-based motion control systems, i.e., the "PC + motion controller" architecture. This system uses the CY7C68001 chip from Cypress to implement USB communication between the PC and the DSP. The CY7C68001 is a general-purpose USB 2.0 interface controller; it is an application-layer programming interface device, which is much easier to use and develop compared to other link-layer programming interface devices. This system uses the on-chip SCI serial communication module of the DSP and the MAX232 chip to convert the data into standard RS-232 communication signals to achieve normal serial communication. 1.3 I/O Interface Module The input/output of this system is implemented through the logic control of the CPLD to improve system reliability and design flexibility. Considering the scalability of the motion controller and the number of GPIO pins of the DSP, a total of 16 digital output channels and 16 digital input channels are designed. The digital output channels are mainly used for outputting direction signals and pulse signals for each axis, as well as starting and stopping control of some external devices, such as the on/off control of the spindle and coolant. The digital input channels can be defined according to the specific requirements of the user, such as serving as sensor interfaces for zero-point and limit signal input. To improve the flexibility of system application, the system output adopts both ordinary output and differential output modes, which can be set by the user. 1.4 Peripheral Memory Module The TMS320F2812 chip internally includes 128KB of FLASH and 18KB of SRAM. The 128KB of FLASH is sufficient for storing system software programs. However, in practical applications, considering that motion control commands and machining programs need to be downloaded to the motion controller via USB or PCI bus, and that the DSP needs to process a large amount of data during operation, the internal storage space of the DSP chip is far from enough. Therefore, it is considered to expand the memory by adding one FLASH and one SRAM as user machining program memory and system working memory. These are read and written to the DSP via a CPLD. This system uses Intel's E28F128 FLASH and ISSI's IS61LV51216 SRAM. The E28F128 is an 8MB FLASH memory manufactured using CMOS technology. Its read/write access time is 150ns, which is longer than the read/write cycle of the DSP to the external port. To match the DSP's read/write cycle, a wait cycle must be inserted during FLASH read/write operations. The IS61LV51216 is a high-speed asynchronous static 512KB SRAM with a read/write cycle of 10ns. It can perform read/write operations with the DSP without inserting a wait cycle and can be directly mapped to Zone2 or Zone6 of the DSP's external memory interface. 2 Motion Controller Software Structure 2.1 System Software Functional Design Motion controllers are usually used as independent process control units in industrial automation production. Their functions are implemented by both hardware and software. The hardware provides the supporting environment for the software operation, and the software is responsible for implementing all the functions required by the system. The software of this system needs to complete two major tasks: control and management. Figure 2 shows its software functional structure. [align=center]Figure 2 Functional Structure Diagram of Motion Controller Software[/align] The system control includes position control, interpolation, speed processing, and switch I/O control. These tasks have high real-time requirements, so their software program priority is also high. System management includes human-machine interface display, parameter setting, and program downloading. These tasks have lower real-time requirements, so their software program priority is relatively low. It can be said that the basic functions of a motion control system are all implemented by subroutines of the above functions. Adding subroutines can further enhance the system's functionality. To achieve these functions, it is essential to plan the motion controller software carefully, dividing it into functional modules, before designing and running programs on the DSP chip. The system software is mainly divided into two layers: PC layer software and DSP layer software. In single-board motion control, the PC layer software mainly implements functions such as transmitting and downloading machining programs; in plug-in card motion control, in addition to this, it also needs to implement functions such as machining status display and machining command sending for human-machine interface. The main functions of the motion controller are implemented by the DSP layer, and the main task of this project is also the program implementation of the DSP layer software, specifically including: 1. Motion Control: Motion control is the main function of the motion controller, including position control, interpolation, and input/output (I/O) control for auxiliary functions. The basic function of this system is to realize motion control of the XYZ axes, including linear interpolation motion of the three axes and circular interpolation motion of any two axes. It can realize motion control of stepper motors, providing two control modes: single pulse (i.e., pulse + direction) and double pulse (i.e., pulse + pulse). 2. Speed ​​Control: Speed ​​control, or speed regulation, utilizes acceleration and deceleration algorithms to achieve smooth motion of the system. The system is designed with a motion speed of no less than 100 kHz during idle travel and a motion speed of no less than 40 kHz during machining. When the pulse equivalent is 2.5 micrometers, the achievable idle travel and maximum machining speed are 15 m/min and 6 m/min, respectively. 3. Communication Function: The motion controller is not an isolated system; it must exchange data with the outside world. Host communication primarily performs two tasks: program downloading and sending control commands and providing feedback on processing status. Different communication methods are used for single-board and plug-in card-based control applications. In single-board control, program downloading is done via USB bus, while control command sending and processing status feedback are done via serial port. In plug-in card-based control, both tasks are performed via PCI bus. The versatility of this system is mainly reflected in its different communication methods, supporting PCI bus, USB bus, and asynchronous serial bus, allowing users to choose freely. 4. Parameter Setting: As an open motion controller, it should allow users to adjust and modify various motion parameters of the control system in real time. This system design stores all parameters in FLASH memory, allowing users to modify the parameters through a human-machine interface. The modified parameters will take effect in the next operation. 2.2 System Software Hierarchical Design The DSP software adopts a modular and hierarchical design approach. To ensure a clear structure, the entire system software is divided into multiple files according to functional groups to process and complete corresponding tasks. It is mainly divided into three layers: 1. Main Control Layer: This layer does not involve specific operations, but is only responsible for task scheduling, interrupt arrangement, time and priority handling, etc. The main control layer consists of only one file, main.c, including the main function and interrupt function. The main function and interrupt function call functions from the algorithm layer to implement the various functions of the system. 2. Algorithm Layer: This layer is responsible for specific task execution and control algorithm implementation. The main functions of the system are implemented in the algorithm layer. The modules included are determined by the various functions required by the system. The algorithm layer is mainly used to implement motion control, speed control, and system management functions. The modules communicate with each other through flag bits and do not call each other. 3. Interface Layer: This layer is responsible for the interface with the hardware. All operations related to peripherals are processed in this layer. The interface layer includes the definition of DSP hardware resources and the drivers for system hardware. Except for the interface layer, programs in other layers of the system are prohibited from directly operating on peripherals. Functions in the interface layer that directly operate on peripherals are made as functionally complete as possible. In summary, this system is designed based on the above functions and levels, and follows the following principles: (1) Globality: Ensure the load balance of each module of the system as much as possible; (2) Correctness: The mathematical derivation is rigorous, and experimental verification is used as much as possible; (3) Structure: The software design is hierarchical, modular, and encapsulated; (4) Standardization: Ensure the readability, portability, and maintainability of the program. 3 Summary: The innovation of this paper is that motion control is the core of CNC technology. In recent years, with the development of open CNC systems, open motion controllers have also achieved unprecedented development. As an independent standard component of industrial automation control, the motion controller has been accepted by more and more industrial fields and has formed a remarkable market scale. This paper introduces the overall design scheme of the motion controller, including the hardware platform and software design ideas of the motion controller. References: [1] Chen Zhiqiang, Huan Ji. Research and design of embedded motion controller platform. Microcomputer Information, 2006, 3-2: 76-78. [2] Lei Weimin, Qiao Jianzhong, Li Benren. Some basic ideas on software numerical control. Small and micro computer systems, 1999, 20(2): 81-87. [3] Xi Zhigang, Zhou Hongfu. Development and current status of motion controller. Electrical drive automation, 2005, 27(3): 10-14. [4] Yin Yong, Li Yu. PCI bus device development guide. Beijing: Beijing University of Aeronautics and Astronautics Press, 2005: 10-12. [5] Ye Bosheng. Principles, programming and operation of computer numerical control system. Wuhan: Huazhong University of Science and Technology Press, 1998: 111-118. [6] Wang Runxiao, Qin Xiansheng. Principles and systems of machine tool numerical control. Xi'an: Northwestern Polytechnical University Press, 2000: 48-78.
Read next

CATDOLL 128CM Kelsie Silicone Doll (Soft Silicone Head)

Height: 128 Silicone Weight: 21kg Shoulder Width: 30cm Bust/Waist/Hip: 57/52/63cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22