3.1. Steering Motor Modeling for the Steering-by-Wire System
High-precision steering control is achieved by precisely regulating the phase and amplitude of the stator current in permanent-magnet synchronous motors, which offer a higher torque density for increased output torque [
26,
27,
28]. This characteristic makes permanent-magnet synchronous motors particularly well suited for steering applications that demand both high accuracy and substantial torque output. As a result, the steering motor is classified as a three-phase permanent-magnet synchronous motor.
The three-phase windings inside the motor are arranged at 120° intervals. The chain equation of the permanent-magnet synchronous motor (PMSM) in the ABC three-phase coordinate system is as follows:
In this context, , , and represent the magnetic chains of the three-phase windings. , , and denote the self-inductances of these windings, while , , , , , and indicate the mutual inductances between the three-phase windings. The currents in the windings are represented by , , and , and , , and denote the magnetic chains of the three-phase windings generated by the magnetic field of the permanent magnet’s excitation.
The voltage balance equation, typically employed in the context of permanent-magnet synchronous motors, is commonly written in the following form:
where
,
, and
are the phase voltages of the three-phase motor and
R is the three-phase stator resistance.
The equation for the motor’s electromagnetic torque is usually written as follows:
where
P is the number of pole pairs of the motor rotor.
To simplify the mathematical model of the complex nonlinear system of the permanent-magnet synchronous motor (PMSM) and aid in control decoupling, a coordinate system transformation is necessary.
After applying the Clarke and Park transformations, the three-phase coordinate system undergoes a transition to become a two-phase stationary system. Subsequently, the - coordinates are multiplied by a rotation matrix, thereby deriving the d-q coordinate system.
The current in the
d-
q coordinate system is given by
In the d-q rotating coordinate system, and represent the currents, while and represent the currents in the - rotating coordinate system.
As a result of the Park transformation, the equation expressing the voltage balance is given by
In the d-q rotating coordinate system, and denote the voltages.
The transformed electromagnetic torque equation is
where
and
are the magnetic chains of the d and q axes, respectively.
The equation shows that the motor’s electromagnetic torque can be controlled by adjusting the magnitude of the q-axis current.
3.2. Improved SSA-PID Algorithm
This study uses the SSA-PID control algorithm to adjust the motor angle. The parameters of PID control (
,
, and
) can be set by humans, and the control parameter values can be gradually changed to change the control effect. However, this method is very cumbersome, as it is not only time- and labor-consuming but also fails to reach the ideal state in terms of the control effect [
29]. Using the sparrow search algorithm to determine the parameters can enhance both control stability and effectiveness. The PID controller, in conjunction with the optimization algorithm, is utilized for motor corner-tracking control, effectively enhancing the corner-following capability and steering motor accuracy. The control strategy is illustrated in
Figure 3.
Several improvements were proposed to the sparrow search algorithm (SSA) to improve its convergence speed and accuracy. Modifications were made to overcome the SSA’s tendency to converge to local optima and enhance population diversity. A human learning mechanism was introduced to modify the update method for the individual with the worst fitness, promoting greater population diversity. Additionally, the Cauchy and Gaussian variation methods were applied to determine the step size of the variation for each individual based on its ranking position. Furthermore, the global search capability of the SSA’s alarmers was enhanced through the implementation of spiral variation. To further accelerate the convergence speed, the number of alarmers was optimized using a linearly decreasing approach. The improvements are described as follows:
- (1)
Sparrow Algorithm Based on Human Social Learning Behavior
As the algorithm iterates, each individual in the population approaches the optimal value, resulting in a rapid decline in population diversity and a reduction in convergence accuracy [
30]. To solve this problem, the idea of human social learning behavior is introduced to improve population diversity. Improvements are made to the updating method for individuals in the population through this idea. The specific improvements are detailed below.
The worst-adapted individual during each iteration, i.e., the worst individual globally,
, is defined as follows:
The learning factor
is introduced into the position update process for population individuals to simulate human social learning behavior. This factor is defined as a random number following a standard normal distribution,
N (0,1). When
, learning among the population individuals is facilitated, resulting in increased energy values and improved global optimization capabilities of the algorithm. In contrast, when
, a penalty is applied to learning, improving the algorithm’s local search capability. To lessen the impact of a single parameter on the algorithm’s optimal solution, two additional random learning factors,
and
, are introduced. These factors are defined as random numbers within the interval [0, 1] and follow a uniform distribution, with the constraint that
. The position update formula is then revised as follows:
In this context, represents the updated position of the population individuals, denotes the current position, signifies the historical optimal solution, and indicates the global optimal solution.
- (2)
Cauchy–Gaussian Variation Strategy
To address the issue of sparrow individuals in the sparrow algorithm tending to experience individual assimilation in the later iterations, which leads to locally optimal solutions, a Cauchy–Gaussian mutation strategy is introduced. Following the mutation of individuals with optimal fitness using the Cauchy–Gaussian operator, a comparison of their positional energy values before and after the mutation is made. The individual exhibiting the highest positional energy value is selected for substitution in the subsequent iteration [
31]. The formula is as follows:
In this context,
is designated as the position of the optimal-fitness individual following the mutation,
represents the position of the current optimal individual, and
denotes a randomly selected individual in the
d-th dimension and
k-th instance. The parameters
and
are updated throughout the iterations. The function
represents a random parameter that follows the Cauchy distribution, while
represents a random parameter that follows the Gaussian distribution.
- (3)
Adaptive Predictive Warning Based on Spiral Exploration
To address the sparrow algorithm’s rapid convergence and strong optimization ability, as well as its tendency to fall into local optima, an updating strategy is proposed. This strategy enables the proportion of early-warning individuals to undergo a spiral change with respect to the number of iterations. In the first half of the algorithm’s iterations, the spiral change enhances the global search capability. In the second half, the quantity of early-warning individuals is decreased using a linear-decreasing method. This approach aims to avoid local optima and improve the algorithm’s convergence speed. The update process for the number of alarmers is as follows:
In this context, represents the proportion of early warners, z denotes the spiral exploration factor, t indicates the current iteration number, is a random number between 0 and 1, is the maximum number of iterations, is the maximum number of early warners, and is the minimum number of early warners. The maximum number of early warners is set to 20% of the population, while the minimum number is set to 10%.
Based on the improved strategy described above, the improved hybrid sparrow search algorithm (HSSA) is proposed, and its flowchart is illustrated in
Figure 4. To validate the optimization capabilities of the HSSA, both single-peak and multi-peak functions are employed to assess the convergence speed and accuracy. The functions to be tested are listed in
Table 1, and the results are shown in
Figure 5. Functions F1 to F3 are associated with single-peak functions, which typically contain a single global optimal solution. In contrast, functions F4 to F6 represent multi-peak functions, which are characterized by multiple locally optimal solutions. Single-peak functions are utilized to evaluate the algorithm’s convergence accuracy and speed, whereas multi-peak functions are primarily used to examine the algorithm’s capacity to escape local optima [
32].
Figure 5a–f show the solution iteration results of the HSSA and SSA for test functions F1 to F6, respectively.
The convergence curves for the test functions in
Figure 5 reveal that functions F1, F3, F4, and F5 display slow convergence prior to 300 iterations. This is attributed to the introduction of the Cauchy–Gaussian variation strategy, human learning mechanism, and warning mechanism of spiral exploration, all of which preserve population diversity and enhance the global exploration capability. After 300 iterations, a decrease in the number of individuals is observed, resulting in an enhanced speed of convergence and increased accuracy of the algorithm. Functions F2 and F6 are observed to reach local optima between 300 and 700 generations. The hybrid improvement strategy enhances the algorithm’s ability to escape from local optima.
To assess the stability of the improved algorithm, the means and standard deviations of the test results were calculated and are shown in
Table 2. The standard deviation of the hybrid sparrow search algorithm (HSSA) was lower than that of the ordinary sparrow algorithm (SSA), suggesting improved stability. Furthermore, the average value was found to be closer to the optimal value, indicating an improvement in the optimization capability of the HSSA. Overall, the results demonstrate that the HSSA converges faster and achieves higher accuracy compared to the SSA.
3.3. Simulation Analysis of the Steering Motor
The improved hybrid sparrow search algorithm (HSSA) was utilized for the parameter adjustment of PID control. The three PID parameters were defined as the population individuals in the sparrow algorithm. A target corner was defined according to the steering motor’s operating conditions. The algorithm then automatically adjusted the PID controller’s parameters based on the cornering error’s fitness value. This adjustment aimed to stabilize the actual corner of the motor near the target value.
The first step was to set the sparrow population size to 30, ensuring a broader solution space. Typically, the population size ranges from 30 to 50, with explorers making up 10% to 20% of the total. The algorithm was set to a maximum of 100 iterations. The upper and lower bounds for the initialization position (UB and LB) were determined based on the dimension of the benchmark function. To enhance search response speed, the safety value (R2) and warning value (ST) were set between 0.6 and 0.8, as shown in
Table 3.
Figure 6a displays the simulation results of the motor angle under double-lane-change conditions at a vehicle speed of 60 km/h, while
Figure 6b shows the results at a speed of 90 km/h. Similarly,
Figure 7a presents the simulation results of the motor angle under sine-wave conditions at 60 km/h, and
Figure 7b illustrates the results at 90 km/h.
Table 4 presents a summary of the simulation results for the double-lane-change conditions, displaying the mean and standard deviation of the steering motor angle deviations at vehicle velocities of 60 km/h and 90 km/h. At 60 km/h, the mean steering angle error with HSSA-PID control was 0.3582°, and the standard deviation was 0.3625, representing reductions of 74.58% and 76.02%, respectively, compared with SSA-PID control. At 90 km/h, the mean error with HSSA-PID control was 0.3516°, and the standard deviation was 0.3220, indicating decreases of 57.24% in the mean error and 53.07% in the standard deviation compared with SSA-PID control.
The simulation results for the sine-wave conditions, including the mean and standard deviation of the steering motor angle errors at vehicle speeds of 60 km/h and 90 km/h, are presented in
Table 5. At 60 km/h, a mean steering angle error of 1.3505° was observed with HSSA-PID control, and the standard deviation was recorded at 2.0185°. These results indicate reductions of 8.88% in the mean error and 20.04% in the standard deviation when compared with SSA-PID control. At 90 km/h, the mean error with HSSA-PID control was observed to be 0.9567°, with a standard deviation of 1.2722°. This reflects decreases of 23.50% in the mean error and 26.83% in the standard deviation relative to SSA-PID control.
According to the simulation results of the step condition, the maximum overshoot of the amplitude under the control of HSSA-PID was reduced by 2.96% compared with the maximum overshoot under the control of SSA-PID. When the load was added at 0.7 s, the peak time and steady-state error under HSSA-PID control were not significantly different from those of SSA-PID, but they were improved compared with SMC and MPC.The simulation results are shown in
Figure 8 and the specific data are shown in
Table 6.