A multi-axis controller based on FPGA, which can control the motion of multi-axis motor

A multi-axis controller based on fpga is introduced. The controller is mainly composed of arm7 (LPC2214) and fpga (EP2C5T144C8) and its peripheral circuits, which are used to control the motion of multiple motors at the same time. Using Verilog HDL hardware description language to implement motor control logic in FPGA, it mainly includes pulse control signal generation, acceleration and deceleration control, encoder feedback signal discrimination and subdivision, absolute displacement recording, limit signal protection logic, etc. The paper gives the realization of some core logic units in fpga, and uses Quartusâ…¡, Modelsim SE software to simulate the key logic and timing. Practical use shows that the controller can control the motion of multi-axis motors well, and can achieve high-precision position control.

As motors are widely used in digital control systems, the real-time and precision requirements for motor control are getting higher and higher. How to control motor operation flexibly and effectively has become the main direction of research. Field programmable logic gate array (Field Programmable Gate Array, fpga) is used in this paper, and the motor control is realized through Verilog language programming. The use of FPGA design has the advantages of hardware design software, high integration, high operating frequency and so on. The biggest feature of fpga is flexibility. It can realize any digital circuit you want to realize. You can customize various circuits to reduce the constraints of special chips and truly tailor your own products. The design can be flexibly changed during the design process, and its powerful logic resources and register resources allow you to easily play the design concept. Its parallel execution and hardware implementation can cope with the large number of high-speed electronic circuit design requirements in the design.

1 Main functions of multi-axis controller

The multi-axis controller is used in conjunction with a host computer, a motor driver, etc. FIG. 1 is an overall schematic diagram of a control system composed of a multi-axis controller. The controller receives the control command sent by the host computer, analyzes it and generates the corresponding direction signal and pulse signal to the driver, so as to achieve the purpose of controlling the operation of the motor. In order to improve the control precision of the system, the encoder signal of the motor is input as a feedback signal to the controller (internal realization of automatic direction identification and four subdivisions). During the movement of each axis, the dedicated controller records the absolute displacement of the motor, and can upload the absolute position information of each axis to the host computer in real time. In addition, in the process of motor operation, in order to ensure the safety of motor operation, the controller also uses limit signal feedback to achieve full hardware protection measures.

A multi-axis controller based on FPGA, which can control the motion of multi-axis motor

2 Multi-axis controller

The dedicated controller is composed of arm (LPC2214), fpga (EP2C5T144C8), driver interface circuit, encoder interface circuit, limit detection circuit and power supply circuit. Figure 2 shows the hardware composition of an eight-axis motor controller. The arm realizes the communication with the host computer through the serial port, analyzes the control commands obtained from the host computer, and generates corresponding output signals to the driver interface through fpga, and the driver interface is connected to the driver. The encoder signal is connected to the encoder interface as a position feedback signal to form a position loop feedback. The limit signal is connected to the limit detection interface as a safety detection signal to add a safety guarantee for the entire system.

A multi-axis controller based on FPGA, which can control the motion of multi-axis motor

3 fpga control logic

In the process of completing the entire control of the dedicated controller, the arm is only responsible for tasks such as command analysis, control command transmission, and real-time data upload. Fpga is the core of the multi-axis dedicated controller. Through Verilog HDL language, functions such as acceleration / deceleration curve, encoder signal direction, four subdivisions, and absolute displacement recording are realized inside fpga. Figure 3 is the overall input and output signal diagram of the motor control. The motor channel selection is performed by the chip select signal CS, the read valid signal rd_enable, and the write valid image signal wr_enable. Figure 4 shows the internal logic diagram of fpga controlled by 1 # channel. The main modules will be introduced in detail one by one below.

A multi-axis controller based on FPGA, which can control the motion of multi-axis motor

A multi-axis controller based on FPGA, which can control the motion of multi-axis motor

1) Acceleration and deceleration curve module

In order to control the operation of the motor more effectively and more ideally, an acceleration / deceleration curve module is designed inside fpga. A method of approximating the exponential acceleration and deceleration curve is used in this article. As shown in Figure 5, the exponential acceleration curve is approximated, and the deceleration curve is symmetrical to it. If the velocity is equidistantly distributed, then the time maintained at this velocity level is not the same as the field. For simplicity, the product of the speed series N and a constant C is used to simulate and the time to keep is replaced by unfamiliar. Therefore, every time the speed rises by one level, the motor must take an NC step at that speed level (where N is the number of speed levels).

A multi-axis controller based on FPGA, which can control the motion of multi-axis motor

Create two ROM modules named rom_pos and rom_div. As shown in Figure 6, rom_pos is the pulse number memory and rom_div is the frequency division value memory. Connect the two memories through the same address line, so that an address corresponds to a set of pulse number and frequency division value.

After fpga obtains the direction signal, pulse (distance) signal, and target frequency division value. If the motor does not require acceleration and deceleration during operation, the pulse frequency signal can be directly controlled by the target frequency division value. If acceleration / deceleration needs to be performed, the acceleration / deceleration module should be called inside fpga. Obtain a set of data according to the address line, namely the number of pulses pul_cnt and the frequency division value div_num, send pul_cnt pulses with the frequency division value of div_num, and then send the pulse according to the next group of data values ​​until the frequency division value reaches the target frequency division Up to the value, the deceleration process is symmetrical with the acceleration process. When the motor runs to half of the stroke according to the pulse (distance) signal, if the frequency division value has not yet reached the target frequency division value, it is necessary to perform a deceleration at this time.

Write a simulation program to make the two memory address lines the same, add 1 to the memory address address, so that the data of the memory cells corresponding to the two memories can be read at once. Use Modulesim simulation tool to perform functional simulation on the acceleration and deceleration module. The simulation results are shown in Figure 7. Accessing a memory address corresponds to the output of a set of pulse numbers and frequency division values.

A multi-axis controller based on FPGA, which can control the motion of multi-axis motor

2) Encoder feedback identification and four subdivisions

The encoder feedback signal is composed of A, B, and Z three-phase signals. The phase difference between the A and B phase signals is 90 degrees. In one cycle, the A and B phase signals will appear in 4 different combinations. According to this feature, the encoder signal can be phased and divided into four. The Z-phase signal is the encoder zero signal. When the encoder rotates once, the Z-phase signal will be output.

After successful compilation in the Quartusâ…¡ compilation environment, call Modulesim simulation software and write a simulation program to generate global clock, reset signal, A, B phase signal and Z phase signal with a phase difference of 90 degrees. As shown in Fig. 8, the function simulation diagram of the encoder signal phase separation and four subdivisions used in the multi-axis controller is given.

3) Absolute displacement record

The multi-axis dedicated controller can upload the absolute displacement of the motor to the host computer in real time. The realization of this function depends on the logic function of the absolute displacement recording part in fpga. An absolute displacement register is set inside fpga to count the encoder feedback signal (after discriminating to four subdivisions). When a pulse of the encoder signal arrives, different arithmetic processing is performed according to the backward direction signal. If the direction is regular, the value of the absolute displacement register is increased by 1, otherwise it is decreased by 1, so as to achieve the purpose of recording the absolute displacement. And arm can read the value of the absolute displacement register at any time, and then upload its value to the host computer, so as to complete the function of real-time uploading the motor operating position information. Write a simulation program to perform functional simulation on the absolute displacement register. The results are shown in Figure 9.

4 Conclusion

This solution has been successfully applied to the motion control of a 6-axis Stewart platform. While achieving a positioning accuracy of 0.1 μm, the motion mechanism has been well protected. In many experiments and practical use, the special controller runs safely reliable.

Edge Sealing Machine

Edge Sealing Machine,Automatic Sealing Machine,Heat Sealing Machine,Automatic Edge Sealing Machine

Dongguan Yuantong Technology Co., Ltd. , https://www.ytbagmachine.com

Posted on