Design and Implementation of a Multi-Axis Motion Controller Based on STM32 and FPGA

**Introduction** The numerical control (NC) system has become an essential part of the industrial and mining sectors. A computer numerical control (CNC) system works by processing digital information, converting it into pulse signals, and using these to control motor operations, thus enabling precise machining of parts. As embedded technology continues to evolve, it is now possible to develop smaller, more cost-effective, and specialized systems that can perform tasks traditionally handled by conventional CNC systems. **1. Design Plan** This system is built around the STM32 microcontroller and an FPGA chip, with the motion control logic implemented in the FPGA. This hardware-software hybrid approach offers flexibility, reconfigurability, high performance, and reliability. The system block diagram is illustrated in Figure 1.

Design and Implementation of a Multi-Axis Motion Controller Based on STM32 and FPGA

Figure 1: System Principle

The STM32 reads data from an SD card and performs necessary algorithmic processing. The initial speed, maximum speed, acceleration values, and other control parameters are set via a keyboard scanning circuit. These settings are then sent to the FPGA for further processing. The FPGA controls the output pulses and the time between them, which are isolated through a high-speed optocoupler to drive the motors. Communication with the host computer is achieved via RS232, while an LCD interface enables human-computer interaction. The FPGA handles key functions such as command and data processing, acceleration/deceleration control, and interpolation algorithms (including linear and circular interpolation). **2. Implementation of Motion Control Algorithm in FPGA** **2.1. Implementation of Speed Control Algorithm in FPGA** To prevent over-travel, impact, or oscillation during startup, movement, or speed changes, smooth and accurate positioning of the moving mechanism is crucial. This requires a controlled acceleration and deceleration process for each axis. Most motion control systems use either trapezoidal or S-shaped acceleration profiles. Due to its simplicity, fast response, and efficiency, this project improves upon the traditional trapezoidal method to achieve pulse-based control. The trapezoidal acceleration/deceleration algorithm uses a pulse superposition technique, implemented within the FPGA. It divides a reference clock into n parts, generating n non-overlapping pulses of different frequencies. By combining these pulses using equation (1), the system can produce continuously adjustable frequency outputs for smooth acceleration and deceleration. Equation (1):

Design and Implementation of a Multi-Axis Motion Controller Based on STM32 and FPGA

As shown in equation (1), f₀ / 2ⁿ represents a frequency division of the reference pulse. The number of bits in the frequency division counter determines the range of generated pulse frequencies. The coefficient a[N:0] indicates the number of pulses per unit time, i.e., the pulse rate. Based on this, the system's logic structure is designed as shown in Figure 2.

Design and Implementation of a Multi-Axis Motion Controller Based on STM32 and FPGA

Figure 2: System Logic Structure Circuit

Hydrogel Protector Film

When you think of the screen protectors of old, you're probably thinking of TPU. It's a flexible plastic that's a huge hassle to install . it's flexible, so it can go edge-to-edge on any phone, it has better impact protection than PET, and it has limited "self-healing" powers for small scratches. Brands like TUOLI offer TPU at very affordable prices,

On the other hand, TUOLI's comes in a few different styles depending on the look, feel, and features you want.



Tpu Screen Protector,Hydrogel Protective Film,Mobile Phone Screen Protector,Tpu Hydrogel Film,hydrogel protector, hydrogel sheet

Shenzhen TUOLI Electronic Technology Co., Ltd. , https://www.tlhydrogelprotector.com