Share this

SOPC-based multi-dimensional high-precision motion control system

2026-04-06 06:20:06 · · #1
High-precision translational worktables are typically driven by AC servo motors and use optical encoders to generate position feedback signals. The generated position information is then used as system feedback through shaping, frequency multiplication, phase detection, and counting circuits to form a fully closed-loop structure. Previously, this part of the circuit was generally implemented using ordinary logic circuits and discrete components, which is not only bulky, unreliable, and difficult to debug, but also limits processing speed, especially in multi-axis motion control systems. If the signal from the optical encoder is directly processed by the CPU, it consumes a lot of CPU resources, and its real-time performance cannot be guaranteed. To solve these problems, this paper utilizes a Field Programmable Gate Array (FPGA). First, each functional circuit is designed as a dedicated integrated functional module. Then, these functional modules are called as ordinary external devices by the Nios II embedded processor. Finally, the system software program is written using the Nios II IEDS software compilation environment to build a complete high-precision motion control SOPC system. [b]1. Based on FPGA[/b] Applying FPGA (Field Programmable Gauge Arcade) to motion control or grating measurement fields to improve system performance and reliability, as well as increase integration and real-time performance, has become a development trend. However, this approach simply uses FPGA chips as a tool to replace digital logic circuits without utilizing the embedded soft or hard cores. In other words, the powerful functions of FPGA have not yet been fully explored. The System-on-Programmable Chip (SOPC) is a FPGA-based SoC solution provided by Altera for the design of complex electronic systems. The SOPC uses a series of embedded processors as its core, featuring a simplified instruction set and performance exceeding 200 DMIPS. This system not only overcomes the various drawbacks of traditional logic circuits and discrete components, but also allows a large number of control tasks to be handled by the Nios II soft core by sending only a few control instructions. This frees up sufficient hardware and software resources to handle other tasks, significantly improving the efficiency and flexibility of the host computer, making it particularly suitable for multi-axis motion control systems. [b]2 Overall System Design[/b] To achieve motor control and grating measurement, a high-precision motion control system as shown in Figure 1 was designed. The control tasks of this system are mainly completed by a system based on the FPGA (EP2C8) Nios II soft core. The main components of this SOPC system include: the Nios II core, on-chip RAM and ROM for configuring the program, and JTAG uAR. The components include a T-interface, an on-chip PII, an LCD driver module for auxiliary display, a motor control module for controlling the motor driver, a grating counting module for grating measurement, and a data input/output interface for communication with the host computer. Most of these components can be called in the SOP CB utility environment, but the key motor control module and grating counting module need to be written using a hardware description language. For a multi-axis motion platform, only multiple motor control modules and grating counting modules need to be added inside the SOPC system. This is because each functional module is an independently operating hardware circuit. They do not occupy CPU resources and can independently drive and measure different axis motors and gratings, and different axes can be driven in parallel. The basic working process of this motion control system is as follows: First, the host computer sends motion control instructions to the Nios II core in the FPGA. The core sends control instruction information to the corresponding functional module according to the received instructions. After receiving the control instruction information, the functional module starts to run independently. [b]3 Design of Functional Modules[/b] The so-called functional module is a module that utilizes the FPGA according to the needs of specific digital logic. The rich hardware resources within the FPGA allow for the construction of various functional circuits that can be connected to the Avalon bus. Utilizing these functional modules, many functions previously implemented by scattered digital circuits can be integrated into a single chip, significantly improving system integration, reliability, and saving space. Furthermore, the high system frequency (up to 100 MHz and above) used in the FPGA chip enhances the system's real-time performance. In the high-precision motion control system, motor control and grating counting modules were designed for the two key tasks of motion control and precise positioning, respectively. All these modules were written using a hardware description language. The two-dimensional precision stage used in the motion control module experiment was designed by the Electromechanical Engineering Company of Huazhong University of Science and Technology, employing a Panasonic AC servo motor as the drive device. The driver model is [model number missing]. This motor features a standard 2500-line encoder, and the driver utilizes a 4x frequency multiplication technology, resulting in a pulse equivalent of 360 / -0.036. Since the drive screw pitch of the stage in this system is 2 mm, [missing information]. Therefore, the theoretical accuracy of this worktable can reach 10000 - 0.2 ptm. Depending on the driver input circuit and system settings, the driver can have various operating modes. The system adopts a mode with a maximum response frequency of 200 kHz. Figure 2 shows the structure of the motor control module designed according to the adopted mode. This control module is connected to the Nios II core via Altera's dedicated internal connection bus, the Aval-bus, and is used as a slave device. The host computer only needs to forward the motor control commands through the Nios II core to the corresponding motor drive module, which can then independently complete the motor control task. The motor control command information sent by the host computer includes: speed control information, direction control information, and movement distance control information. In the motor control module, the main control logic is implemented by the driver control logic circuit shown in Figure 2. This logic circuit converts the motor control command information from the host computer into corresponding level and pulse signals, which are then input to the driver to control the AC servo motor. The movement distance is achieved by controlling the number of drive pulses. The system's drive pulse count range is 0 to 1678 mm, allowing control of the table travel from 0 to 1678 mm. Speed ​​control is achieved by controlling the frequency of the drive pulses, which is obtained by dividing the system frequency signal into different frequencies. Considering the maximum input pulse frequency of the motor driver in this mode is 200 kHz, the actual working speed range of this module is designed to be 6.1 gm/s to 25 mm/s, with a theoretical maximum working speed of 1/25 mm/s. To improve measurement accuracy, grating counting modules typically subdivide the input grating signal, i.e., multiply the input signal. A subdivision direction-discriminating circuit was designed, which can identify the movement direction of the moving grating while subdividing the grating signal. Since a 600-line grating ruler is used on the table, the resolution achievable after the grating signal is processed by the 4-subdivision direction-discriminating circuit is approximately 0.42 μm (1/2 × 0.25 ≈ 0.42 μm). The principle of direction discrimination is based on the relative relationship between the two orthogonal pulses sin and cos of the grating ruler. The motion of the moiré fringes is converted into the circular motion of small dots crossing quadrants [7], and the direction of the circular motion determines the direction of the measured displacement. Assuming that at the instant of crossing a certain quadrant, the previous states of sin and cos are sin 1 and sin 2 respectively, then from the states of adding 1 and subtracting 1, the four-part subdivision direction discrimination logic is (let sin = A, cos = B): Figure 3 is the circuit schematic diagram built in QUAR TUS II based on this four-part subdivision direction discrimination logic. Figure 4 is the effect diagram obtained by timing simulation of the circuit. It can be seen that the simulation result is: after the two orthogonal grating signals sin and cos are input into the circuit, they become a four-fold frequency-multiplied MINUS signal output, and when the cos signal leads by 90°, it represents the positive motion of the moving grating, at which time the MINUS signal is effective; when the sin signal leads by 90°, the MINUS signal is effective. The signal is valid when the moving grating moves in the negative direction, which is consistent with the pre-requirement. Actual testing also proves that the designed four-part subdivision and direction-sensing circuit is successful. The grating counting module also integrates a 32-bit counter and a subtractor to perform reversible counting of the direction-sensing signal. This count value is transmitted to the host computer via the Avalon bus and can be converted into a position signal. It serves as feedback information for the closed-loop circuit to control the motor and piezoelectric ceramics to fine-tune the working platform, achieving higher positioning accuracy. The structure of the grating counting module designed based on this idea is shown in Figure 5. A bit counter is used here. In most applications, the system will not experience counter overflow. That is to say, when using this system for grating measurement, there is no problem of the grating ruler not counting properly due to excessive stroke. Therefore, it is also suitable for motion control of large equipment such as CNC machine tools. Software design: After completing the hardware development of the SOP C system in QUARTUS II 7.2, the system software program needs to be written using the software compilation environment. The software environment is similar to a general C language compilation environment. The difference is that before performing read and write operations on custom external devices such as motor drive modules and grating counting modules, it is necessary to define special read and write functions. These functions are placed in the software system as header files for calling. The following is a list of function definitions for reading and writing to the grating counting module. — avalon _Gr ting _ 3 2 一regs — h 一— a he ra _ avalon — Gr ating 一3 2 一regs _h 一. —ALTERA—AVALON—Gr ating—enable( base ,, 0,—AVALON—Gr ating — enable ——ALTERA—AVALON—Gr ating—,—AVALON————ALTERA—AVALON—Gr ating—CLR( base,, 2,——— Figure 6 is the main program flowchart of this SOP C system. It can be seen that three working modes are set in the main program. In this system, different DC signals of varying amplitudes are generated using pulse width modulation (PWM) technology and applied to the grating signal processing circuit. Any mode can be entered through the upper-level application software interface to control the movement of motors along different axes, read real-time grating count values ​​for different axes, etc. Furthermore, the same mode can be repeatedly entered to send commands to different axial functional modules, achieving multi-axis linkage and joint measurement. If a working mode is selected in the main program, it jumps to the corresponding subroutine for execution; otherwise, the main program sends an error signal to the host computer and continuously reads data from the DI port until a new control command arrives. Figure 7 shows the flowchart of the motor drive mode program. After this program flow, the SOPC system can completely receive motor control commands and then transmit this information to the motor control module via the internal Avalon bus to achieve specific control tasks. Figure 8 shows the flowchart of the grating reading mode program. The host computer can enter this mode at any time to read the grating count value for any axis. This value, after certain processing, becomes feedback information used as input for the motor drive mode or as input for piezoelectric ceramics to precisely position the multi-dimensional stage. Figure 9 shows the difference between two consecutive count values. It can be seen that Δf exhibits a good linear distribution under different speeds and directions. Using EXCEI software, the slopes of their fitted lines are: l = = = 1975.6, k = 1961.1. The relative error between the count value and the slope of the fitted line is approximately 0.73, indicating that the grating counting module can obtain very consistent count values ​​for the motor running the same displacement continuously at different speeds, which verifies the stability of the system. Figure 10 reflects the relative error of a single pulse drive under different speeds and directions. It can be found that the relative error of a single pulse drive under different conditions is -0.99; the average relative error is as small as -0.301, which shows that the actual grating count value is very close to the theoretical value, further proving the reliability of the grating count value. Experiment and Analysis To verify the reliability and stability of the system, the following experimental steps were designed. Table 1 shows the results under the given pulse number P = 2 - 96. Under the condition, the grating counting module obtains the count values ​​of the servo motor at different speeds and in different directions. The relative error of one pulse displacement: due to the difficulty in making the screw pitch completely uniform, and the presence of flexible connecting parts in the mechanical transmission process, the motor cannot travel according to the theoretical distance, which is the main reason for the deviation between the grating count value and the theoretical value. In actual work, in order to obtain higher positioning accuracy, piezoelectric ceramics are used to generate micro-displacement for positioning. At this time, the actual displacement of the worktable can be measured by the grating counting module. Therefore, the actual positioning accuracy is closely related to the detection accuracy of the grating. References Zhao Yugang , Zhou Weifang, Bai Qinghua. Design of grating displacement detection system based on FPGA [J]. Mechanical and Electrical Engineering Technology, 2008, 37 (4): 57-58. Jie Degang, Liu Yanjie, Sun Lining. High-speed and high-precision displacement measurement method based on dual grating ruler [J]. Optical Precision Engineering, 20 0 7 , 1 5 ( 7 ): Huang Tao, Cheng Xin. Application of FPGA in high-speed and high-precision motion control system [ J ]. Journal of Wuhan University of Technology. Information and Management Engineering Edition, , 2 9 ( 2): 28-31. Wang Chengyuan, Chang Guoxiang, Xia Jiakuan. Design of new grating signal interface IC. Journal of Electrical Engineering and Control, 2 0 0 7, 3 7 ( 4 ): 4 2 1 — 4 2 4. Zhou Ligong. SOPC Embedded System Basic Tutorial I - M ]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2 0 0 6. Sun Kai. Ni os II System Development Design and Application Examples [ M ]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2 0 0 7. Wang Xuanxuan. Orthogonal diffraction grating metrology principle and its application on ultra-precision worktable [ D ]. Wuhan: Huazhong University of Science and Technology Library, 2004. Click here to download materials: Multidimensional High-Precision Motion Control System Based on SOPC. Editor: He Shiping
Read next

CATDOLL Himari Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22