Sensorless Control of PMSM Based on Backstepping-PSO-Type Controller and ESO-Type Observer Using Real-Time Hardware

: In the case of using a Permanent Magnet Synchronous Motor (PMSM) linear model of limited-range parametric variations and of relatively low dynamic of the load torque, the Field Oriented Control (FOC) type strategy ensures good performance of the PMSM control. Therefore, when using a non-linear model of wide-range parametric variations and of high dynamic of the load torque, a backstepping-type controller is proposed, whose tuning parameters are optimized by using a Particle Swarm Optimization (PSO) method. By designing an Extended State Observer (ESO), which provides a good estimate of the PMSM rotor position and speed under uncertainty conditions and with a response time shorter than that of the backstepping-type controller, this observer can be incorporated into the PMSM sensorless control system. The superior performance of the proposed sensorless control system based on the backstepping-PSO-type controller and an ESO-type observer is demonstrated through numerical simulations. Given that the real-time implementation of the control algorithms and observers in an embedded system is a difﬁcult task, consisting of several steps, it is presented after the numerical simulations, which can be assimilated into the Software-in-the-Loop (SIL) step, the Processor-in-the-Loop (PIL) intermediate step, and the Hardware-in-the-Loop (HIL) ﬁnal step. A comparison between the backstepping-PSO-type controller and the PI-PSO-type controller is presented by means of the real-time implementation of these controllers and demonstrates the superiority of the backstepping-PSO-type controller. range of the control parameters in the case of rapid and high-ampli- tude variations the load torque by a uniform random noise and in the case of variation of up to 100% of the system parameters such as the moment of inertia J and the static R s . At the end of the paper, we summarize the transition and the stages of paradigms SIL, PIL, and HIL related to the real-time implementation of a PMSM control system. In addition, we present a series of experiments of the PMSM control sys- tem in the HIL stage, which confirm the robustness and superiority of the proposed back- stepping law. The experimental results prove the superiority of the backstepping- type controller over the PI-PSO-type controller and are backed by the ing


Introduction
PMSMs have increasing applicability due to their advantages such as superior performance, reliability, and the fact that they are compact and suitable for operating conditions. Thanks to its high-duty density and smaller dimensions, the PMSM has become the preferred solution for the control of speed and position in machine tools and robots. A PMSM is a motor that uses permanent magnets to generate the magnetic field in the air gap, instead of electromagnets. These motors have significant advantages, drawing the interest of researchers and industry for their use in many applications. PMSMs are widely used in low-power and medium-power applications such as computer peripherals, robotics, adjustable speed systems, electric vehicles, and heavy-duty systems such as aerospace technology [1][2][3].
Usually, systems with high-performance motors require fast and accurate response, rapid recovery from any disturbances and insensitiveness to parameter variations. The dynamic behavior of an AC motor can be significantly improved with the help of vector control theory-FOC, in which the motor variables are transformed into a set of orthogonal axes d-q so that speed and torque can be controlled separately. This gives PMSM-type motors the desired capacity of the dynamic performance of the DC voltage machine energized separately, while retaining the overall advantages of AC machines over DC motors [4,5].
The FOC-type control strategy of the PMSM includes all the advantages deriving from the simplicity of using PI controllers, but inherently, the control performance is limited due to the non-linear PMSM model, the need to perform the control in a wide range and with a high-dynamic of speed and load torque, but also due to the parametric uncertainties resulting, in particular, from the variation of the combined rotor-load moment of inertia [6,7].
We note the difficulty of such an approach in view of the fact that it uses mathematical models of electromechanical systems (the mathematical model of the PMSM) with the mathematical models of power electronics (the mathematical model of IGBT, controlled rectifiers, inverters, etc.). Another characteristic regarding the difficulty of harmonizing these models is that the mathematical models of electromechanical systems are continuous (which can be discretized with the usual methods) while the mathematical models of power electronic systems are hybrid (continuous-discrete). The rapid progress in computing technology and hardware in recent years has enabled the development of several directions for creating PMSM modelling and control strategies, based on predictive controllers [8,9], adaptive controllers [10,11], fuzzy controllers [12,13], or controllers based on artificial neural networks [14,15], but also controllers based on the fractional calculus [16,17] in order to improve the functionality of industrial installations. Moreover, to eliminate some of the transducers and mechanical parts which can decrease the reliability of the system, a series of observers has been developed for the estimation of the PMSM rotor speed and position [17][18][19][20][21][22][23][24][25].
This article is a continuation of the article in [26]. Starting from the fact that the mathematical model of the PMSM is non-linear, we developed a backstepping controller, which is built in several stages using Lyapunov functions, and thus has the possibility to achieve a control system that incorporates the PMSM nonlinearities as well as good parametric robustness in terms of maintaining the performance of the PMSM control system, even in the case of parameter variation. Among the parametric variations that stress the control system with a view to maintaining high performance, we recall the variation of the combined rotor-load moment of inertia, the variation of the stator resistance of the PMSM, but also the sudden and high-amplitude variations of the load torque. To eliminate the position and speed transducers, an ESO-type observer is synthesized with very good performance in estimating the speed and position of the PMSM rotor, even when there are uncertainties. The response time of the observer is very good, shorter than that of the control system, and because of this, the integration of the observer into the control system is an appropriate solution. An observer of the load torque and of the stator resistance of the PMSM was also designed. The numerical simulations of the PMSM control algorithms are performed in the MATLAB/Simulink development environment, which uses the Simscape Electrical toolbox [27]. After synthesizing the backstepping control law, the performances of the control system and its robustness in the case of large variations of the system parameters are demonstrated through numerical simulations. Naturally, the next step is the real-time implementation using embedded systems. Given that the real-time implementation of the control algorithms and observers in a digital signal processor (DSP), such as the TMS320F28379D microcontroller from Texas Instruments [28], is a difficult task consisting of several steps, it is presented after the numerical simulations, which can be assimilated to the SIL step, the PIL intermediate step, and the HIL final step.
The main contributions of this paper can be summarized as follows: • Design of a backstepping-type controller, optimization of its tuning parameters using a PSO optimization method, and synthesis of an ESO-type observer to estimate the speed and position of the PMSM rotor and the load torque; • Validation of the superior performance of the proposed sensorless PMSM control system through numerical simulations, based on the backstepping-PSO-type con- Presentation of all the steps for the real-time implementation in the embedded system, covering the SIL, PIL, and HIL steps. Moreover, the real-time implementation demonstrates the superiority of the backstepping-PSO-type controller over the PI-PSO-type controller.
The rest of the paper is structured as follows. The description of the mathematical model of the PMSM and the FOC-type strategy are presented in Section 2 and the backstepping control of the PMSM is presented in Section 3. The design of the ESO-type observer is presented in Section 4, and Section 5 presents the numerical simulations of the sensorless PMSM control system. Section 6 presents the PIL and HIL steps for realtime implementation and experimental results. Some conclusions are presented in the final section.

Description of the Mathematical Model of the PMSM and the FOC-Type Strategy
In order to achieve PMSM control systems, it is necessary to develop and implement an appropriate mathematical model of this type of motor to allow the reasonably accurate description of its behavior and parameters. The mathematical model can be described in a real frame abc, or in a rotating frame d-q. By using the abc reference frame to describe the mathematical model of the motor, the equations obtained are nonlinear, which means that they are relatively complex, and the variables are time variants.
Thus, if the rotor reference frame d-q is used, the equations obtained are in the form of relations (1), allowing for the mathematical calculations required by the numerical simulations to be carried out faster, and thus, the implementation of the control system is simplified [4].
where u d and u q represent stator voltages in the d-q reference frame, and i d and i q represent the currents in the d-q reference frame. The stator inductances in the d-q reference frame will be denoted as L d and L q , and the stator resistances in the d-q reference frame as R d and R q . The electrical angular velocity of the rotor is denoted as ω e , and the linkage stream as λ 0 . Based on the description equations in the three-phase system in the abc reference frame, we obtained the equations of the form (1) in the d-q reference frame, using a transform as follows [4]: where a, b, and c represent the components of the three-phase system in the abc reference frame, d and q are used to denote the components for the two-axis system in the rotating reference frame, and 0 represents the zero component for the two-axis system in the stationary reference frame. Using the differential operator denoted as ρ in the relations (1), we can obtain another form of interest of the description equations in the d-q reference frame, i.e., the form under which the control voltages u d and u q are highlighted.
The electromagnetic fluxes of the PMSM in the d-q reference frame are described by the following relations: The electromagnetic torque developed by the PMSM will be denoted as T e , and the following relations can be written: In Equation (5), the following notations are used: K t = 3 2 n p λ 0 -the torque constant; B is the viscos friction coefficient; J is the rotor inertia; n p is the number of pole pairs; T L is the load torque.
Using commonly accepted simplifications, L d = L q = L, R d = R q = R s , the following relations can be written: where θ e represents the electrical angular position of the PMSM rotor, θ represents the electrical angular position of the PMSM rotor (θ e = n p ·θ) and ω e = n p ·ω, and ω represents the angular velocity of the PMSM rotor. For the control of the PMSM in the classical structure, the so-called FOC strategy control (Figure 1), the outer speed control loop provides references for the inner current control loops i d and i q . The reference for i dref is selected as equal to 0 for the maximization of the electromagnetic torque T e . The controllers of the three control loops are normally of PI-type. Figure 2 presents the time evolution for the numerical simulation of the PMSM control system based on the PI speed controller. The nominal parameters of the PMSM are presented in Table 1. In this numerical simulation, the speed reference ω ref = 1600 rpm, the load torque T L = 1 Nm, and the tuning parameters of the speed controller are K p = 1.1 and K i = 11. This controller was tuned using the Ziegler-Nichols method.
A PSO optimization method will be used to achieve superior performance of the PMSM control system. This method will yield the optimal values of parameters K p and K i in the sense of minimizing an error criterion of the following type: where the error e(t) is defined as follows:  Figure 2 presents the time evolution for the numerical simulation of the PMSM control system based on the PI speed controller. The nominal parameters of the PMSM are presented in Table 1. In this numerical simulation, the speed reference ωref = 1600 rpm, the load torque TL = 1 Nm, and the tuning parameters of the speed controller are Kp = 1.1 and Ki = 11. This controller was tuned using the Ziegler-Nichols method.     Figure 2 presents the time evolution for the numerical simulation of the PMSM control system based on the PI speed controller. The nominal parameters of the PMSM are presented in Table 1. In this numerical simulation, the speed reference ωref = 1600 rpm, the load torque TL = 1 Nm, and the tuning parameters of the speed controller are Kp = 1.1 and Ki = 11. This controller was tuned using the Ziegler-Nichols method.

PMSM Parameters Value Unit
The stator resistance-R s 2.875 Ω The d-axis and q-axis inductances-L d and L q 0.0085 H The combined rotor inertia coefficient-J 0.8 × 10 −3 kg·m 2 The combined viscous friction coefficient-B 0.005 N·m·s/rad The flux induced by the rotor in the stator phases-λ 0 0.175 Wb The pole pairs number-n p 4 - The PSO method can be described in an analogous way to the trajectory of a group of particles in the search space with a view to obtaining an optimal trajectory in terms of minimizing an error criterion, i.e., approximating a reference trajectory [29]. The current Electronics 2021, 10, 2080 6 of 36 position of each particle is denoted as x i and the current speed of each particle as v i . Based on these, we can describe the personal optimum of a particle as follows: Furthermore, by denoting the neighborhood best position asŷ i , the social optimum for the neighborhood of a particle can be descriebed in the following form: Recurrent relations between position and speed can be described as follows: where w is the inertia weight (usual w = 0.9), i = 1, . . . , N (N represents the number of particles), j = 1, . . . , D (D represents the dimension of the problem), r 1 and r 2 are random numbers, and c 1 and c 2 are positive constants.
In the initialization phase of the program, the number of N particles is chosen and the weights and constants in the relations (11) are selected. In this application, N = 50, c 1 = 0.12 and c 2 = 1.2. The stopping of the algorithm is performed after achieving the convergence or after completing a predefined number of iterations.
Following the use of such an algorithm, the optimal values can be obtained for the tuning parameters of the speed controller: K p = 1.69 and K i = 1.56. Based on these new values, the results of the numerical simulations of the PMSM control system are presented in Figure 3. We note an improvement in the transient and stationary regime in terms of reducing the overshoot and obtaining a response time of about 5 ms.
where the error e(t) is defined as follows: The PSO method can be described in an analogous way to the trajectory of a group of particles in the search space with a view to obtaining an optimal trajectory in terms of minimizing an error criterion, i.e., approximating a reference trajectory [29]. The current position of each particle is denoted as xi and the current speed of each particle as vi. Based on these, we can describe the personal optimum of a particle as follows: Furthermore, by denoting the neighborhood best position as i ŷ , the social optimum for the neighborhood of a particle can be descriebed in the following form: Recurrent relations between position and speed can be described as follows: (11) where w is the inertia weight (usual w = 0.9), i = 1, …, N (N represents the number of particles), j = 1, …, D (D represents the dimension of the problem), r1 and r2 are random numbers, and c1 and c2 are positive constants.
In the initialization phase of the program, the number of N particles is chosen and the weights and constants in the relations (11) are selected. In this application, N = 50, c1 = 0.12 and c2 = 1.2. The stopping of the algorithm is performed after achieving the convergence or after completing a predefined number of iterations.
Following the use of such an algorithm, the optimal values can be obtained for the tuning parameters of the speed controller: Kp = 1.69 and Ki = 1.56. Based on these new values, the results of the numerical simulations of the PMSM control system are presented in Figure 3. We note an improvement in the transient and stationary regime in terms of reducing the overshoot and obtaining a response time of about 5 ms.  If the variation of the load torque is between 1 Nm and 4 Nm, at time 0.25 s after the start of the simulation, a steady-state error of about 1% is noted ( Figure 4). This confirms that even an optimally tuned PI controller can achieve very good performance of the PMSM control system only in the case of a usual range of the reference quantity, but for relatively limited and small ranges of the other parameters. In this respect, to achieve superior performance of the PMSM control system as well as the parametric robustness of the control system, an advanced backstepping control system is presented in the next section.

Backstepping-Type Control Law
The mathematical model of the PMSM is nonlinear. The nonlinearity is due to the fact that products of the state vector components (terms such as ω·iq and ω·id) occur in the mathematical model. These nonlinearities can be considered as "soft" in the sense that the description functions concerned are of continuous type and even derivable due to the physical characteristics of the state vector components. It can be noted that the procedure for obtaining the controller presented starts from the FOC-type structure which exploits the cascade structure, i.e., the fact that the outer speed control loop provides the control quantity iqref, which will supply the control quantities ud and uq through the current control loops. It can be noted that this structure can be used to follow the steps in designing a backstepping control law. The recursive control design for the backstepping law requires a system consisting of subsystems which radiate out from an inner system to the outer subsystems, and the stabilization is achieved in several stages, each based on a Lyapunov function. In addition, the functions that describe the nonlinearities of the system must be at least of Lipschitz type, a condition which is fulfilled, given that these functions are continuous due to the physical nature of the state vector components.
The backstepping control strategy is performed in a series of stages, as a cascade control system with several stages and applies especially to nonlinear systems. It starts from a stable subsystem and performs a cascade synthesis of the intermediate control signals (virtual controls) until each subsystem is stabilized. A Lyapunov function is used to design the control of each subsystem. Stability is thus ensured and, by choosing the appropriate parameters, we can obtain the intended control performance as well as the This confirms that even an optimally tuned PI controller can achieve very good performance of the PMSM control system only in the case of a usual range of the reference quantity, but for relatively limited and small ranges of the other parameters. In this respect, to achieve superior performance of the PMSM control system as well as the parametric robustness of the control system, an advanced backstepping control system is presented in the next section.

Backstepping-Type Control Law
The mathematical model of the PMSM is nonlinear. The nonlinearity is due to the fact that products of the state vector components (terms such as ω·i q and ω·i d ) occur in the mathematical model. These nonlinearities can be considered as "soft" in the sense that the description functions concerned are of continuous type and even derivable due to the physical characteristics of the state vector components. It can be noted that the procedure for obtaining the controller presented starts from the FOC-type structure which exploits the cascade structure, i.e., the fact that the outer speed control loop provides the control quantity i qref , which will supply the control quantities u d and u q through the current control loops. It can be noted that this structure can be used to follow the steps in designing a backstepping control law. The recursive control design for the backstepping law requires a system consisting of subsystems which radiate out from an inner system to the outer subsystems, and the stabilization is achieved in several stages, each based on a Lyapunov function. In addition, the functions that describe the nonlinearities of the system must be at least of Lipschitz type, a condition which is fulfilled, given that these functions are continuous due to the physical nature of the state vector components.
The backstepping control strategy is performed in a series of stages, as a cascade control system with several stages and applies especially to nonlinear systems. It starts from a stable subsystem and performs a cascade synthesis of the intermediate control signals (virtual controls) until each subsystem is stabilized. A Lyapunov function is used to design the control of each subsystem. Stability is thus ensured and, by choosing the appropriate parameters, we can obtain the intended control performance as well as the parametric robustness of the control system. The calculation of the control laws is recursive, in the sense that in each stage, the calculation is based on the states of the previous system (including the virtual control generated by it), thus ensuring the convergence of the entire control system [26].
In the case of the PMSM control system, i dref = 0, and the control signals i qref , u d , and u q are synthesized based on the backstepping control strategy. Figure 5 presents the block diagram of the PMSM sensorless control system based on the backstepping-type controller and a series of observers for speed, position, and load torque (based on an ESO-type observer), as well as an observer of the load resistance. These four observers are detailed in the next section.
parametric robustness of the control system. The calculation of the control laws is recursive, in the sense that in each stage, the calculation is based on the states of the previous system (including the virtual control generated by it), thus ensuring the convergence of the entire control system [26].
In the case of the PMSM control system, idref = 0, and the control signals iqref, ud, and uq are synthesized based on the backstepping control strategy. Figure 5 presents the block diagram of the PMSM sensorless control system based on the backstepping-type controller and a series of observers for speed, position, and load torque (based on an ESO-type observer), as well as an observer of the load resistance. These four observers are detailed in the next section. Starting from the PMSM rotor speed control loop where the reference speed is ωref, we add the speed error signal of the following type: In the equation of the speed error (12), we note the introduction of an integral term with the amplification factor KIω, which is intended to ensure the convergence under the conditions of parametric uncertainties.
Next, the Lyapunov function ( ) Using this relation, the derivative of the selected Lyapunov function it is obtained as indicated by the following expression: To ensure the stability of the subsystem considered, iqref of the following form can be chosen from the relation (14): Starting from the PMSM rotor speed control loop where the reference speed is ω ref , we add the speed error signal of the following type: In the equation of the speed error (12), we note the introduction of an integral term with the amplification factor K Iω , which is intended to ensure the convergence under the conditions of parametric uncertainties.
Next, the Lyapunov function V ω = 1 2 e 2 ω it is chosen and .
e ω it is calculated like in the following relation (13): Using this relation, the derivative of the selected Lyapunov function it is obtained as indicated by the following expression: To ensure the stability of the subsystem considered, i qref of the following form can be chosen from the relation (14): .
Electronics 2021, 10, 2080 9 of 36 By choosing i qref given by the relation (15), we obtain The block diagram of the synthesization of the control signal i qref is presented in Figure 6.
By choosing iqref given by the relation (15), we obtain The block diagram of the synthesization of the control signal iqref is presented in Figure 6. The backstepping algorithm continues with the stabilization of the current loop iq. For this purpose, the following error is defined: represents the integral action term.
Another Lyapunov function of the following form is considered: By calculating the first derivative of Vq, the next relation can be written: In Equation (18), the following substitution can be made: The 1st order derivative of Vq is computed as: In the relation (20), the control signal uq is synthesized as follows: The block diagram of the synthesization of the control signal uq is presented in Figure  7. The backstepping algorithm continues with the stabilization of the current loop i q . For this purpose, the following error is defined: where e Iq = K Iq t 0 i qre f − i q dt represents the integral action term.
Another Lyapunov function of the following form is considered: By calculating the first derivative of V q , the next relation can be written: In Equation (18), the following substitution can be made: The 1st order derivative of V q is computed as: In the relation (20), the control signal u q is synthesized as follows: The block diagram of the synthesization of the control signal u q is presented in Figure 7. Using the relation (21), the next relation is obtained: If in relation (22) the following substitution is made: we obtain the following relation: Based on this relation, we achieve the stability of the second subsystem. The last loop that will be stabilized with the backstepping algorithm is the current loop id. ideref = 0 is imposed and the control signal ud will be synthesized. For this purpose, the following error is defined: represents the integral action term.
We choose the third Lyapunov function of the following form: Then, the derivative of function Vd is computed: If the next substitution is made in Equation (27): The first order derivative of Vd is obtained as follows: In the relation (29), the control signal ud is synthesized as follows: Using the relation (21), the next relation is obtained: If in relation (22) the following substitution is made: we obtain the following relation: where . V q ≤ −K q V q , and K q = min K ω ; K q + K Iq ; K Iq . Based on this relation, we achieve the stability of the second subsystem. The last loop that will be stabilized with the backstepping algorithm is the current loop i d . i deref = 0 is imposed and the control signal u d will be synthesized. For this purpose, the following error is defined: where e Id = K Id t 0 i dre f − i d dt represents the integral action term.
We choose the third Lyapunov function of the following form: Then, the derivative of function V d is computed: If the next substitution is made in Equation (27): The first order derivative of V d is obtained as follows: Electronics 2021, 10, 2080 11 of 36 In the relation (29), the control signal u d is synthesized as follows: The block diagram of the synthesization of the control signal u d is presented in Figure 8. The block diagram of the synthesization of the control signal ud is presented in Figure  8. If in relation (29), the control signal ud given by the relation (30) is used, then the next relation is obtained: Hence, the stability of the third subsystem is achieved. Based on these relations, we achieve the global stabilization of the PMSM control system in which the requirements are fulfilled: id→idref, iq→iqref, and finally, ω→ωref.

Resistance Estimation and Rotor Speed Estimation Based on the ESO-Type Observer
By using appropriate Lyapunov functions, an observer can be designed for the parameters of the PMSM control system, which has uncertainties. For example, the stator resistance of the PMSM significantly changes its value during operation. Thus, an observer of the resistance Rs will be designed.
Let us note To obtain the negativity of R V  , we choose: Thus, the dynamic expression of the observer for the stator resistance Rs is obtained. The block diagram for the estimation of Rs stator resistances is presented in Figure 9. If in relation (29), the control signal u d given by the relation (30) is used, then the next relation is obtained: Hence, the stability of the third subsystem is achieved. Based on these relations, we achieve the global stabilization of the PMSM control system in which the requirements are fulfilled: i d →i dref , i q →i qref , and finally, ω→ω ref .

Resistance Estimation and Rotor Speed Estimation Based on the ESO-Type Observer
By using appropriate Lyapunov functions, an observer can be designed for the parameters of the PMSM control system, which has uncertainties. For example, the stator resistance of the PMSM significantly changes its value during operation. Thus, an observer of the resistance R s will be designed.
Let us note R s =R s − R s , whereR s represents the estimated value of R s , and R s represents the actual value (yet unknown) of the stator resistance of the PMSM.
Next, a Lyapunov function is chosen of the form [26]: where γ > 0, and in the expressions e 2 ω , e 2 q , e 2 Iq , e 2 d , e 2 Id (presented in the previous section), the value of the stator resistance of the PMSM, R s , is substituted byR s .
s , and we make the calculus for . V R , the following form is obtained: To obtain the negativity of . V R , we choose: .R Thus, the dynamic expression of the observer for the stator resistance R s is obtained. The block diagram for the estimation of R s stator resistances is presented in Figure 9. Electronics 2021, 10, x FOR PEER REVIEW 12 of 36 To estimate the speed of the PMSM rotor and to exploit the nonlinear form of the equations used so far, an ESO-type observer is used. Its general description for a nonlinear system of the form expressed by the relation (35) is presented below [24,25].
Let us consider the non-linear system with disturbances, with a single input and a single output, of the following form: where y (l) represents the l th derivative of the output y, u is the input, and d is the disturbance. Let us note y x = , and hence, the next system is obtained: Using minimum information, the ESO observer system described by the relation (39) will estimate the state variables of the initial system, as well as the term f-lumped disturbances.
By customizing Equations (35)-(39), to estimate the speed of the PMSM rotor, the design starts from Equation (40): where f is the generalized disturbance: Let us note that , and h f =  . Using these formulas, the expression of the angular speed system is obtained as a matrix: To estimate the speed of the PMSM rotor and to exploit the nonlinear form of the equations used so far, an ESO-type observer is used. Its general description for a non-linear system of the form expressed by the relation (35) is presented below [24,25].
Let us consider the non-linear system with disturbances, with a single input and a single output, of the following form: where y (l) represents the lth derivative of the output y, u is the input, and d is the disturbance. Let us note y, . . . , x n = y (n−1) , and hence, the next system is obtained: An additional state of the system is chosen: where: In the description above, the variable f represents lumped disturbances of the system. For the non-linear system, together with the transformations described above given by the relations (35)-(38), we can design an ESO-type observer of the form: Using minimum information, the ESO observer system described by the relation (39) will estimate the state variables of the initial system, as well as the term f -lumped disturbances.
By customizing Equations (35)-(39), to estimate the speed of the PMSM rotor, the design starts from Equation (40): where f is the generalized disturbance: Let us note that x 1 = ω, x 2 = f , and . f = h. Using these formulas, the expression of the angular speed system is obtained as a matrix: where Based on these relations, the structure of the second order ESO-type observer can be written as follows [22,[24][25][26]: Let us consider the bandwidth of the observer ω 0 , and, by assigning the poles of the ESO system to −ω 0 , the observer gain L can be determined based on the equality of polynomials as follows: When the ESO-type observer (ω 0 is chosen as equal to 900 for rapid convergence) is designed like this, as shown in the diagram in Figure 10, the state variable x 1 of the observer will estimate the PMSM rotor speed (Figure 11), and the state variable x 2 of the observer will estimate the term f, which represents the lumped disturbance.
Based on these relations, the structure of the second order ESO-type observer can be written as follows [22,[24][25][26]: Let us consider the bandwidth of the observer ω0, and, by assigning the poles of the ESO system to −ω0, the observer gain L can be determined based on the equality of polynomials as follows: When the ESO-type observer (ω0 is chosen as equal to 900 for rapid convergence) is designed like this, as shown in the diagram in Figure 10, the state variable x1 of the observer will estimate the PMSM rotor speed (Figure 11), and the state variable x2 of the observer will estimate the term f, which represents the lumped disturbance.     Good results are noted with a negligible steady-state error and a response time of about 1 ms. The observer's behavior is also good in light of the fact that it has to respond faster than the global PMSM control system.
Using the rotor speed estimated by the ESO-type observer, the estimation of the angular position of the rotor is obtained as follows: where θ(t 0 ) is the initial position of the rotor in relation to a considered benchmark. The implementation of Equation (48) is presented in Figure 12. Figure 13 shows the result of the numerical simulation of the PMSM rotor position estimation. Good results are noted with a negligible steady-state error and a response time of about 1 ms. The observer's behavior is also good in light of the fact that it has to respond faster than the global PMSM control system.
Using the rotor speed estimated by the ESO-type observer, the estimation of the angular position of the rotor is obtained as follows: where θ(t0) is the initial position of the rotor in relation to a considered benchmark. The implementation of Equation (48) is presented in Figure 12. Figure 13 shows the result of the numerical simulation of the PMSM rotor position estimation.  Based on Equation (41), the estimation of the load torque is obtained as follows: where x1 and x2 are the states of the ESO-type observer. The implementation of Equation (49) is presented in Figure 14. The time evolution of the load torque and of its estimation is presented in Figure 15.  This section presented the numerical simulations for the observers of the stator resistance, speed, and position of the PMSM rotor and of the load torque. We note the sta- Good results are noted with a negligible steady-state error and a response time of about 1 ms. The observer's behavior is also good in light of the fact that it has to respond faster than the global PMSM control system.
Using the rotor speed estimated by the ESO-type observer, the estimation of the angular position of the rotor is obtained as follows: where θ(t0) is the initial position of the rotor in relation to a considered benchmark. The implementation of Equation (48) is presented in Figure 12. Figure 13 shows the result of the numerical simulation of the PMSM rotor position estimation.  Based on Equation (41), the estimation of the load torque is obtained as follows: where x1 and x2 are the states of the ESO-type observer. The implementation of Equation (49) is presented in Figure 14. The time evolution of the load torque and of its estimation is presented in Figure 15.  This section presented the numerical simulations for the observers of the stator re- Based on Equation (41), the estimation of the load torque is obtained as follows: where x 1 and x 2 are the states of the ESO-type observer. The implementation of Equation (49) is presented in Figure 14. The time evolution of the load torque and of its estimation is presented in Figure 15. Good results are noted with a negligible steady-state error and a response time of about 1 ms. The observer's behavior is also good in light of the fact that it has to respond faster than the global PMSM control system.
Using the rotor speed estimated by the ESO-type observer, the estimation of the angular position of the rotor is obtained as follows: where θ(t0) is the initial position of the rotor in relation to a considered benchmark. The implementation of Equation (48) is presented in Figure 12. Figure 13 shows the result of the numerical simulation of the PMSM rotor position estimation.  Based on Equation (41), the estimation of the load torque is obtained as follows: where x1 and x2 are the states of the ESO-type observer. The implementation of Equation (49) is presented in Figure 14. The time evolution of the load torque and of its estimation is presented in Figure 15.     This section presented the numerical simulations for the observers of the stator resistance, speed, and position of the PMSM rotor and of the load torque. We note the stability of the observers, with good results in stationary and in dynamic regime. The short response time of the observers (approximately 1 ms) fulfills the condition for their use in the global PMSM control structure. This section presented the numerical simulations for the observers of the stator resistance, speed, and position of the PMSM rotor and of the load torque. We note the stability of the observers, with good results in stationary and in dynamic regime. The short response time of the observers (approximately 1 ms) fulfills the condition for their use in the global PMSM control structure.

Numerical Simulations for the Sensorless Control of the PMSM
For a PMSM with the nominal parameters specified in Table 1, this section will present the results of the numerical simulations in which the controller is of the backstepping type presented in Section 3, and the position and speed observers of the PMSM rotor, the load torque, and the stator resistance are presented in Section 4. Figure 16 presents the implementation in the MATLAB/Simulink development environment of the sensorless control of the PMSM based on the backstepping PSO controller and ESO-type observer. The main blocks implemented are the ones which synthesize the controls u d , u q , and i qref , the observer for the estimation of the stator resistance, the ESO-type observer for the estimation of the PMSM rotor position and speed, and of the load torque. Furthermore, the blocks performing the Clarke-Park-type direct and reverse implementations, the reference speed and load torque generators, and the block of debugging, analysis and visualization signals are also implemented.

Numerical Simulations for the Sensorless Control of the PMSM
For a PMSM with the nominal parameters specified in Table 1, this section will present the results of the numerical simulations in which the controller is of the backstepping type presented in Section 3, and the position and speed observers of the PMSM rotor, the load torque, and the stator resistance are presented in Section 4. Figure 16 presents the implementation in the MATLAB/Simulink development environment of the sensorless control of the PMSM based on the backstepping PSO controller and ESO-type observer. The main blocks implemented are the ones which synthesize the controls ud, uq, and iqref, the observer for the estimation of the stator resistance, the ESOtype observer for the estimation of the PMSM rotor position and speed, and of the load torque. Furthermore, the blocks performing the Clarke-Park-type direct and reverse implementations, the reference speed and load torque generators, and the block of debugging, analysis and visualization signals are also implemented. Based on the results obtained in Figure 4 at the end of Section 2, which show that, even when using a PI-type controller optimally tuned according to a PSO-type method, it can only provide good results for a relatively limited variation of the system parameters, and Figure 17 presents the results obtained when using a backstepping controller and an ESO-type observer, under the same conditions as in Figure 4, where ωref = 1600 rpm, and there is a load torque change: TL = 1 Nm→4 Nm at time 0.25 s. We note a rise time of less Based on the results obtained in Figure 4 at the end of Section 2, which show that, even when using a PI-type controller optimally tuned according to a PSO-type method, it can only provide good results for a relatively limited variation of the system parameters, and Figure 17 presents the results obtained when using a backstepping controller and an ESOtype observer, under the same conditions as in Figure 4, where ω ref = 1600 rpm, and there is a load torque change: T L = 1 Nm→4 Nm at time 0.25 s. We note a rise time of less than 2 ms and a steady-state error of less than 0.5%, which shows a qualitative improvement in the response of the PMSM control system. The parameters of the backstepping-type controller were tuned using a trial-and-error method. The values of the tuning parameters are: K ω = 0.01, K Iω = 139, K q = 2900, K Iq = 150, γ = 0.01, K d = 100, and K id = 900. To optimize the tuning parameters of the backstepping-type controller, a PSO optimization method is used, and the following optimal parameter values are obtained: Kω = 0.01, KIω = 140, Kq = 5000, KIq = 50, γ = 0.01, Kd = 300, and Kid = 300.
In Figure 18, we note an improvement in the response, in the sense that the steadystate error is almost null, even under the conditions of sudden variation of the load torque from 1 Nm to 4 Nm at time 0.25 s. To demonstrate the parametric robustness of the sensorless PMSM control system based on the backstepping-type controller and ESO-type observer, the following numerical simulations in which the backstepping-type control is optimally tuned using the PSO, To optimize the tuning parameters of the backstepping-type controller, a PSO optimization method is used, and the following optimal parameter values are obtained: K ω = 0.01, K Iω = 140, K q = 5000, K Iq = 50, γ = 0.01, K d = 300, and K id = 300.
In Figure 18, we note an improvement in the response, in the sense that the steadystate error is almost null, even under the conditions of sudden variation of the load torque from 1 Nm to 4 Nm at time 0.25 s.
To demonstrate the parametric robustness of the sensorless PMSM control system based on the backstepping-type controller and ESO-type observer, the following numerical simulations in which the backstepping-type control is optimally tuned using the PSO, show the response of the control system when ω ref reaches 3200 rpm, the load torque varies up to 8 Nm to which a 0.2 Nm uniform random noise is added, and the load resistance and the moment of inertia J vary by up to 100% of the nominal value. Thus, in Figure 19, for ω ref = 1600 rpm and T L = 1 Nm, among the special performances of the control system, we note a response time of approximately 1.5 ms, a rise time of 1 ms, zero steady-state error and neglected overshoot (0.25%). We also note the same special performances in stationary and transitory regime in Figure 20, where there is a doubling of the reference speed: ω ref = 3200 rpm and T L = 0.1 Nm.
In Figure 18, we note an improvement in the response, in the sense that the steadystate error is almost null, even under the conditions of sudden variation of the load torque from 1 Nm to 4 Nm at time 0.25 s. To demonstrate the parametric robustness of the sensorless PMSM control system based on the backstepping-type controller and ESO-type observer, the following numerical simulations in which the backstepping-type control is optimally tuned using the PSO, show the response of the control system when ωref reaches 3200 rpm, the load torque varies up to 8 Nm to which a 0.2 Nm uniform random noise is added, and the load resistance and the moment of inertia J vary by up to 100% of the nominal value. Thus, in Figure 19, for ωref = 1600 rpm and TL = 1 Nm, among the special performances of the control system, we note a response time of approximately 1.5 ms, a rise time of 1 ms, zero steady-state error and neglected overshoot (0.25%). We also note the same special performances in     Figure 21 shows the response of the sensorless PMSM control system where ω ref = 1600 rpm and T L = 8 Nm. We note that even in this case, where the nominal load torque has a double value, good control performance is achieved. In Figures 22 and 23, under the same conditions as those in Figure 21, but to which a 0.2 Nm uniform random noise for the load torque is added, and in which the moment of inertia J has an increase of 100%, and in Figure 23, the stator resistance of the PMSM additionally has an increase of 100%, good performance is achieved in stationary and in dynamic regime, with a proportional increase in the starting current due to mechanical parametric variations.   Figure 21 shows the response of the sensorless PMSM control system where ωref = 1600 rpm and TL = 8 Nm. We note that even in this case, where the nominal load torque has a double value, good control performance is achieved. In Figures 22 and 23, under the same conditions as those in Figure 21, but to which a 0.2 Nm uniform random noise for the load torque is added, and in which the moment of inertia J has an increase of 100%, and in Figure 23, the stator resistance of the PMSM additionally has an increase of 100%, good performance is achieved in stationary and in dynamic regime, with a proportional increase in the starting current due to mechanical parametric variations.

PIL and HIL Stages for Real-Time Implementation and Experimental Results
In the stages of development of a real-time control application, we note the conceptualization and formalization of the problem by phenomenological description using the differential equations, the continuation of the study by following a particular formalism of the control theory, and the synthesis of the controller in the form of equations, followed by several series of numerical simulations performed using specialized simulation environments to test the entire system without resorting to hardware elements (except the PC which runs the numeric simulations). These steps fall within the SIL paradigm and are summarized in Sections 2-5.
The MATLAB/Simulink development environment is used for the real-time implementation of the PMSM sensorless control application using the Motor Control Blockset (MCB) and the Embedded Coder Support Package for TI C2000 Processors toolboxes. The MCB toolbox offers the possibility to implement the FOC control structure by means of specialized blocks for space-vector generator, the Clarke and Park transformations. The code of the PMSM control algorithm compatible with TI C2000 Processors, in particular, with the TMS320F28379D microcontroller, is generated and executed by means of the Embedded Coder Support Package. This package contains a series of block libraries for on-chip and on-board peripherals, digital I/O blocks, ePWM blocks, SPI blocks, blocks for the connection with the PC host, DMC and IQMath libraries to perform code optimization, as well as PIL or HIL block for code generation, validation, testing, or execution of the algorithms developed using a real PMSM [30].
The real-time implementation of the proposed control structure is based on the high performance of the dual-core architecture of the TMS320F28379D microcontroller. Among the technical characteristics of this dual-core microcontroller, we can mention: General-Purpose Input/Output (GPIO); analog subsystems (Analog-to-Digital Converter (ADC) with 12-bit/16-bit resolution, Subsystem Comparator (CMPSS), Buffered Digital-to-Analog Converter (DAC)); control peripherals (16-

PIL Stage
In the stages of development of a real-time control application, we note the conceptualization and formalization of the problem by phenomenological description using the differential equations, the continuation of the study by following a particular formalism of the control theory, the design of the controller in the form of equations, followed by several series of numerical simulations using specialized simulation environments to test the entire system without resorting to hardware elements (except the PC, which performs the numeric simulations). These stages were designed in the previous sections and fall within the SIL paradigm. The next testing step is to fit the system testing into the PIL paradigm. For this purpose, the application software will be downloaded into a development board, but, in order to avoid any problems caused by potential errors that could lead to possible damage to the driven object (in our case the PMSM) by failing to properly set some limitations of the software/hardware protections, the motor is software simulated on the PC host. Figure 24 shows a general diagram of the PIL paradigm into which the application presented is embedded.
The main tasks performed in the PIL test stage consist of: • Checking the execution code by comparing the algorithms of the SIL stage with those used for the download to the hardware target module; • Determining the execution times of the main routines in the algorithm for the implementation in the hardware target model, for the purpose of using the application. • The main tasks described above are performed by several steps as described below: on the PC host. Figure 24 shows a general diagram of the PIL paradigm into which the application presented is embedded. The main tasks performed in the PIL test stage consist of: • Checking the execution code by comparing the algorithms of the SIL stage with those used for the download to the hardware target module; • Determining the execution times of the main routines in the algorithm for the implementation in the hardware target model, for the purpose of using the application. The main tasks described above are performed by several steps as described below:

HIL Stage
The HIL paradigm is achieved by including a real PMSM in the presented assembly. The complete elements for the hardware/software testing are presented in Figure 29.

HIL Stage
The HIL paradigm is achieved by including a real PMSM in the presented assembly. The complete elements for the hardware/software testing are presented in Figure 29.

HIL Stage
The HIL paradigm is achieved by including a real PMSM in the presented assembly. The complete elements for the hardware/software testing are presented in Figure 29. We specify that the software program of the PMSM control system used for the numerical simulations is rewritten with blocks from the MCB and Embedded Coder Support Package for TI C2000 Processors toolboxes, and the continuous integral block 1 s is replaced with a discrete integral block kT s z−1 , where T s is the sampling time, k is the current step, and s and z are complex, continuous, and discrete variables.
The general application program implemented in MATLAB/Simulink using software blocks from MCB toolbox is presented in Figure 30. There is an analogy with the implementation in MATLAB/Simulink in the SIL stage; the main difference is the addition of the Open-Loop-Control block, which implements the starting features of a PMSM.
In Figure 31, we note that the PMSM will be open-loop controlled until an imposed fraction of the rated speed is reached. During this time, the Position Generator block is used, and it generates a ramp-type position signal with a frequency equal to the frequency of the reference voltage. Further, the value of current i q is maintained at a constant preset value (2 A for these applications). Figure 32 shows the implementation in MATLAB/Simulink of the conversion of the signals received from the inverter control into PWM signals that will form the power-supply voltages of the PMSM.
The build stage translates the application program built with Simulink blocks, MCB and Embedded Coder Support Package for TI C2000 Processors toolboxes into executable code compatible with CCS code (C/C++). The deploy stage achieves the transfer of the executable code to TMS320F28379D MCU, and at this moment, it is also possible to start the PMSM control software application (Figure 33). placed with a discrete integral block 1 − z kT s , where Ts is the sampling time, k is the current step, and s and z are complex, continuous, and discrete variables.
The general application program implemented in MATLAB/Simulink using software blocks from MCB toolbox is presented in Figure 30. There is an analogy with the implementation in MATLAB/Simulink in the SIL stage; the main difference is the addition of the Open-Loop-Control block, which implements the starting features of a PMSM. In Figure 31, we note that the PMSM will be open-loop controlled until an imposed fraction of the rated speed is reached. During this time, the Position Generator block is used, and it generates a ramp-type position signal with a frequency equal to the frequency of the reference voltage. Further, the value of current iq is maintained at a constant preset value (2 A for these applications).    In Figure 31, we note that the PMSM will be open-loop controlled until an imposed fraction of the rated speed is reached. During this time, the Position Generator block is used, and it generates a ramp-type position signal with a frequency equal to the frequency of the reference voltage. Further, the value of current iq is maintained at a constant preset value (2 A for these applications).   The build stage translates the application program built with Simulink blocks, MCB and Embedded Coder Support Package for TI C2000 Processors toolboxes into executable code compatible with CCS code (C/C++). The deploy stage achieves the transfer of the executable code to TMS320F28379D MCU, and at this moment, it is also possible to start the PMSM control software application (Figure 33). Figure 34 shows the oscilloscope image of a PWM signal. The build stage translates the application program built with Simulink blocks, MCB and Embedded Coder Support Package for TI C2000 Processors toolboxes into executable code compatible with CCS code (C/C++). The deploy stage achieves the transfer of the executable code to TMS320F28379D MCU, and at this moment, it is also possible to start the PMSM control software application (Figure 33). Figure 34 shows the oscilloscope image of a PWM signal. Figure 33. Build, deploy, and start of the PMSM control algorithm in TMS320F28379D MCU. Figure 33. Build, deploy, and start of the PMSM control algorithm in TMS320F28379D MCU. Figure 34 shows the oscilloscope image of a PWM signal. The software interface developed in MATLAB/Simulink for the monitoring and control of the PMSM sensorless control system in view of performing the analysis and time evolution of the quantities of interest is presented in Figure 35. The software interface developed in MATLAB/Simulink for the monitoring and control of the PMSM sensorless control system in view of performing the analysis and time evolution of the quantities of interest is presented in Figure 35. The software interface developed in MATLAB/Simulink for the monitoring and control of the PMSM sensorless control system in view of performing the analysis and time evolution of the quantities of interest is presented in Figure 35.

Experimental Results
This subsection will present the experimental results, in the sense of real-time implementation of the algorithms presented in the previous sections. Thus, in the first part, we present the implementation of the backstepping algorithm according to the stages presented above and we will demonstrate the similarity of the evolution of the PMSM control system in the SIL and HIL implementations. In the second part of this subsection, we present a comparison of the implementation of HIL, of the backstepping-type, and PI-type algorithms optimized by using a PSO-type method. The superiority of the backstepping algorithm for the PMSM control will be demonstrated by comparison in terms of the response time, the override, the steady-state error, the speed ripple and the improvement of the THD of the stator currents. The nominal parameters of the PMSM used in the SIL and HIL implementations are those presented in Table 1.
After completing the testing steps in HIL stage, Figures 36-40 present real-time evolutions of the estimations of the PMSM rotor speed and position, but also of currents ia and ib, current iq, and of the electromagnetic torque Te. The response of the PMSM control system is presented for a variation of the speed reference ωref defined by the sequence: [0 10 20 30 40] s→[1200 1600 3200 1600 1200] rpm and a load torque with a variation around 1 Nm.

Experimental Results
This subsection will present the experimental results, in the sense of real-time implementation of the algorithms presented in the previous sections. Thus, in the first part, we present the implementation of the backstepping algorithm according to the stages presented above and we will demonstrate the similarity of the evolution of the PMSM control system in the SIL and HIL implementations. In the second part of this subsection, we present a comparison of the implementation of HIL, of the backstepping-type, and PI-type algorithms optimized by using a PSO-type method. The superiority of the backstepping algorithm for the PMSM control will be demonstrated by comparison in terms of the response time, the override, the steady-state error, the speed ripple and the improvement of the THD of the stator currents. The nominal parameters of the PMSM used in the SIL and HIL implementations are those presented in Table 1.
After         Figure 37 presents the real-time evolution for the estimated PMSM rotor position in HIL stage with a detail of the rotor speed positions at 1200 rpm of the rotor speed. Figure 41 shows, in the HIL stage, the evolution of the electromagnetic torque, and of the estimated load torque for a reference of the PMSM rotor speed ω ref = 1600 rpm.
We specify that the sampling period in the numerical simulations in the previous sections is of 0.001 ms. The inner current loop execution speed in the hardware implementation is of 0.05 ms, and the speed loop execution speed is of 0.5 ms. The speed of communication between the PC host and the hardware development platform ensures the real-time viewing of items by a sampling period of 1 ms. Therefore, Figure 42 shows the variation of current i q over an interval of 50 ms (under the same SIL and HIL test conditions, ω ref = 1600 rpm and T L = 1 Nm) achieved by numerical simulation (SIL) and retrieved from the software interface for the monitoring and control application (HIL). It can be noted that there is a similarity between the evolutions of current i q in SIL and HIL implementations, noting that 1000 times more samples are presented in the representation obtained by numerical simulation per time unit.  Figure 41 shows, in the HIL stage, the evolution of the electromagnetic torque, and of the estimated load torque for a reference of the PMSM rotor speed ωref = 1600 rpm. We specify that the sampling period in the numerical simulations in the previous sections is of 0.001 ms. The inner current loop execution speed in the hardware implementation is of 0.05 ms, and the speed loop execution speed is of 0.5 ms. The speed of communication between the PC host and the hardware development platform ensures the realtime viewing of items by a sampling period of 1 ms. Therefore, Figure 42 shows the variation of current iq over an interval of 50 ms (under the same SIL and HIL test conditions, ωref = 1600 rpm and TL = 1 Nm) achieved by numerical simulation (SIL) and retrieved from the software interface for the monitoring and control application (HIL). It can be noted that there is a similarity between the evolutions of current iq in SIL and HIL implementations, noting that 1000 times more samples are presented in the representation obtained by numerical simulation per time unit. Next, a comparison is presented for the implementation of HIL, of the backsteppingtype and PI-type algorithms optimized by using a PSO-type method for PMSM control.  Next, a comparison is presented for the implementation of HIL, of the backsteppingtype and PI-type algorithms optimized by using a PSO-type method for PMSM control. The experimental results obtained in order to make the proposed comparison are presented below. Thus, Figures 43-46 present real-time evolutions of the comparative PMSM rotor speeds, comparative i a and i b currents, comparative i q currents, and comparative electromagnetic torques. There is an improved response time in the case of the backstepping controller compared to the PI-PSO controller, both for an upping step and downing step of the imposed reference speed (55 ms for backstepping controller and 85 ms for PI-PSO controller). Although for both controllers the override is zero, in the case of the backstepping controller, the steady-state error is less than 0.15%, and in the case of the PI-PSO controller, it is less than 0.35%.  A synthetic indicator for comparing the performance of backstepping and PI-PSO controllers is the implementation in the discrete domain of a root mean square integral, given by the speed ripple: where N is the number of samples and ω and ωref are the PMSM rotor speed and PMSM reference speed, respectively. A synthetic indicator for comparing the performance of backstepping and PI-PSO controllers is the implementation in the discrete domain of a root mean square integral, given by the speed ripple: where N is the number of samples and ω and ω ref are the PMSM rotor speed and PMSM reference speed, respectively. Following the calculations based on the recorded speed response signals of the two controllers, by means of the MATLAB/Simulink software interface for the monitoring and control application on the Host PC described in Section 6.2, a ripple of 25.17 rpm was obtained in the case of the backstepping controller and of 32.49 rpm in the case of the PI-PSO controller.
The superiority of the backstepping-type controller over the PI-PSO-type controller is also demonstrated by means of the FFT analysis and THD calculation of stator currents, as shown in Figure 47. There is a smoothing of current harmonics and a reduction in THD from 40.32% to 24.21%. Following the calculations based on the recorded speed response signals of the two controllers, by means of the MATLAB/Simulink software interface for the monitoring and control application on the Host PC described in Section 6.2, a ripple of 25.17 rpm was obtained in the case of the backstepping controller and of 32.49 rpm in the case of the PI-PSO controller. The superiority of the results in terms of the PMSM control in the case of using a backstepping-type controller versus a PI-PSO-type controller is summarized in Table 2.
An image of the experimental stand for testing the PMSM sensorless control system in HIL stage is presented in Figure 48.  The superiority of the backstepping-type controller over the PI-PSO-type controller is also demonstrated by means of the FFT analysis and THD calculation of stator currents, as shown in Figure 47. There is a smoothing of current harmonics and a reduction in THD from 40.32% to 24.21%.  The superiority of the results in terms of the PMSM control in the case of using a backstepping-type controller versus a PI-PSO-type controller is summarized in Table 2. An image of the experimental stand for testing the PMSM sensorless control system in HIL stage is presented in Figure 48.

Conclusions
Based on the FOC-type classic control structure, under the conditions where even the optimization of the tuning parameters of the classic PI controller is performed by a PSOtype method, we note that the PMSM control system can ensure good performance only in the case of limited variations of the system parameters, and not in the case of high dynamics and sudden variations of the load torque. For this purpose, to embed the nonlinearities of the control system, a backstepping-type control law is synthesized, whose tuning parameters are optimized by a PSO method. In terms of estimating the PMSM rotor position speed in order to embed the disturbances of the system, an ESO-type observer is