The Hardware and Software Design of Open Four-axis Motion Controller Based on CPLD

Motion controllers use multi-axis coordinated control of multiple servo motors using high-performance microprocessors (such as DSPs) and large-scale programmable devices. At present, the numerical control system adopting the motion controller has become the development trend of a new generation of numerical control technology, and the motion controller will become the core of the future numerical control system.

As the core component of motion control, motion controllers generally use 16-bit or 32-bit microcontrollers. Its flexible system integration and high-speed instruction execution speeds up motion control performance, improves control system accuracy, and enhances system configuration. The flexibility. For example, DeltaTau's PMAC series and MEI's XMP series adopt high-speed data signal processors (DSPs) and Field Programmable Gate Arrays (FPGAs). Generally, they can control 1 to 8 axes.

Although these PC-based bus-based controllers use high-performance microprocessors to greatly improve the speed of information processing and provide flexible interfaces in practical applications, they are still in use and system integration. There are a lot of inconveniences, such as relatively high prices and complicated applications. And it is closed in structure, only for a certain type of application, a single control strategy, it is difficult to simultaneously meet the requirements of the control system in a variety of applications, the actual custom application.

In the past, due to the limitations of computer processing capabilities, high-performance motion control technologies needed to be implemented on board processors such as single-chip microcomputers or DSPs. Generally, it is difficult for microprocessors in PCs to perform such tasks as track interpolation operations and servo control operations at the same time. . At present, PC microprocessors have adopted more advanced process technologies, and their information processing capabilities have been significantly improved. They can meet the requirements for high-speed real-time motion control. The hardware support capability is greatly enhanced, and the PC's good software development environment makes it possible to construct open-air sports. The control platform becomes possible. This paper proposes an open four-axis motion controller that uses a PC microprocessor as the control core instead of a board processor. The motion controller uses the ALTERA Complex Programmable Gate Array (CPLD) EPF6016 for hardware management. Functions and hardware functions can be configured by software, and application layer functions such as motion trajectory rules and servo control are all completed by the PC.

The Hardware and Software Design of Open Four-axis Motion Controller Based on CPLD

Hardware Design of Open Four-axis Motion Controller Based on CPLD

System hardware structure

The Hardware and Software Design of Open Four-axis Motion Controller Based on CPLD

The hardware structure of the open four-axis motion controller is shown in Figure 1. Among them, the part inside the dashed line frame is realized by ALTERA's complex programmable gate array EPF6016. The FLEX6000 Series device EPF6016 is a low-cost programmable interleaved gate array from ALTERA for high-capacity designs with 16000 available gates, 1320 logic cells, 117 I/O pins, and each I/O pin Each has its own three-state output enable control. The device uses an OPEFLEX structure that maintains high performance and high wire-out rates with minimal die size.

The basic composition of the device is the logic unit (LE). Each logical unit consists of a 4-input lookup table, a register, and dedicated channels that function as carry chains and cascade links. Each ten logic cells form a logic array block (LAB). The device uses an SRAM structure that can be configured on-line via an external EEPROM or controller. This allows the designer to make flexible modifications to the design during the initial design phase as well as the design and test process. It can also change its internal functions through online reconfiguration. The motion controller's hardware function programming is supported by the MAX+PLUSII development system provided by ALTERA. The design adopts the schematic input method and the design and debugging are more intuitive and simpler.

The Hardware and Software Design of Open Four-axis Motion Controller Based on CPLD

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 designs the PC-104 interface. The data bus width is 16 bits, and the interface function is implemented inside the EPF6016, including functions such as bus address decoding, data and command latching, interrupt and reset.

(2) Optical encoder interface circuit: The motion controller receives the differential input signal of four optical encoders as position feedback, the highest input frequency is 1MHz, and the input A and B phase signals are digitally filtered inside the EPF6016 after differential reception. After processing, frequency multiplication and discrimination are performed, and the generated direction signal and pulse signal enter a 16-bit up-down counter. System software can count and get actual position changes.

(3) Analog Output Circuit: High-performance motion controllers should use high-resolution D/A converters. In order to ensure the accuracy of the analog control signal and take into account the drift and voltage drop caused by the analog signal on-line transmission, the analog control interface signal between the motion controller and the servo driver should have at least 12-bit accuracy. The motion controller in this paper uses a low-cost, small package size dual 16-bit serial input D/A converter AD1866 to form a bipolar voltage output method. The EPF6016 is designed to control four concurrent parallel/serial data conversions and four D/A address selection circuits. The analog controller's analog voltage output range is ±10V.

(4) Digital input and output circuits: All I/O signals of motion control are optically isolated, taking into consideration the signal jitter that I/O and off signals may generate, and corresponding I/O signals for each channel Digital filter processing to eliminate noise signals. The controller has designed 40 channels of I/O signals, including 16 dedicated input signals, 2 special switch input signals (contact probe signals and emergency stop switch signals for coordinate measurement or positioning), and 16 other designs. Programmable general-purpose I/O signals (8 inputs//8 outputs). In fact, all I/O signals except the individual signals have unique functions. They are all open. They can be based on I/O signals except that individual signals have unique functions. They are all open and can be designed according to the characteristics of the application. Features.

(5) Analog input circuit: For some control situations, it is necessary to detect or control the change of the external state quantity. The motion controller also designs a corresponding single-end or differential analog feedback input channel. The system adopts the MAX197 A/D converter with 8-channel, 12-bit conversion accuracy and 150kHz sampling frequency. Each analog channel can be independently programmed to select the input range: ±10V, ±5V, 0 to 10V, 0 to 5V. The conversion reference of the A/D converter uses an internal reference.

(6) Programmable timer: As in the open motion control system, the interpolation operation and servo control are all completed by the PC, and these two control tasks are usually not processed in one task cycle. In general, the period of interpolation operation is longer than the period of servo control, so two tasks need to occupy different system resources. Since the interpolation operation usually occupies the timing interrupt resources of the PC, and the servo control is also a task requiring precise timing, a programmable 16-bit timer is designed inside the EPF6016. The timer can use different clock sources, the timing range is 0 ~ 300ms, the minimum resolution is 70ns, the overflow action generated by the timer can apply for an interrupt to the PC.

(7) Synchronous working circuit: In the motion control system, synchronous operation of each control axis is a very important requirement. Therefore, a synchronous control circuit and a special control word are designed inside the EPF6016 to support the synchronization control output of multiple motion controllers. Refresh, feedback counters, etc. read simultaneously.

(8) Hardware watchdog circuit: The DALLAS watchdog reset and voltage monitoring chip DS1232 is used in the motion controller to monitor the hardware and software operation of the system. When the system software crashes, the watchdog circuit generates a signal reset system to ensure the reliability of the entire system. Watchdog timing can be programmed to 300ms, 600ms, 1.2s.

From the compositional characteristics of the hardware structure, we can see that the core of the system is the CPLD EPF6016 with reconfigurable features. It implements almost all peripheral circuit management functions, and other circuits belong to standard auxiliary circuits. Therefore, the system has a typical openness in structure, which is a good support for the implementation of open software.

The Hardware and Software Design of Open Four-axis Motion Controller Based on CPLD

The Software Design of Open Four-axis Motion Controller Based on CPLD

Motion Controller Software Design

The motion controller software is written in Borland C++ and can be invoked as a library function. According to the characteristics of real-time motion control hardware resources, the function library is divided into two categories:

(1) A function library that controls the hardware operation of the motion controller. Including functions for the basic operations of the motion controller hardware, by calling these functions can make full use of hardware resources to achieve customized applications. The access operation of each hardware function on the motion controller is achieved through a set of read/write control commands. Each control command occupies a PC I/O space address, and each read or write operation to each address will result in a different The function. The hardware operation function library is constructed in the C++ language class. Each command exists in the form of a public member function of the motion controller hardware operation class. These commands mainly implement the following functions:

1 Control the photoelectric encoder pulse counter to read or clear the count value;

2 Set the working mode of the motion controller and configure the hardware resources of the system;

3 switch input and output operations, including functions such as query and setting of general I/O and dedicated I/O, and query of controller hardware resource work status;

4 analog control commands, used to control the D / A converter and A / D converter to achieve analog output and analog signal acquisition.

(2) Custom application algorithm library. According to the requirements of practical application, based on the function library that controls the hardware operation of the motion controller, the algorithm function can be designed and applied in a targeted manner. In this paper, the motion control algorithm library is designed with motion control as an example to realize the functions of 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 packaged in a C++ language class. The control algorithm class is an inheritance of the motion controller hardware operation class, and the call and modification are very convenient. Therefore, the structure has a good openness.

The Hardware and Software Design of Open Four-axis Motion Controller Based on CPLD

In the servo motion control algorithm, the controller sends the current planned motion position and feed speed to the actual position of the servo controller and feedback to obtain the position tracking error. After passing through the position controller, it sends it to the D/A converter. , Output servo drive control signal. Position control algorithms can use a variety of control strategies based on actual requirements.

The Hardware and Software Design of Open Four-axis Motion Controller Based on CPLD

AC-DC Power Cord

It is a kind of electric energy or signal transmission device, which is usually composed of several wires or groups of wires.

Power cord plug is also called power plug. It is used in various fields and countries. Power plug can be roughly divided into conversion power plug, injection power plug and assembly power plug. The general power plug can be used only by connecting the power cord. According to the different purposes of the power plug, the power cord plug can be used at the voltage of 250V, 125V and 36V. According to the different current, it can be used in 16a, 13a, 10a, 5A, 2.5A.



AC-DC Power Cord

ShenZhen Antenk Electronics Co,Ltd , https://www.pcbsocket.com