Share this

Design of an Open Four-Axis Motion Controller Based on CPLD

2026-04-06 04:51:33 · · #1
Abstract: This paper presents the software and hardware composition and design method of an open four-axis motion control platform based on a PC. The use of a CPLD simplifies the platform's hardware structure and utilizes PC resources to achieve "soft motion control" functionality. The system features an open structure, ease of use, low cost, and reliable performance, allowing for flexible customization. Keywords: Open system, motion controller, CPLD. As a core component of motion control, motion controllers generally employ 16-bit or 32-bit microcontrollers. Their flexible system integration and high-speed instruction execution improve motion control performance, enhance the accuracy of the control system, and increase the flexibility of system configuration. Products such as DeltaTau's PMAC series and MEI's XMP series utilize high-speed data signal processors (DSPs) and field-programmable gate arrays (FPGAs), typically controlling 1 to 8 axes. While these PC-based bus-based motion controllers offer significant improvements in information processing speed due to the use of high-performance microprocessors and provide flexible interfaces in practical applications, they still present several inconveniences in use and system integration, such as high cost and complex application. Furthermore, its structure is closed, limiting it to a specific type of application. Its control strategy is singular, making it difficult to simultaneously meet the requirements of control systems in various application scenarios, hindering practical customized applications. In the past, due to limitations in computer processing power, high-performance motion control technology needed to be implemented on board processors such as microcontrollers or DSPs. The microprocessors in general PCs could hardly perform tasks such as trajectory interpolation and servo control calculations simultaneously. Currently, PC microprocessors have adopted more advanced process technologies, significantly improving their information processing capabilities and meeting the requirements of high-speed real-time motion control. Hardware support capabilities have greatly increased, and the excellent software development environment of PCs makes the construction of open motion control platforms possible. This paper proposes an open four-axis motion controller that does not use an on-board processor but instead uses a PC microprocessor as the control core. This motion controller uses Altera's Complex Programmable Gate Array (CPLD) EPF6016 to implement hardware management functions. Hardware functions can be configured through software, while application-layer functions such as motion trajectory rules and servo control are all performed by the PC. 1. System Hardware Structure The hardware structure of the open four-axis motion controller is shown in Figure 1. The portion within the dashed box is implemented using Altera's complex programmable gate array (EPF6016). The EPF6016, part of the FLEX6000 series, is a low-cost programmable interleaved gate array from Altera for high-capacity designs. It features 16,000 usable gates, 1,320 logic cells, and 117 I/O pins, each with independent tri-state output enable control. Employing an OPEFLEX architecture, it maintains high performance and high wiring efficiency in a minimal chip size. The basic component is the logic cell (LE). Each LE consists of a 4-input lookup table, a register, and dedicated channels for carry and cascading. Ten LEs form a logic array block (LAB). Constructed using SRAM, the device can be configured online via external EEPROM or a controller, allowing designers to flexibly modify the design early and during testing, and also enabling online reconfiguration to change its internal functionality. The hardware function programming of the motion controller is supported by the MAX+PLUSII development system provided by ALTERA. The design adopts the schematic input method, which makes the design and debugging relatively intuitive and simple. The hardware structure of the motion controller is divided into the following parts: (1) Host interface circuit: The motion controller adopts the ISA-AT bus interface and also designs the PC-104 interface. The data bus width is 16 bits. The interface function is implemented inside the EPF6016, including bus address decoding, data and command latching, interrupt and reset functions. (2) Photoelectric encoder interface circuit: The motion controller receives four photoelectric encoder differential input signals as position feedback. The maximum input frequency is 1MHz. After the input A and B phase signals are differentially received, they are digitally filtered inside the EPF6016 and then multiplied and oriented. The generated direction signal and pulse signal enter the 16-bit up and down counter. The system software can count to obtain the actual position change. (3) Analog output circuit: A high-performance motion controller should use a high-resolution D/A converter. To ensure the accuracy of the analog control signal and considering the drift and voltage drop caused by the online transmission of the analog signal, the analog control interface signal between the motion controller and the servo driver should have an accuracy of at least 12 bits. The motion controller in this paper adopts the low-cost, small-package dual 16-bit serial input D/A converter AD1866 to form a bipolar voltage output mode. The EPF6016 is designed with control circuits for 4-channel concurrent parallel/serial data conversion and 4-channel D/A address selection circuits. The analog voltage output range of the motion controller is ±10V. (4) Digital input and output circuit: All I/O signals of the motion control are photoelectrically isolated. Considering the signal jitter that may be generated by the I/O parallel signal, each I/O signal is digitally filtered to eliminate noise signals. The controller is designed with 40 I/O signals, including 16 dedicated input signals, 2 special switch input signals (contact probe signals for coordinate measurement or positioning and emergency stop switch signals), and 16 programmable general-purpose I/O signals (8 inputs/8 outputs). In fact, all I/O signals are open except for a few signals with unique functions. Specific functions can be designed according to the characteristics of the application. (5) Analog Input Circuit: For some control applications, it is necessary to detect or control changes in external state quantities. The motion controller is also designed with corresponding single-ended or differential analog feedback input channels. The system uses MAXIM's MAX197 A/D converter with 8 channels, 12-bit conversion accuracy, and 150kHz sampling frequency. Each analog channel can be independently programmed to select the input range: ±10V, ±5V, 0~10V, 0~5V. The conversion reference of the A/D converter adopts an internal reference. (6) Programmable Timer: Since interpolation and servo control are both completed by the PC in an open motion control system, these two control tasks are usually not processed in the same task cycle. Generally speaking, the interpolation cycle is longer than the servo control cycle, so the two tasks require different system resources. Since interpolation operations typically occupy the PC's timer interrupt resources, and servo control is also a task that requires precise timing, a programmable 16-bit timer was designed inside the EPF6016. This timer can use different clock sources, with a timing range of 0 to 300ms and a minimum resolution of 70ns. The overflow action generated by the timer can request an interrupt from the PC. (7) Synchronous working circuit: In the motion control system, the synchronous operation of each control axis is a very important requirement. Therefore, a synchronous control circuit and a dedicated control word were designed inside the EPF6016 to support synchronous refresh of the control output of multiple motion controllers, synchronous reading of feedback count values, and other operations. (8) Hardware watchdog circuit: The DALLAS watchdog reset and voltage monitoring chip DS1232 was used in the motion controller to monitor the operation of the system's hardware and software. When the system software crashes, the watchdog circuit generates a signal to reset the system, ensuring the reliability of the entire system. The watchdog timing can be programmed to be 300ms, 600ms, or 1.2s. From the composition characteristics of the hardware structure, it can be seen that the core of the system is the CPLD EPF6016, which has reconfigurable features. It implements almost all peripheral circuit management functions, while the other circuits are standard auxiliary circuits. Therefore, the system has typical openness in structure, which is a good support for the openness of software. 2. Motion Controller Software Design The software of the motion controller is written in Borland C++ language and can be called in the form of library functions. According to the characteristics of real-time motion control and the structure of hardware resources, the function library is divided into two categories: (1) Function library for controlling the hardware operation of the motion controller. It includes functions for the basic operation of the motion controller hardware. By calling these functions, hardware resources can be fully utilized to realize customized applications. The access operation of each hardware function on the motion controller is implemented through a set of read and write control commands. Each control command occupies a PC I/O space address. Reading or writing to each address will produce different functions. The hardware operation function library is constructed in the form of C++ language classes. Each command exists in the form of public member functions of the motion controller hardware operation class. These commands mainly implement the following functions: ① Control the photoelectric encoder pulse counter to read or clear the count value; ② Set the working mode of the motion controller and configure the various hardware resources of the system; ③ Switch input and output operations to realize functions such as querying and setting general I/O and special I/O, and querying the working status of controller hardware resources; ④ Analog control commands to control D/A converters and A/D converters to realize analog output and analog signal acquisition. (2) Customized application algorithm function library. Based on the function library for controlling the hardware operation of the motion controller, application algorithm functions can be designed in a targeted manner according to the requirements of actual applications. This paper takes motion control as an example to design an algorithm function library for motion control to realize functions such as motion planning and servo control. Other control algorithms and functions can also be further extended on this basis. The commands of the motion control algorithm function library are also encapsulated in the form of C++ language classes. The control algorithm class is inherited from the motion controller hardware operation class, and it is very convenient to call and modify. Therefore, it has good openness in structure. In the servo motion control algorithm, the controller sends the currently planned motion position and feed speed to the servo controller for comparison with the actual feedback position to obtain the position tracking error. After passing through the position controller, the error is sent to the D/A converter to output the control signal for the servo driver. The position control algorithm can adopt various control strategies according to actual requirements. The motion controller control algorithm in this paper adopts the PID + speed feedforward method. By adjusting various parameters, this control algorithm can achieve accurate and stable control for most systems. Its control structure is shown in Figure 2. The servo controller output calculation formula is: Where, Un—servo controller output value; En—position error at the nth sampling time; Prarger—target position at sampling time n; Pactual—actual position at sampling time n; Vtarget—current desired speed, in units of count value/sampling period; B—drift compensation. 3. System Application and Experimental Results From the hardware and software structure of the motion controller, it can be seen that this design has good openness, which facilitates functional expansion and reconfiguration of hardware and software, and the construction of the application system is also relatively flexible. Figure 3 is a structural diagram of the open motion control platform applied to servo motor control. It consists of three parts: an IBM PC with a Pentium 200 CPU; a four-axis open motion controller; and AC servo motors and drivers (using Panasonic MINAS-A series 100W servo drivers; the position servo control cycles are 250μs and 1ms, respectively). Figures 4 and 5 show the sinusoidal position tracking curves of the position control using the PID control algorithm for different servo control cycles, where θr represents a sinusoidal given signal with an amplitude of 2500 pulses and a frequency of 4Hz, θf represents the actual position feedback, and E represents the position tracking error. The results show that the system can easily implement control settings and has strong software expansion capabilities. The open four-axis motion control platform designed in this paper integrates the hardware resources required for the motion controller by using the high-capacity, low-cost CPLD EPF6016, improving the system's hardware configuration capabilities and reliability. Furthermore, it fully utilizes the advantages of PC software resources, encapsulating the motion control algorithm using a C++ "class" structure, giving the system software excellent openness and integration, allowing for the design of various control algorithms and the implementation of "soft motion control" functions. This design not only reduces costs, but also makes the control algorithm open to users, making it easy to customize applications by using different control algorithms according to the actual object.
Read next

CATDOLL 108CM Beth (TPE Body with Hard Silicone Head)

Height: 108cm Weight: 14.5kg Shoulder Width: 26cm Bust/Waist/Hip: 51/47/59cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm An...

Articles 2026-02-22
CATDOLL 130CM Kiki

CATDOLL 130CM Kiki

Articles
2026-02-22
CATDOLL Maria Hard Silicone Head

CATDOLL Maria Hard Silicone Head

Articles
2026-02-22