FOA-Optimized SMC for In-Wheel PMSM Electric Motor Speed Control

In this study, I investigate the speed loop control of a PMSM electric motor for pure electric vehicles. The PMSM electric motor is a key component in in-wheel drive systems because it offers high efficiency, high power density, and fast dynamic response. However, the speed control of a PMSM electric motor is challenging due to nonlinearities, parameter variations, and external load disturbances. Sliding mode control (SMC) is a robust nonlinear control method, but it suffers from chattering and requires careful parameter tuning. To overcome these issues, I propose a fruit fly optimization algorithm (FOA) optimized SMC strategy for the PMSM electric motor speed loop. I establish the mathematical model of the PMSM electric motor, design the SMC controller, apply FOA to tune the controller parameters, and validate the performance through MATLAB/Simulink simulations under multiple operating conditions.

The PMSM electric motor has become the preferred choice for electric vehicle propulsion because of its high torque density and wide speed range. In-wheel PMSM electric motor configurations eliminate the mechanical transmission, reducing weight and improving overall drivetrain efficiency. Nevertheless, the direct-drive nature of an in-wheel PMSM electric motor exposes the speed control loop to road-induced load disturbances and parameter uncertainties. Therefore, a robust and fast speed controller is essential. My work focuses on combining the robustness of SMC with the global search capability of FOA to achieve improved speed regulation for the PMSM electric motor.

Vector Control of the PMSM Electric Motor

Vector control is the foundation of high-performance PMSM electric motor drives. I decompose the stator current into a flux-producing component and a torque-producing component in the d-q reference frame. The speed control loop regulates the rotor speed, while the current control loops ensure fast and accurate tracking of the current references. The PWM algorithm generates the switching signals for the inverter.

For the PMSM electric motor, the voltage equations in the d-q reference frame are given by:

$$u_d = R i_d + \frac{d\psi_d}{dt} – \omega_e \psi_q$$
$$u_q = R i_q + \frac{d\psi_q}{dt} + \omega_e \psi_d$$

The stator flux linkages are:

$$\psi_d = L_d i_d + \psi_f$$
$$\psi_q = L_q i_q$$

Substituting the flux equations into the voltage equations yields:

$$u_d = R i_d + L_d \frac{di_d}{dt} – \omega_e L_q i_q$$
$$u_q = R i_q + L_q \frac{di_q}{dt} + \omega_e (L_d i_d + \psi_f)$$

where \(u_d, u_q\) are the d-axis and q-axis stator voltages, \(i_d, i_q\) are the d-axis and q-axis stator currents, \(\psi_d, \psi_q\) are the d-axis and q-axis stator flux linkages, \(L_d, L_q\) are the d-axis and q-axis inductances, \(R\) is the stator resistance, \(\omega_e\) is the electrical angular speed, and \(\psi_f\) is the permanent magnet flux linkage.

The electromagnetic torque of the PMSM electric motor is:

$$T_e = \frac{3}{2} p_n i_q [i_d (L_d – L_q) + \psi_f]$$

For a surface-mounted PMSM electric motor, \(L_d = L_q = L_s\), so the torque equation simplifies to:

$$T_e = \frac{3}{2} p_n \psi_f i_q$$

The mechanical dynamics are described by:

$$J \frac{d\omega_m}{dt} = T_e – T_L – B \omega_m$$

where \(J\) is the moment of inertia, \(\omega_m\) is the mechanical angular speed, \(T_L\) is the load torque, and \(B\) is the damping coefficient.

The relationship between electrical and mechanical speeds is:

$$\omega_e = p_n \omega_m$$
$$N_r = \frac{30}{\pi} \omega_m$$
$$\theta_e = \int \omega_e dt$$

I use a cascaded control structure with an outer speed loop and two inner current loops. The d-axis reference current is set to zero for a surface-mounted PMSM electric motor to achieve maximum torque per ampere. The q-axis reference current is generated by the speed controller. The current loops use PI controllers. The PWM module uses space vector pulse width modulation (SVPWM) to generate the gate signals for the three-phase inverter.

Sliding Mode Control for the PMSM Electric Motor

Sliding mode control is a nonlinear control method known for its robustness against parameter uncertainties and external disturbances. I design a sliding mode speed controller for the PMSM electric motor. The general nonlinear system is:

$$\dot{x} = f(x, u, t)$$

The sliding surface is defined as:

$$s(x,t) = 0$$

The control law is:

$$u_i(x,t) = \begin{cases} u_i^+(x,t), & s_i(x,t) \gt 0 \\ u_i^-(x,t), & s_i(x,t) \lt 0 \end{cases}$$

For the PMSM electric motor, I use the state variables:

$$x_1 = \omega_{ref} – \omega_m$$
$$x_2 = \dot{x}_1 = -\dot{\omega}_m$$

From the mechanical equation, I obtain:

$$\dot{x}_1 = -\dot{\omega}_m = \frac{1}{J} \left( T_L – \frac{3 p_n \psi_f}{2} i_q \right)$$
$$\dot{x}_2 = -\ddot{\omega}_m = -\frac{3 p_n \psi_f}{2 J} \dot{i}_q$$

Let \(u = \dot{i}_q\) and \(D = \frac{3 p_n \psi_f}{2 J}\). The state-space model becomes:

$$\begin{bmatrix} \dot{x}_1 \\ \dot{x}_2 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} + \begin{bmatrix} 0 \\ -D \end{bmatrix} u$$

The sliding surface is chosen as:

$$s = c x_1 + x_2$$

Its derivative is:

$$\dot{s} = c \dot{x}_1 + \dot{x}_2 = c x_2 – D u$$

Using the exponential reaching law:

$$\dot{s} = -\varepsilon \operatorname{sgn}(s) – q s, \quad \varepsilon, q \gt 0$$

I obtain the controller:

$$u = \frac{1}{D} [c x_2 + \varepsilon \operatorname{sgn}(s) + q s]$$

Thus, the q-axis reference current is:

$$i_q^* = \frac{1}{D} \int_0^t [c x_2 + \varepsilon \operatorname{sgn}(s) + q s] d\tau$$

To prove stability, I choose the Lyapunov function:

$$V = \frac{1}{2} s^2$$

Its derivative is:

$$\dot{V} = s \dot{s} = s (-\varepsilon \operatorname{sgn}(s) – q s) = -\varepsilon |s| – q s^2 \lt 0$$

Thus, the system is asymptotically stable. The control parameters \(c\), \(q\), and \(\varepsilon\) determine the reaching speed and the chattering level. Poorly tuned parameters lead to large overshoot, slow response, or high-frequency oscillations. Therefore, I use FOA to optimize these parameters for the PMSM electric motor speed loop.

Fruit Fly Optimization Algorithm

The fruit fly optimization algorithm (FOA) is inspired by the foraging behavior of fruit flies. It is simple, easy to implement, and has few parameters. I use FOA to optimize the sliding mode parameters \(c\), \(q\), and \(\varepsilon\) for the PMSM electric motor speed controller. The optimization process aims to minimize a fitness function that combines overshoot, settling time, and integral of absolute error.

The FOA procedure is as follows:

  1. Initialize the fruit fly population and random positions.
  2. Perform olfactory search to generate new positions.
  3. Calculate the distance to the origin and the smell concentration judgment value.
  4. Evaluate the fitness of each individual.
  5. Find the individual with the best smell concentration.
  6. Update the population position.
  7. Repeat until the maximum number of iterations is reached.

I define the fitness function as:

$$J_{fit} = \int_0^T t |e(t)| dt + \alpha \cdot \sigma + \beta \cdot t_s$$

where \(e(t)\) is the speed error, \(\sigma\) is the overshoot, \(t_s\) is the settling time, and \(\alpha, \beta\) are weighting factors. I set \(\alpha = 1\) and \(\beta = 1\) in this study. The FOA parameters are listed in Table 1.

FOA Parameter Value
Population size 30
Maximum iterations 300
Dimension 3
Search range for \(c\) [0, 100]
Search range for \(q\) [0, 100]
Search range for \(\varepsilon\) [0, 100]

The optimized parameters are found to be \(c = 45.2\), \(q = 12.8\), and \(\varepsilon = 5.6\). These values are used in the FOA-SMC controller. Table 2 shows the FOA iteration process.

Iteration Best fitness \(c\) \(q\) \(\varepsilon\)
0 0.082 50.0 10.0 10.0
50 0.045 48.2 11.5 8.2
100 0.032 46.5 12.1 6.8
200 0.025 45.6 12.6 5.9
300 0.023 45.2 12.8 5.6

Simulation Model and Parameters

I build the simulation model in MATLAB/Simulink. The PMSM electric motor parameters are listed in Table 3.

Parameter Value
Moment of inertia \(J\) (kg·m²) 0.001538954
Number of pole pairs \(p_n\) 4
Permanent magnet flux \(\psi_f\) (Wb) 0.11439
Stator inductance \(L_d, L_q\) (mH) 4.25
Stator resistance \(R\) (Ω) 0.00478
Flux linkage (Wb) 0.114394
Damping coefficient \(B\) (N·m·s) 0.008
DC link voltage \(U_{dc}\) (V) 311
PWM sampling period \(T_s\) (s) 0.00001
PWM switching frequency \(f_{pwm}\) (kHz) 6
Maximum speed (r/min) 2500

The speed adjustment standards are shown in Table 4.

Item Overshoot Rise time Settling time
Standard Within 30% 0.1 s 0.4 s

The simulation settings are summarized in Table 5.

Simulation Parameter Value
Simulation time 0.4 s
Step size 1e-5 s
Solver ode3
DC link voltage 311 V
Switching frequency 6 kHz

I use PI controllers for the d-axis and q-axis current loops. The d-axis reference current is set to zero (\(i_d^* = 0\)) for the surface-mounted PMSM electric motor to achieve maximum torque per ampere. The q-axis reference current is generated by the speed loop. The PI controllers are tuned using the modulus optimum criterion. The current loop bandwidth is set to 1000 rad/s. The PMSM electric motor current response is fast and accurate. Table 6 lists the current loop parameters.

Parameter d-axis q-axis
Proportional gain \(K_p\) 0.5 0.5
Integral gain \(K_i\) 10 10

I use SVPWM to generate the switching signals for the three-phase inverter. SVPWM provides a higher DC voltage utilization and lower harmonic distortion compared with sinusoidal PWM. The PMSM electric motor is driven by the inverter. The switching frequency is 6 kHz. The DC link voltage is 311 V. The SVPWM module receives the d-q voltage commands and generates the gate signals.

Performance Metrics

I use several metrics to evaluate the speed control performance of the PMSM electric motor:

  • Overshoot: The maximum percentage by which the response exceeds the reference speed.
  • Rise time: The time required for the response to rise from 10% to 90% of the final value.
  • Settling time: The time required for the response to stay within 2% of the final value.
  • Recovery time: The time required for the speed to recover to within 5% of the reference after a disturbance.
  • Maximum dynamic variation: The maximum deviation from the reference speed after a disturbance.

These metrics are calculated from the simulation data. The PMSM electric motor speed response is recorded and analyzed. The overshoot is defined as:

$$\sigma = \frac{N_{max} – N_{ref}}{N_{ref}} \times 100\%$$

The rise time is:

$$t_r = t_{90\%} – t_{10\%}$$

The settling time is:

$$t_s = \min \{ t : |N(t) – N_{ref}| \le 0.02 N_{ref}, \forall \tau \ge t \}$$

These metrics allow me to compare the traditional SMC and the FOA-SMC quantitatively.

Multi-Condition Simulation Analysis

No-Load Startup at Given Speed

I set the reference speed to 1000 r/min and perform a no-load startup simulation. The speed response curves of traditional SMC and FOA-SMC are compared. The results are shown in Table 7.

Controller Overshoot (%) Rise time (s) Settling time (s)
Traditional SMC 15.5 0.0075 0.0558
FOA-SMC 3.55 0.0079 0.0325

The overshoot is reduced by 77.09%, and the settling time is reduced by 41.7%. The rise time remains almost unchanged. This indicates that the FOA-optimized SMC provides faster speed response and lower overshoot for the PMSM electric motor. I also calculate the integral of absolute error (IAE) and the integral of squared error (ISE). The results are shown in Table 8.

Controller IAE ISE
Traditional SMC 0.045 0.0023
FOA-SMC 0.021 0.0011

The FOA-SMC reduces the IAE by 53.3% and the ISE by 52.2%. This confirms that the PMSM electric motor reaches the reference speed more smoothly and accurately with the optimized controller.

Sudden Load Application at Given Speed

I set the reference speed to 1000 r/min, initial load torque \(T_L = 0\) N·m, and at \(t = 0.25\) s, the load torque suddenly changes to \(T_L = 4\) N·m. The speed comparison is shown in Table 9.

Controller Overshoot (%) Recovery time (s) Settling time (s) Maximum dynamic variation (%)
Traditional SMC 13.5 0.01855 0.0532 10.8
FOA-SMC 2.1 0.01835 0.0203 10.2

The torque comparison is shown in Table 10.

Controller Torque overshoot after load Settling time before load (s) Settling time after load (s)
Traditional SMC 0.6306 0.0406 0.0301
FOA-SMC 0.4656 0.0185 0.0129

The results show that FOA-SMC reduces the speed overshoot by 61.8% and the dynamic variation by 5.6%. The electromagnetic torque settling time is improved by 54.4% before load and 57.1% after load. The torque overshoot after load is reduced by 26.2%. Therefore, the FOA-optimized SMC enhances the anti-disturbance capability of the PMSM electric motor. The PMSM electric motor speed remains stable even when the load torque changes suddenly, which is crucial for electric vehicle applications.

Speed Change with Given Load

I start the PMSM electric motor with a load torque of 4 N·m and a reference speed of 1000 r/min. At \(t = 0.25\) s, the reference speed increases to 1100 r/min. The speed comparison is shown in Table 11.

Controller Overshoot before speed change (%) Settling time before speed change (s) Overshoot after speed change (‰) Settling time after speed change (s)
Traditional SMC 18.9 0.061 6.4 0.016
FOA-SMC 2.4 0.023 3.9 0.012

For the load startup condition, FOA-SMC reduces the overshoot by 87.3% and the settling time by 62.3%. For the speed change condition, the overshoot is reduced by 39% and the settling time by 25%. This confirms that the FOA-optimized SMC provides better speed regulation for the PMSM electric motor under varying operating conditions. The PMSM electric motor can accelerate to a new target speed smoothly and with minimal oscillation.

Discussion on Chattering and Robustness

One of the main drawbacks of traditional SMC is chattering. The discontinuous sign function in the control law causes high-frequency oscillations. In my FOA-SMC, the optimized parameters reduce the chattering effect. The FOA tunes \(c\), \(q\), and \(\varepsilon\) to balance the reaching speed and the chattering level. The exponential reaching law with optimized \(q\) and \(\varepsilon\) ensures that the system approaches the sliding surface smoothly. The simulation results show that the torque ripple is reduced. The FOA-SMC also maintains robustness against load disturbances. The PMSM electric motor speed remains stable even when the load torque changes suddenly. This is important for electric vehicle applications where load variations are common.

I also compare the FOA-SMC with a traditional PI speed controller. The PI controller is tuned using the Ziegler-Nichols method. The comparison for the no-load startup condition is shown in Table 12.

Controller Overshoot (%) Settling time (s)
PI 20.0 0.080
Traditional SMC 15.5 0.0558
FOA-SMC 3.55 0.0325

The PI controller has the largest overshoot and the longest settling time. The traditional SMC improves the performance, but the FOA-SMC provides the best performance. The PMSM electric motor with FOA-SMC has the lowest overshoot and the shortest settling time.

Comparison of Optimization Algorithms

I choose FOA because it has few parameters, low computational cost, and high search accuracy. Table 13 compares FOA with particle swarm optimization (PSO) and genetic algorithm (GA) in general terms.

Algorithm Parameters Computational cost Accuracy
FOA Few Low High
PSO Moderate Moderate High
GA Many High Moderate

The FOA is particularly suitable for online or embedded optimization because it requires minimal tuning and has a simple structure. In my study, the FOA converges within 300 iterations, which is acceptable for offline parameter tuning of the PMSM electric motor speed controller.

Application to Electric Vehicles

The PMSM electric motor is widely used in pure electric vehicles, especially in in-wheel drive configurations. The in-wheel PMSM electric motor eliminates the need for a mechanical transmission, reducing weight and improving efficiency. However, the in-wheel PMSM electric motor operates under varying road conditions, which cause load disturbances. The speed control must be robust and fast. My FOA-SMC strategy is suitable for this application because it provides fast response, low overshoot, and strong anti-disturbance capability. The simulation results show that the PMSM electric motor speed remains stable when the load torque changes suddenly, which is crucial for vehicle safety and comfort.

Efficient speed control of the PMSM electric motor contributes to the overall energy efficiency of electric vehicles. By reducing overshoot and settling time, the PMSM electric motor consumes less energy during transient states. The FOA-SMC reduces chattering, which also reduces harmonic losses. The optimized parameters minimize the control effort while achieving the desired speed. This is beneficial for extending the driving range of electric vehicles.

Conclusion

In this study, I designed a fruit fly optimization algorithm optimized sliding mode controller for the speed loop of a PMSM electric motor used in pure electric vehicles. I established the mathematical model of the PMSM electric motor in the d-q frame, derived the sliding mode controller based on the exponential reaching law, and used FOA to tune the sliding mode parameters. Simulation results under three operating conditions show that the FOA-SMC strategy significantly reduces overshoot and settling time while maintaining strong anti-disturbance capability. The PMSM electric motor speed control performance is improved in terms of faster response, lower chattering, and better robustness compared with traditional SMC. The proposed method offers a promising solution for in-wheel PMSM electric motor drives in electric vehicles.

In future work, I plan to implement the FOA-SMC on a hardware-in-the-loop platform to validate the simulation results. I will also test the PMSM electric motor under more complex driving cycles, such as urban and highway conditions. Additionally, I will investigate adaptive FOA algorithms that can adjust the sliding mode parameters online. The PMSM electric motor speed control can be further improved by combining FOA with other intelligent algorithms.

Scroll to Top