1. Introduction
In the fields of aerospace manufacturing and industrial high-speed servo motion control, the presence of a large number of short segments in motion trajectories can easily lead to workpiece overcut due to insufficient acceleration and deceleration processes, while frequent speed changes may also cause abnormal vibration of machine tools. Traditional speed control methods struggle to meet the demands of high-speed machining, as their frequent acceleration and deceleration during trajectory operation impose substantial impact on the machine structure, thereby hindering the achievement of high-speed and high-precision machining objectives [
1].
As a critical component of motion control systems, acceleration and deceleration control regulates the input signals of servo or stepper motors in a systematic manner to achieve smooth speed transitions [
2]. This approach aims at preventing motor stalling, reducing mechanical impact and wear, and optimizing the system’s velocity and trajectory response performance. In CNC machining, implementing smooth acceleration and deceleration control during tool start–stop and path transition processes facilitates the enhancement of machining efficiency, improvement of surface quality, and assurance of machining accuracy [
3].
Currently, common acceleration and deceleration velocity profiles in CNC systems mainly include trapezoidal, exponential, S-curve, polynomial, and trigonometric function curves [
4,
5,
6,
7,
8]. These curves differ in computational complexity and motion control performance, and their mathematical expressions can all be represented as time functions
. Although their specific forms vary, the continuity of
itself, as well as its first derivative (acceleration) and second derivative (jerk), serves as an important indicator for evaluating whether a velocity profile can enhance the motion smoothness of machine tools and achieve flexible machining.
Trapezoidal and exponential acceleration/deceleration profiles exhibit abrupt changes in acceleration [
9], which can induce shocks during high-speed operation and are detrimental to the stable motion of machine tools. In contrast, polynomial curves of cubic and higher orders demonstrate continuity in both acceleration and jerk, while trigonometric curves possess the characteristic of continuity at any order of derivatives, making them theoretically well-suited for flexible machining [
10]. However, both types of curves suffer from high computational complexity, and their overemphasis on smoothness leads to sluggish speed response, making it difficult to guarantee precise endpoint positioning in point-to-point motion under low-complexity constraints. In contrast, the S-curve acceleration/deceleration profile achieves a better balance between control complexity and positioning accuracy through an optimized algorithmic structure and control structures, making it more suitable for point-to-point motion control scenarios that require both precision and real-time performance [
11].
The FPGA implementation of PID controllers has become a research hotspot [
12]. Numerous achievements have been made both domestically and internationally regarding the integration of S-curve acceleration/deceleration algorithms and PID control methods with FPGA technology, leading to a wide range of applications. Chen et al. [
13] addressed the challenge of balancing flexibility and low oscillation in S-curve speed regulation for open-loop stepper motor control by proposing a hybrid S-curve planning method. This method, implemented online using FPGA, significantly improves computational speed while ensuring positioning accuracy. Lu et al. [
14] proposes a high-precision, vibration-suppressed 4th-order S-curve trajectory planning method for a novel multi-channel double crystal monochromator (DCM) in QXAFS. The method significantly improves positioning accuracy, reducing maximum tracking error to 5.9 arcsec at 36 Hz, compared to conventional trajectories. Liu et al. [
15] addresses shock and jitter in a quadruple-speed manipulator caused by its long cantilever. It models the system, optimizes its motion trajectory, and validates improvements through experiments, achieving a minimal tracking error of 0.16 mm. Similarly, Cui et al. [
16] tackled the issue of poor flexibility and difficulty in achieving low oscillation in S-curve speed regulation for open-loop stepper motor control. They introduced an online control method for a hybrid S-curve velocity profile. Kuo et al. [
17] integrated S-curve trajectory planning into an advanced PID control scheme for a linear motor, serving as the core motion profile. Combined with other techniques, it enabled micron-level precision of 1.5 µm error within an ultra-fast settling time of 0.08 s. Olmedo-García et al. [
18] proposes a fuzzy logic controller (Tsukamoto method) for DC motors, comparing it with a PID controller across parabolic, trapezoidal, and S-curve trajectories. Results confirm the fuzzy controller significantly reduces energy consumption up to 11.77% savings with statistical relevance. Wang et al. [
19] proposes a compound control strategy for micro-brushed DC motors, integrating a double-loop structure, velocity profile, and optimized feedforward control, reducing the maximum tracking error from 23.75° to 2.7°. Wu G [
20] introduces a modified S-curve trajectory algorithm with continuous jerk for robotic point-to-point tasks. It optimizes execution time under kinematic limits, maintains saturated acceleration/jerk for efficiency, and integrates multi-axis synchronization to enhance motion smoothness and reduce residual vibrations. Aunet and Hagen [
21] implemented multi-mode control and S-curve planning for stepper motors on an Artix-7 FPGA, verifying its ability to control multiple motors in parallel while maintaining accuracy. However, they also concluded that the S-curve algorithm significantly increases computation complexity. Wu et al. [
22] proposes an anti-windup PID control scheme combined with S-curve motion planning for X-Y tables. It effectively mitigates actuator saturation, reduces tracking errors to ±11.23 mm (X) and ±13.63 mm (Y), and improves positioning smoothness. Guo et al. [
23] proposes a NURBS curve interpolation strategy for industrial robots, incorporating kinematic and dynamic constraints with S-curve feedrate planning to reduce roughness and contour error. Bussola et al. [
24] presents an offline motion planning method that integrates curvature-based speed modulation with jerk- and acceleration-limited S-curves. It automatically smooths trajectories under dynamic constraints, reducing vibration and execution time. Fang, Y. et al. [
25] presented a smooth and time-optimal S-curve trajectory planning method. This algorithm offers high curve smoothness and small time lag, effectively achieves smooth and continuous jerk, and reduces minor impacts. Wu and Zhang [
26] proposed a jerk-continuous trajectory planning method for robotic arms based on a fourth-order S-curve. Utilizing a multi-axis synchronization algorithm, it achieves smooth motion and generates real-time trajectories that meet kinematic constraints without iterative optimization. Halinga et al. [
27] proposes a motion planning method that simultaneously optimizes path and velocity to balance time and energy consumption, using multi-objective optimization and harmonic motion to smooth jerk for improved accuracy and energy savings.
In summary, although the S-curve acceleration/deceleration algorithm can achieve smooth speed control and further enhance curve smoothness by increasing the polynomial order, its high computational complexity is detrimental to precise position control. Although higher-order polynomials exhibit superior continuity, they are prone to increased oscillation and numerical precision degradation, which may instead lead to deterioration in motion performance [
28]. Furthermore, the introduction of a large number of high-order terms not only increases the difficulty of solving polynomial coefficients but also imposes a significant computational burden.
In this paper, we propose an a high-precision S-curve profile with a single-neuron adaptive PI cascade controller for motion control. The method retains trapezoidal planning efficiency while ensuring jerk continuity. Its adaptive dual-loop control adjusts parameters online, significantly improving tracking accuracy and enabling precise positioning across varying motion conditions. This enhances motion smoothness and system responsiveness, as validated by simulations and experiments.
3. Path-Tracking Control Algorithm for S-Curve Acceleration and Deceleration Planning
Trapezoidal velocity planning suffers from discontinuous acceleration curves, which can introduce shocks detrimental to system operation. From a mechanical perspective, abrupt acceleration changes may cause equipment vibration or even structural damage [
32]. To achieve precise positioning in high-speed servo motion, it is necessary to ensure not only positioning accuracy but also the continuity of jerk by adopting an S-curve acceleration/deceleration strategy. Accordingly, in this paper, we propose an improved S-curve planning method based on the trapezoidal framework, integrated with a single-neuron cascade PID controller to achieve high-precision position tracking.
Cascaded PID control systems are typically employed in complex control applications to achieve higher precision [
33]. However, traditional cascaded PID controllers, with their fixed parameters, struggle to effectively handle nonlinear and time-varying operating conditions. In this paper, a single-neuron PID controller with self-learning and adaptive capabilities is introduced. By dynamically adjusting the neuron’s weighting coefficients through an iterative algorithm, the PID parameters are tuned in real time, enabling rapid and accurate position tracking and enhancing the control precision of the stepper motor. Given the sensitivity of the derivative term to high-frequency noise, and considering the presence of electromagnetic interference and sensor sampling noise in practical industrial motion control environments, the proposed single-neuron PID controller does not incorporate a derivative unit, retaining only the proportional and integral terms. The controller output drives the actuator, while the system output is fed back to the input, forming a closed-loop control structure.
Figure 4 illustrates the configuration of this single-neuron PID controller.
Both the position loop and the speed loop employ a three-layer feedforward neural PID network, forming a dual closed-loop control structure with the outer loop for position control and the inner loop for speed control. The three-layer feedforward PID network consists of an input layer, a hidden layer, and an output layer. For the position layer, the input layer contains two neuron nodes that receive the target position input
and the actual rotor position
from the encoder, respectively. The hidden layer comprises two neuron nodes responsible for implementing the proportional and integral functions. The output layer consists of a single neuron node that yields the computed result of the neural position PID, which serves as the reference input for the neural speed PID controller. This output is then processed along with the actual rotor speed feedback from the encoder. Finally, the computed result from the speed PID controller is delivered to the stepper motor. The system block diagram of the dual closed-loop position-speed control for the stepper motor using the single-neuron PID controller is shown in
Figure 5. For clarity of presentation, the stepper motor driver is not included in the diagram.
As shown in the figure above, the block diagram consists of a speed loop and a position loop, forming a dual-loop control system. In the specific implementation of this system, the desired value and the feedback value are directly fed as two independent inputs into the single-neuron cascade PID controller. the error value is calculated, the controller adjusts the control signal in real time to drive the system, enabling the actual output to converge toward the desired value and thereby achieving the control objective. Considering the high-frequency noise interference associated with the derivative term, we employ the proportional and integral terms for control. The corresponding discrete-time system formula for the series-cascaded PID controller is as follows [
34]:
In a dual-loop control system, the control output of the position loop (outer loop) is the velocity signal , with the desired position being the input and the actual position the output. In this configuration, the control objective of the position loop is to ensure that the actual position matches the desired position . The relationship between position and velocity can be described by an integral.
In this paper, since only the proportional and integral actions are employed, the discrete transfer function of the incremental PI controller for the position loop is given as follows:
In the dual-loop control system, it should be noted that both the inner and outer loops require an integrator for control, which corresponds to the integration relationship from position to velocity. In the discrete-time domain, this integration relationship can be expressed as follows:
If the sampling time period T is 1, then the integration relationship can be expressed as follows:
The discrete transfer function of the incremental PI controller for the speed loop is given as follows:
Assuming the transfer function of the controlled plant (motor) is a first-order system:
The system is discretized using the bilinear transformation. Let the sampling period be denoted as
:
Thus, the discrete transfer function of the controlled object is
The inner loop transfer function includes the transfer function of the inner loop PI controller and the controlled object:
The transfer function of the position loop, speed loop PID controller, and the transfer function of the controlled object are concatenated to obtain the total transfer function:
The corresponding closed-loop transfer function is given as follows:
The stability of the overall system depends on whether all the system poles lie inside the unit circle in the Z-plane. By setting the denominator of the closed-loop transfer function to zero and substituting the overall transfer function into it, we obtain the characteristic equation after simplification:
Set
and
. Expansion yields a higher order polynomial, whose roots represent the poles of the closed-loop system:
The roots of this polynomial can be solved using the Jury stability criterion, and the root locus is determined by four parameters, , , , and , which correspond to the four weighting values at discrete time instants (, , , and ). By dynamically adjusting these weights through the single-neuron PID control system, precise motion tracking is achieved.
The online adjustment of the weights enables real-time self-tuning of the cascaded single-neuron PID controller, with the supervised Hebb learning rule as its core mechanism. Specifically, for the position loop controller, let the position error input at time
, and the output velocity command be
. The proportional and integral weights are denoted as
and
, respectively, and are updated according to the following formulas:
and represent the learning rates for the proportional and integral terms, respectively. These adjustable parameters determine the step size and convergence speed of the value adjustments. denotes the proportional state, reflecting the magnitude of the current error, while indicates the status of the expression, reflects the accumulation and variation in the error over time.
The speed loop obtains the proportional and integral weight values in the same manner as the above formula;
and
, respectively, represent the speed error at the current moment and the historical cumulative sum of the speed error.
Speed error is expressed as
, the pulse output at time step
is represented as
, which is used to drive the actuator.
Assume that the inputs to the neuron
and
are bounded. Furthermore, assume there exists a set of ideal constant weights
and
, when
, the steady-state tracking error is zero,
, The weight estimation errors are defined as
, A Lyapunov function candidate is defined as in Equation (28):
The forward difference
can be expressed as:
Substituting the weights from Equations (25) and (26) into the definition of the weight error and combining it with Equation (29), the following expression
is obtained:
When the learning rates and are within the range of (0, 2), holds consistently. According to the Lyapunov stability proof, is non-increasing and has a lower bound, the velocity tracking error, converges asymptotically to zero. Consequently, tends to zero, meaning the weights cease to change and converge asymptotically to constant values. The smooth variation in the weights, denoted by , ensures that the control input derived from the linear combination of the converged weights and the bounded errors according to Equation (27) is also smooth, and its increment is bounded.
In a discrete-time system, the following equation holds:
Since acceleration is proportional to the velocity , and jerk is proportional to , the analysis above thus verifies the smoothness of the acceleration profile and the boundedness of the jerk, thereby guaranteeing the smoothness of the motion.
In each control cycle, the system sequentially performs three operations: computation, execution, and adjustment, enabling dynamic adaptive regulation. Based on the current error and weighting parameters, it calculates the optimal control quantity . When this quantity is transmitted to actuators like motors, the system responds by generating a new speed. The feedback then yields a new speed error, which drives the execution phase. Finally, the execution results are used to adjust the proportional weights and integral weights, thereby achieving intelligent control of the overall motion.
In this paper, we present a hierarchical single-neuron adaptive PI control scheme for a cascaded dual-loop system with an outer position loop and an inner velocity loop. Unlike traditional explicit multi-spline S-curve planning methods, the method proposed in this paper can adaptively adjust weight parameters. So the acceleration of the planned movement is smooth and the precise arrival of various complex movement situations is realized. Its core innovation lies in mapping traditional PI parameters to adaptive neuron connection weights. The position and velocity neuron controllers dynamically adjust their weights online based on tracking errors, enabling cooperative learning. This structure ensures precise positioning and dynamic response in the outer loop, along with smooth speed regulation and disturbance rejection in the inner loop. By omitting the derivative term, the system avoids high-frequency noise interference, significantly improving adaptability to nonlinear conditions while enhancing control performance.
Figure 6 displays position, velocity, acceleration, and jerk with single-neuron cascaded PID control.
Compared with traditional trapezoidal acceleration/deceleration, the proposed method, which integrates S-curve planning with a single-neuron PID controller, successfully achieves a smooth and continuous acceleration transition during start–stop phases. The single-neuron adaptive mechanism dynamically adjusts control parameters in real-time, effectively eliminating the mechanical shock caused by abrupt acceleration changes in trapezoidal algorithms. This significantly enhances the operational smoothness and control accuracy of the system. Furthermore, for the various intelligent S-curve motion scenarios described in
Section 2.1, the system maintains precise motion positioning, which is attributed to the adaptive tracking capability of the single-neuron PID controller under varying conditions.
4. Simulation and Experiment
- (1)
Simulation of Single-Neuron PID Control Weights
The learning rate is a hyperparameter that needs to be preset. Through training, a grid search was conducted on different combinations of learning rates using Maximal Jerk and Relative Error as metrics. After balancing these factors, a combination of learning rates with low Relative Error and low jerk peak was selected.
Taking the learning rates as 0.20, 0.20, 0.15, and 0.10, the single-neuron PID control algorithm was simulated in MATLAB R2021b environment, where the PC setup involved AMD Ryzen7 4800 H 2.90 GHz processor from Santa Clara, CA, USA and the normalized dynamic adjustment process of the proportional and integral weights is shown in
Figure 7. The two sets of parameters for the cascaded PID inner and outer loops were dynamically adjusted separately after normalization. The results show that the weights of the control components underwent rapid adaptive adjustments during the initial stage and stabilized around 0.1 s, with continuous optimization of PID parameters. This verifies the excellent response speed and strong adaptive performance of the control strategy.
- (2)
Simulation and Experimental Verification of Motion
In the actual test environment, the parameters were reconfigured as follows: the acceleration was set to 500 pulses/s
2, initial speed to 1500 pulses/s, target speed to 3000 pulses/s, and target position to 30,000 pulses. The test was conducted with a sampling rate of 20 MHz. After the incorporation of the single-neuron PID controller for real-time parameter adjustment, the system was simulated in MATLAB. Furthermore, to validate the algorithm’s effectiveness, a comprehensive test platform was constructed, linking the program test board to a waveform recorder. The board was simultaneously connected to a three-axis test platform for experimental verification. The experimental setup is illustrated in
Figure 8.
The entire motion cycle was recorded using a waveform recorder, capturing the actual PWM output during S-curve acceleration and deceleration.
Figure 9 illustrates the resulting motion profile, highlighting the acceleration, constant-velocity (labeled 1), and deceleration (labeled 2) phases. The phase after deceleration is labeled as three. A detailed view of the constant-speed, deceleration, and post-deceleration phases reveals each PWM waveform’s duty cycle and control period. The constant-speed phase exhibits a higher duty cycle with denser pulses. During deceleration, both the pulse frequency and duty cycle gradually decrease, confirming the stability of the S-curve planning module. After deceleration, the duty cycle becomes significantly lower, and the waveform shows greater discontinuity.
The actual measured data are integrated to generate comparative plots of velocity, acceleration, and jerk, with the corresponding experimental results illustrated synchronously in
Figure 10,
Figure 11 and
Figure 12.
After incorporating the single-neuron cascaded PID for regulation, the system’s velocity and acceleration curves exhibit excellent continuity and smoothness, with no abrupt changes or oscillations, which fully validates the superior performance of the proposed control strategy in ensuring overall motion smoothness. The method effectively mitigates the shock problems inherent in traditional algorithms during acceleration and deceleration, significantly improving motion steadiness.
By converting the peak change in acceleration during the motion, the values shown in
Table 1 are obtained. Compared with other algorithms reported in the literature, the proposed intelligent S-curve algorithm yields a smaller maximum acceleration change, reflecting the overall system’s favorable smoothness characteristic. Motion is continuous at the C
3 level, representing the continuity of the system’s jerk.
To comprehensively evaluate the tracking performance and dynamic adaptability of the system, physical experiments were conducted on a hardware platform. Real time comparison between the planned position and encoder feedback was performed via a motion control board to acquire tracking error. Four velocity profiles, designed from kinematic relations among initial, target, and final speeds, were applied to cover key motion states including acceleration, constant speed, deceleration, and composite motion. The detailed experimental configurations are provided in
Table 2:
To evaluate the trajectory tracking performance of the system, this paper employs Maximum Error, Root Mean Square Error (RMSE), Relative Error, and Positioning Accuracy for comprehensive analysis. The specific results are shown in
Table 3:
The system achieves 100% positioning accuracy under four different speeds with a 30,000-pulse stroke. The Maximum Error is 25.3 pulses, and the RMSE is significantly lower than the Maximum Error. Both the RMSE and Relative Error are minimal, demonstrating the system’s exceptional tracking precision and robust stability.
Experimental data were collected from the physical hardware system via the host computer, and the resulting path-tracking diagram for the intelligent S-curve acceleration/deceleration motion is shown in
Figure 13. The figure clearly illustrates that the measured trajectory closely aligns with the planned path, with precise positioning achieved under all four test conditions.
The experimental results under multiple speed conditions demonstrate that the control architecture based on the single-neuron cascaded PID not only ensures smooth motion but also achieves high-precision position tracking, effectively guaranteeing accurate arrival at the target position.