Optimized Luenberger Observer-Based PMSM Sensorless Control by PSO

In the real applications, we found that it is di ﬃ cult to achieve good control performance through manually tuning proportional – integral (PI) parameters of phase locked loop (PLL) and speed-loop of Luenberger observer (LO) for the PMSM sensorless control system. Therefore, this paper is to use the particle swarm optimization (PSO) algorithm to optimize the PI parameters of PLL and speed-loop of Luenberger observer of the system. Firstly, the ranges of PLL parameters are obtained by analyzing the PLL subsystem stability. Then, the ranges of PI parameters of PLL and speed-loop are set based on theoretical estimation and empirical values. The control system model is realized in MATLAB/Simulink that considers the constraints such as the saturation. The integral time absolute error is the objective function, and the PSO with di ﬀ erent topologies is used to optimize the PI parameters. The simulation and experimental results show that the proposed method is feasible, and the optimized parameters can e ﬀ ectively improve the precision of position estimation and speed estimation. Moreover, the simulations and experiments are carried out to verify the robustness of the proposed method, and the results show that the optimized system can achieve good performance when there are uncertainties or disturbances.


Introduction
The advantages of permanent magnet synchronous motor (PMSM) include high efficiency, high power density, and small size [1][2][3][4]. With the development of science and technology, customers, who need higher quality productions and many products, put forward higher requirements for motor control and energy efficiency, which cause the widespread adoption of PMSM in industries like home appliance, industrial engineering, and autoindustry. The field-oriented control (FOC) technology is widely used to control PMSM. In the FOC system, it is necessary to obtain the information of rotor position and speed. In order to obtain the rotor position, some position sensors (such as Hall sensor, photoelectric encoder, and rotary converter) are used to detect the rotor position of the motor. However, the sensor increases the complexity and cost of control systems and reduces the reliability of the system [4]. In order to solve the series of problems caused the position sensors, researchers have pro-posed the sensorless control technology for PMSM. The research and application of this technology is of great significance and has gradually become one of the hottest fields of motor control, and this kind of control method is called sensorless control [5].
In general, the main methods of sensorless control of PMSM include high frequency injection (HFI), model reference adaptive system (MRAS), flux linkage observer (FLO), extended Kalman filter (EKF), sliding mode observer (SMO), and Luenberger observer (LO). HFI has good control performance on the sensorless low-speed operation [6][7][8]. However, this method has a poor effect on the recognition of the hidden pole motors besides causing additional noise [9]. MRAS has been used in references [10,11], but it is dependent on motor parameters excessively [12]. FLO was used in [13,14], but it has issues of DC offset and harmonics. EKF is good at dynamic performance and antiinterference ability [15,16], but this algorithm is complex [1,9]. SMO is simple, and it has good robustness [17][18][19][20], but it has discontinuous switch control, which can cause system chattering [9]. Especially when it runs at low speed, SMO can cause huge torque ripple. LO uses the classical theory of the geometric property of linear (and stationary) systems known as observability [21][22][23] to estimate the internal states of the system based on the input and output values of the system. It is simple and not chattering and has good robustness [21], but there is division operation in the arctangent function, which can cause larger estimation error of rotor position and speed [19]. It was verified that PLL algorithm can efficiently improve estimation accuracy of rotor position and speed without division operation [2,20], but it is difficult to tune the PI parameters of PLL [1].
To achieve good control performance of PMSM sensorless control, this paper proposes to use PSO algorithm to optimize PI parameters of PLL and speed-loop. This method can reduce the parameter tuning difficulty and the deviation of PLL and speed-loop effectively, besides improving the speed performance of PMSM sensorless control. The main contributions of this paper are (1) this study proposed to use PSO algorithm to optimize the PI parameters of PLL and speed-loop of the Luenberger observer-based PMSM sensorless control system, which can reduce the parameters tuning challenges (2) the optimized PI parameters based on the simulation model of PMSM sensorless control system have been applied to the physical system, and it shows that they can improve the performance of position estimation and speed estimation (3) simulations and experiments have been used to verify the robustness of the proposed method, and the results show that the optimized system has good performance when there are uncertainties or disturbances (4) it is found that the random topology of PSO can achieve better performance than the ring topology and global topology The rest of this paper is arranged as follows. Section 2 gives a brief description of the Luenberger observer-based PMSM sensorless control. A new application for the PSOoptimized PMSM sensorless control system is described in Section 3. In Section 4, the system simulation and experiment are given to verify the performance of the proposed method, and the results are investigated based on some comparisons. Finally, Section 5 gives the conclusion of this study.

Luenberger Observer Based on PMSM Sensorless Control System
The PMSM sensorless control system using Luenberger observer is shown in Figure 1. The whole control system is comprised of space vector pulse width modulation (SVPWM), three-phase full bridge inverter circuit, Luenberger observer, and speed and position estimator. The details of Figure 1 are described in the following subsections.
2.1. Mathematical Model of PMSM. This paper uses the stationary stator coordinate system of PMSM as shown in Figure 2. The axes A, B, and C refer to three-phase stationary stator coordinates. Each electric angle is 120°. The axes α and β refer to two-phase stationary stator coordinates. The vector diagram between two-phase stationary stator coordinates and two-phase rotating rotor coordinates is shown as Figure 3. The axes d and q refer to two-phase rotating rotor coordinates. According to rotor field-orientated control, d is the axis where the rotor locates, and the axis q gets ahead 90°o f the axis d in an anticlockwise direction. The axis d and q rotate at rotor angular speed ω r in an anticlockwise direction.
According to Figures 2 and 3, it comes up with the voltage equations that PMSM works under ABC three-phase coordinates.
Here, R is the stator winding resistance; i a , i b , and i c are three-phase current of ABC; u a ,u b , and u c are three-phase voltage of ABC; ψ a , ψ b , and ψ c are three-phase stator flux linkage of ABC.
The three-phase stator flux linkage equations of PMSM are ψ a = Li a + ψ f a , Here, L is the stator winding inductance; ψ f a , ψ f b , and ψ f c are the flux linkages that the permanent magnet makes on the stator winding.
The stator voltage equations that PMSM works under the stationary α-β coordinates are The back EMF equations that PMSM works under the stationary α − β coordinates are e α = −Ψ f ω r sin θ, Here, i α , i β , u α , and u β are the stator current and voltage of αβ axis; Ψ f is the flux linkage of rotor permanent magnet; ω r is the electrical angle speed of the rotor; θ is the electrical angle of the rotor. Modelling and Simulation in Engineering The voltage equations that PMSM works under d and q coordinates are as follows: where u d and u q are the stator voltage on the axis d and q, respectively, i d and i q are the stator current on the axis d and q, respectively, and ψ d and ψ q are the stator flux linkage component on the axis d and q, respectively. The stator flux linkage component on the axis d and q can be described by The equation of electromagnetic torque is Here, P is the pole-pairs number of the motor.

Mathematical Model of Luenberger Observer of PMSM.
The basic structure of Luenberger observer is shown in Figure 4. According to the mathematical model of PMSM, we usually use the voltage and current of the PMSM, which could be measured easily, as the inputs to restructure its states. In Figure 4, a feedback control is introduced, and the feedback signal is the comparison of the estimated current with the actual one. It makes the estimated value be close to the actual value infinitely. In Figure 4, i α , i β , u α , and u β are the stator current and voltage of α-β axis;î α andî β are the estimated currents of αβ axis, respectively;ê α andê β are the estimated back EMFs of the αβ axis, respectively.
According to Figure 4, we can obtain the following equations:

Modelling and Simulation in Engineering
Substituting x, u, and y into equations (8) and (9), we can design the PMSM mathematical model of the Luenberger observer as follows: Here, K e1 and K e2 are the gains of the Luenberger observer.
After back EMF of Luenberger observer being estimated, the position angle of the rotor can be obtained directly by using the function below.
Here, b θ e refers to the estimated rotor electrical angle. According to equations (4) and (11), the following function can be obtained.
Here, b ω r refers to the estimated electrical angle speed. According to equation (11), the arctangent function is used to calculate rotor electrical angle. In practice, there are lots of harmonics and noise in the control system due to the nonlinearity of the inverter. Therefore, the division operation in the arctangent function causes larger estimation error of rotor position and speed [19].
Another method for rotor position and speed estimation is using PLL, which can efficiently avoid the noise made by arctangent function, and the specific block diagram is shown in Figure 5 (we call this method as "2021 LO"). The whole control system is comprised of SVPWM, three-phase full bridge inverter circuit, Luenberger observer, and phase locked loop.
PLL is used to obtain the position and speed due to the excellent tracking performance on frequency and phase of PLL. The generic PLL block diagram is shown in Figure 6.
According to Figure 6, the following function can be obtained In Figure 6, b ω refers to the estimated rotor speed by the PLL, and b θ refers to the estimated rotor position angle by the PLL.
When b θe − b θ < π/8, the following function can be used.
According to equation (14), Figure 6 can be equivalent to Figure 7.
According to Figure 7, the closed loop transfer function and error transfer function of phase locked loop can be obtained, respectively, as below: Here, K = Ψ f b ω r . Since K is in the outside of the closedloop system, it does not affect the stability of the PLL.
Since K p > 0, K i > 0, (15) and (16) are both minimum phase system. So, the stability of (15) and (16) is determined by their poles.
The characteristic equation of (15) and (16) is Hence, the poles of (15) and (16) are Since (15) and (16) are stable. As rotor position is a ramp function, the steady-state error of rotor position and speed estimation system by phase locked loop can be obtained as  Modelling and Simulation in Engineering Equation (19) shows that actual rotor position can be estimated by the PLL, and the PLL has a low pass filtering characteristic, which can perform secondary filtering on the back EMF to obtain the rotor position. Because the performance of phase-locked loop is determined by K p and K i , we found that it is very complex to calculate the value of K p and K i based on the analytical solution. In order to improve the estimating performance of position and speed, PSO can be used to optimize PI parameters of PLL and speed-loop in PMSM sensorless control system based on the 2021 LO. It can also improve estimated precision of position and speed and performance of dynamic response.

Optimizing PMSM Sensorless Control System
In practice, the load is often fluctuant when the PMSM is used, and it can cause maladjustment or overshooting of rotation speed if the parameters of PI controllers are not properly tuned. It is hard to meet the requirements in high precision rotation speed control. Hence, it is necessary to optimize the PI values of speed-loop in PMSM sensorless control system and improve the performance of speed control. The specific block diagram of the proposed system is shown in Figure 8. The following two subsections show how to apply PSO to the Luenberger observer-based PMSM sensorless control system.
3.1. Introduction of PSO. PSO was put forward by Oubelaid et al. [24]. The information of every particle in the particle swarm is iterated and updated constantly. In every iteration, it can calculate the optimal values of individual particle and all the particles (pbest and gbest). After calculating the pbest and gbest, every particle adjusts its flight speed and location. The formulas of speed and location updating of particles are Ã ,

Modelling and Simulation in Engineering
In the equations, u ij ðtÞ refers to velocity of particle i in j dimension after t times' iteration; x ij ðtÞ refers to location of particle i in j dimension after t times' iteration; c 1 and c 2 are learning factors in particle swarm; r 1 and r 2 refer to two random numbers in (0, 1).
The topology of the particles plays important role for the optimization performance, and there are several kinds of topologies such as ring topology, global topology (also called full connection topology), and random topology (it is the default set of the standard PSO 2007 [25]). The ring topology means that each particle only has two fixed neighbors, the global topology is the above described one and its formula is (20), and the random topology means that the topology of particles are not fixed and is dynamically changed according to preset condition(s).

PSO-Based PMSM Sensorless
Control System. In this paper, the optimization of the PI parameters of PLL and speed-loop is realized using the standard PSO 2007 [25]. Firstly, we need to select the objective function. In order to get a good control performance, the absolute value of speed difference between the target setting value and estimating value of observer should be small enough. The objective function is Here, Track errðtÞ is the speed difference between the target setting value and estimating value of observer at time t, and ω t ðtÞ is the target setting speed in time t.
In consideration of the system's tuning time should be small, we use the ITAE (integral time absolute error) as the evaluation function. Its continuous state function is (22), and its discrete state function is (23).
Since the fixed-step solver ode3 is used to simulate the control system, we can use the following equation as the objective function which is similar to (22).
The variables to be optimized include 4 parameters, K p and K i of PLL and K p and K i of speed-loop. We label them as PLL K p , PLL K i , n K p , and n K i .

Simulation of System and Experimental Verification
In order to verify the feasibility and performance of the  Here, PSO is used to optimize the whole system by calling the simulation file.   Table 1. According to foregoing analysis, the PLL is stable when both the value of PLL K p and PLL K i are greater than zero, but the range is too big. According to theoretical estimation [26] and experience in engineering application [27], the variable search spaces and PSO parameter set are given in Table 2, and the flowchart of PSO algorithm optimization is given in Figure 10. The whole simulation time is 0.1 second, and the target speed is 1000 RPM. When the time is at 0.05 second, we increase the load to 2 Nm. After 98 iterations of PSO, we got the optimal parameters of PI shown in Table 5. Track err is convergent and close to zero. The value of evaluation function is 3.7386e+06. In order to find which topology can achieve better optimization performance, we did comparisons among the ring topology, global topology, and the standard PSO 2007 (random topology). In the same condition, we simulated 10 times for each topology, and the results are shown in Table 6. From Table 6, we can conclude that the ITAE of standard PSO 2007 (the random topology) is better or smaller than that of the PSO with ring topology and global topology, but the computational time of ring topology is better than standard PSO and global topology, since there are fewer neighbors and less comparisons for the ring topology.

Simulation and Analysis of PMSM Performance.
According to the simulation result of Subsection 4.2, we used the optimal parameters of PI by standard PSO 2007 (shown in Table 5) to verify the quantitative performance of the proposed method. LO [23] and 2021 LO [2] are compared with the proposed method based on the simulations. In the simulations, the same PMSM model and same simulation conditions were used.
(1) Comparison of speed curve The simulation results are shown in Figure 11. We can conclude that PSO has obvious advantages in speed dynamic performance.
(2) Comparison of control performance The simulation comparisons are based on the maximum speed overshoot, transient time and ITAE, and they are shown in Table 7. From Table 7, we can conclude that the performance of PMSM has been improved significantly using the proposed method. It shows that the position estimation error of PMSM is smaller using the proposed method than that of other two methods. Figures 21-23 show the estimated speed and actual speed about the LO, the 2021 LO, and the proposed method, respectively. It showed that compared with the proposed method, the speed overshoot of PMSM is bigger by using the LO and the 2021 LO, and the time from start to steady state is longer. Figures 24-26 show the speed estimation error using the LO, the 2021 LO, and the proposed method, respectively.

Modelling and Simulation in Engineering
Comparing these waveforms, it shows that the proposed method is better than the LO and the 2021 LO of the error of speed estimation when start-up, and the speed error is about ±0.1 RPM when in steady state. Table 8 lists the simulation data on the accuracy of estimated position and estimated speed, and it can be found that the proposed method can achieve better performance than other two methods.

Robustness Analysis of PMSM Sensorless Control Based on Simulations.
In practice, the robustness is important for a control system. In order to verify the robustness of the optimized PMSM system, the work performance on noload and full-load is to be verified based on two cases. Case 1. The whole simulation time is 0.1 second. Firstly, we set the PMSM running at 1000 RPM without load, and then, the 2 Nm load is applied to the system at t = 0:05 second. The simulation results are shown in Figure 26, which shows the waveform of speed appeared fluctuations, but it goes stably immediately.
Case 2. The whole simulation time is 0.1 second. Firstly, we set the PMSM running at the 1000 RPM with full load 2 Nm. When t = 0:05 second, the load and speed are changed to 1 Nm (50% of load torque changes) and 500 RPM (50% of speed changes), respectively. Simulation results of speed and speed estimation error are shown in Figures 27 and  28, respectively. The simulation results showed that the speed fluctuates slightly and then be stabilized quickly when the speed and torque are changed.
According to the simulation results above, it proves that the control system has good robustness and dynamic response.

Experimental Results and Analysis.
It is important to verify the proposed PSO optimization method using physical system. Here, using STM32F030 MCU as its main control chip and writing the software code in C language, a PMSM sensorless control system is designed. The  parameters of PMSM are same as Table 1. Experimental platform is shown in Figure 29. In order to verify the accuracy of speed, 2 Nm loads are applied to the PMSM by hysteresis dynamometer when speed running at 1000 RPM, and the phase current waveform, torque, and speed are shown in Figure 30. The wave-forms show that the phase current presents a perfect sine wave, and the motor speed is stabilized at about 1000.05 RPM. It shows that the speed results of experiment are consistent with the simulation results.
To verify the robustness of optimized PMSM system, two experimental cases are carried out.     Case 1. In order to verify the robustness of the PMSM physical system, 2 Nm loads are applied to PMSM by hysteresis dynamometer after the speed stabilizes at 1000 RPM without load, and the test data is shown in Figure 31. These phase currents are perfect sine waves. The current changes very smoothly, without abnormal fluctuations when the load is applied to the PMSM system. Case 2. In order to verify the robustness of PMSM physical system under full load condition, the load and speed are changed to 1 Nm and 500 RPM, respectively, after PMSM system becomes stable with a speed of 1000 RPM and a 2 Nm load. The test data is shown in Figure 32. The waveform shows that the current changes very smoothly, without abnormal fluctuations when the test condition changes.
According to the above experiments, it proves that experimental results are consistent with the simulation results, and the optimized PMSM system has good stability and robustness. Because of the limited resources, the rotor position angle and speed overshoot are not obtained in the experiment. According to equations (4) and (13)  speed testing data above, it can be deduced that the position angle is consistent to the simulation data.

Conclusion
This paper proposed to use the PSO algorithm to optimize the PI parameters of PLL and the speed-loop of the Luenberger observer-based PMSM sensorless control system. The simulation results in MATLAB/Simulink showed that the PSO algorithm can reduce the parameter tuning difficulty of PLL and speed loop effectively. Then, we applied the optimized PI parameters to the Simulink model of PMSM sensorless control system and physical system. The simulation results and experimental results showed that the proposed method can improve performance of position estimation and speed estimation. Moreover, the PSO with different topologies was tested, and it was found that the random topology of PSO can achieve better performance than the ring topology and global topology. Finally, simulations and experiments have been used to verify the robustness of the proposed method, and the results show that the optimized system has good performance when there are uncertainties or disturbances. Since the system model is based on MATLAB/Simulink, it is difficult to convert it to the codes, which can be run in the microcontroller of the experimental system. In the future, we will simplify the system model and the PSO algorithm, so the proposed method can real-time tune the system parameters.
Abbreviations PMSM: Permanent magnet synchronous motor PSO: Particle swarm optimization PI: Proportional-integral PLL: Phase locked loop LO: Luenberger observer FOC: Field-oriented control HFI: High-frequency injection MRAS: Model reference adaptive system FLO: Flux linkage observer EKF: Extended Kalman filter SMO: Sliding mode observer SVPWM: Space vector pulse width modulation EMF: Electromotive force ITAE: Integral time absolute error.

Data Availability
No data were used to support this study.

Conflicts of Interest
The author declares that they have no conflicts of interest.