State-Space Approach for SPMSM Sensorless Passive Algorithm Tuning

Sensorless algorithms for Permanent Magnet Synchronous Motors (PMSM) have achieved increasing interest in the technical literature over the last few years. They can be divided into active methods and passive methods: the first inject high-frequency signals exploiting rotor anisotropy, whereas the second are based on observers. Recently, a sensorless control based on a rotor flux observer has been presented in the technical literature, which gives very accurate results in terms of rotor position estimation and robustness. In this paper, the aforementioned observer is considered and a procedure for choosing stabilizing gains of the observer is proposed. The contribution of the paper is three-fold: the mathematical modelling of the rotor flux observer, the methodology for the definition of the observer gains, and the presentation of the experimental results.


Introduction
Permanent Magnet Synchronous Motors (PMSMs) are today widely used in industrial applications since they can offer many advantages such as high-power density, high reliability, and efficiency. The field-oriented control (FOC) is one of the most used techniques in order to obtain a good dynamic response [1]; position information is therefore a must-have data for FOC of PMSMs. The main drawbacks arising from the use of position sensors such as resolvers and encoders are the great noise vulnerability and the increasing cost and sizing of the drive, especially for low-power drives [2]. Consequently, many sensorless algorithms for PMSMs have been studied and proposed over the last few years  in order to control the motor without any position sensor, offering significant advantages in terms of reduction of costs, increase of reliability, and removal of wires [3,4]. Sensorless control strategies can be mainly divided into two types: the active methods, using high-frequency signal injection to obtain the information of the rotor position, and the passive methods, consisting of model-based observers, which extract the rotor position by estimating the back electromotive force (back-EMF) or the rotor flux. Since the active methods work well in the low-speed region, while the passive methods guarantee a good performance in the mid to high-speed region, a combination of the two techniques is often used.
Regarding the active methods, some of the possible solutions are the anisotropy-based techniques proposed in [5], and the high-frequency algorithms in [6,7], whereas, among the passive methods, many sensorless control strategies have been proposed, such as the direct back-EMF disturbance observers analysed in [8][9][10][11]. As the back-EMF is proportional to the rotor speed, the efficiency provided by these methods deteriorates at low speeds. For this reason, other common strategies are the Kalman filter-based observers proposed in [4,12], the linkage flux-based observer in [13], and the sliding mode-based observers studied in [14][15][16][17][18][19][20].
The preponderance of the observers proposed in the literature over the past few years work properly under the condition that all electrical motor parameters are exactly known and constant, but these parameters are usually time-varying and uncertain, hence, the design of a robust observer against parameters variation is currently a topic of interest. In [21], Ortega et al. propose a new non-linear flux observer, which is then tested experimentally in [22], and gives very accurate results in terms of rotor position estimation and robustness. A similar observer is introduced by Bobstov et al. [23], and is improved by Choi et al. in [24] by adding a feedback loop to surmount the effect of the permanent-magnet flux linkage constant uncertainty. This robust adaptive observer is tested in different experimental conditions [25].
None of the papers in which this observer is presented show a methodology for the tuning of the two observer gains. Hence, in this paper, the authors are interested in the problem of the design of the two gains of the observer proposed in [24] for a Surface Permanent Magnet Synchronous Motor (SPMSM). Thanks to the linearization of the system and the stability analysis, a satisfactory result is achieved and validated through experimental results. The contents are organized as follows. Section 2 presents the observer and its mathematical modelling, while simulation results are reported in Section 3. Section 4 contains the linearization of the system and the stability analysis which lead to the optimal gains definition. The experimental results are shown in Section 5. Finally, conclusions are drawn in Section 6.

RFO Algorithm and Mathematical Modelling
As mentioned in the Introduction, the rotor flux observer (RFO) presented in [23,24] is considered in this paper. Hence, the theoretic description of this algorithm is carried out more deeply in the following. Firstly, the observer proposed in [23] is introduced, and secondly, the feedback loop developed in [24] in order to avoid DC disturbances is explained.

Observer without the Feedback Loop to Avoid DC Disturbances
If one considers the model of a SPMSM in the stationary α − β frame, the stator flux derivative ( can be defined as in Equation (1) and the stator flux (λ αβ = [λ α , λ β ] T ) as in Equation (2), being ϕ m the Permanent Magnet flux linkage constant and C αβ (θ) = [cos θ, sin θ] T , while θ ∈ S := [0, 2π] is the rotor flux angle. .
The rotor flux (x αβ = [x α , x β ] T ) of a SPMSM can be given by Equation (4). If one differentiates both sides of Equation (4), one obtains Equation (5), where J is given by Equation (6) and p ≡ d dt represents the differential operator. .
Since the sensorless algorithm aims to estimate the rotor position, one can calculate such a quantity taking into account Equation (7).
In [23] an observer with zero initial value is proposed; the state observer q αβ is defined as in Equation (8).
x αβ (t) = q αβ (t) + ξ αβ (9) Since q αβ + ξ αβ 2 = x αβ 2 and x αβ 2 = ϕ 2 m , one can obtain from Equation (9) the relation in Equation (10) In order to obtain a linear regression form, it is necessary to differentiate Equation (10). However, a pure derivative is always associated with noise amplification in real applications, therefore a high-pass filter αp p+α can be applied to both sides of Equation (10). Indeed, αp p+α = p · α p+α , i.e., it is a derivative for low-frequencies but with a low-pass filter form. Applying the high-pass filter to Equation (10) one obtains Equation (11), where y(q αβ ) and Ω αβ (q αβ ) are defined in Equations (12) and (13).
Equation (11) represents a linear regression equation with an unknown parameter ξ. Indeed, it is a product of a known vector Ω αβ (q αβ ), by ξ αβ . Therefore, a parameter estimator can be derived using the descent gradient method, obtaining Equations (15) and (16), where Γ is a gain matrix. The derived sensorless control scheme is shown in Figure 1. ξ . Therefore, a parameter estimator can be derived using the descent gradient method, obtaining Equations (15) and (16), where Γ is a gain matrix. The derived sensorless control scheme is shown in Figure   1.

Feedback Addition to Avoid DC Disturbances
A non-linear feedback loop was added in [24] in order to avoid the problems connected to DC disturbances, as highlighted in blue in Figure 2.

Feedback Addition to Avoid DC Disturbances
A non-linear feedback loop was added in [24] in order to avoid the problems connected to DC disturbances, as highlighted in blue in Figure 2.

Feedback Addition to Avoid DC Disturbances
A non-linear feedback loop was added in [24] in order to avoid the problems connected to DC disturbances, as highlighted in blue in Figure 2.  Adding the feedback containing Γ 1 gain, the observer defined by Equation (17) is obtained.

Simulation Results
In this section, some simulation results are reported in order to better understand the working principle of the RFO considered in this study. Both simulations for the observer proposed in [23] and for the one with the addition of the feedback loop to eliminate DC disturbances [24] are shown below, respectively, as similarly shown in Section 2 for the theoretical description.

Observer without the Feedback Loop to Avoid DC Disturbances
The RFO proposed in [23] has been built in MATLAB/Simulink environment, and some simulation results are shown in the following. Since q αβ is initialized at zero, the two vector components are affected by a bias error. This bias is related to the real initial rotor angle. For simplicity, one can consider the case in which θ 0 = −90 • and ξ αβ is correctly initialized, i.e., as in Equation (18). In this condition, q αβ is given by Equation (19) and x αβ is given by Equation (20). Indeed, the bias of q β is corrected by ξ β , as shown in Figure 3, where simulation results in this particular condition are shown and q β , ξ β , and x β are plotted. In this case, the bias is corrected from the beginning because ξ αβ is initialized correctly, otherwise, the estimator loop provides the correct bias correction. Please note that the bias of q β is inherent in the observer definition; indeed both Equations (18) and (19), and simulation results of Figure 3 are obtained in ideal conditions.
Energies 2021, 14, 7180 6 of 13 The observer proposed in [23] is straightforward and easy to implement. However, it is sensible to DC disturbances, due to the presence of a pure integrator. As an example, one can consider the previous case, with a negative DC error on i α measure. In this case, q α is given by Equation (21) and therefore it diverges. The same simulation results of Figure 3 are shown for this case in Figure 4.
Please note that the observer diverges even if αβ ξ is correctly initialized, as it can be shown more easily in the simulation plot with time enlargement in Figure 5.  The observer proposed in [23] is straightforward and easy to implement. However, it is sensible to DC disturbances, due to the presence of a pure integrator. As an example, one can consider the previous case, with a negative DC error on i α measure. In this case, q α is given by Equation (21) and therefore it diverges. The same simulation results of Figure 3 are shown for this case in Figure 4.  The observer proposed in [23] is straightforward and easy to implement. However, it is sensible to DC disturbances, due to the presence of a pure integrator. As an example, one can consider the previous case, with a negative DC error on i α measure. In this case, q α is given by Equation (21) and therefore it diverges. The same simulation results of Figure 3 are shown for this case in Figure 4.
Please note that the observer diverges even if αβ ξ is correctly initialized, as it can be shown more easily in the simulation plot with time enlargement in Figure 5.  Please note that the observer diverges even if ξ αβ is correctly initialized, as it can be shown more easily in the simulation plot with time enlargement in Figure 5.

Observer with the Addition of the Feedback Loop to Avoid DC Disturbances
The simulation with i α DC disturbance was carried out with the sensorless algorithm defined in Equation (17) and the results are shown in Figure 6. One can note that with the addition of the feedback containing 1 Γ gain, x α has a null average value and q α does not diverge anymore; hence, a more robust result is achieved.

Definition of 2 Γ Gain
From the results shown in the previous section, one can note that the feedback loop containing 1 Γ gain aims at increasing the robustness of the system avoiding q αβ divergence. Since it does not directly affect the estimator inner loop (containing 2 Γ gain), its influence on the estimator dynamic is limited. On the contrary, the estimator loop containing 2 Γ gain is the core of the RFO observer, therefore an appropriate tuning of such a parameter is fundamental to achieve a good drive dynamic response.
Even if this sensorless technique was proposed in [23,24], none of these papers show a methodology for 2 Γ tuning, which is proposed in this paper. If one considers the loop shown in Figure 7, the inputs of the loop are 1 ( ) u y q αβ = and 2 ( ) u q αβ αβ =Ω . Figure 5. q α (yellow), ξ α (blue) and x α (red) when θ 0 = 0 and with i α negative DC error, estimator shown in [23], time axis enlargement, ϕ m = 14 Wb.

Observer with the Addition of the Feedback Loop to Avoid DC Disturbances
The simulation with i α DC disturbance was carried out with the sensorless algorithm defined in Equation (17) and the results are shown in Figure 6. One can note that with the addition of the feedback containing Γ 1 gain, has a null average value and q α does not diverge anymore; hence, a more robust result is achieved.

Observer with the Addition of the Feedback Loop to Avoid DC Disturbances
The simulation with i α DC disturbance was carried out with the sensorless algorithm defined in Equation (17) and the results are shown in Figure 6. One can note that with the addition of the feedback containing 1 Γ gain, x α has a null average value and q α does not diverge anymore; hence, a more robust result is achieved.

Definition of 2 Γ Gain
From the results shown in the previous section, one can note that the feedback loop containing 1 Γ gain aims at increasing the robustness of the system avoiding q αβ divergence. Since it does not directly affect the estimator inner loop (containing 2 Γ gain), its influence on the estimator dynamic is limited. On the contrary, the estimator loop containing 2 Γ gain is the core of the RFO observer, therefore an appropriate tuning of such a parameter is fundamental to achieve a good drive dynamic response.
Even if this sensorless technique was proposed in [23,24], none of these papers show a methodology for 2 Γ tuning, which is proposed in this paper. If one considers the loop shown in Figure 7, the inputs of the loop are 1 ( ) u y q αβ = and 2 ( ) u q αβ αβ =Ω . Figure 6. q α (yellow), ξ α (blue) and x α (red) when θ 0 = 0 and with i α negative DC error, estimator shown in [24].

Definition of Γ 2 Gain
From the results shown in the previous section, one can note that the feedback loop containing Γ 1 gain aims at increasing the robustness of the system avoiding q αβ divergence. Since it does not directly affect the estimator inner loop (containing Γ 2 gain), its influence on the estimator dynamic is limited. On the contrary, the estimator loop containing Γ 2 gain is the core of the RFO observer, therefore an appropriate tuning of such a parameter is fundamental to achieve a good drive dynamic response.
Even if this sensorless technique was proposed in [23,24], none of these papers show a methodology for Γ 2 tuning, which is proposed in this paper. If one considers the loop shown in Figure 7, the inputs of the loop are u 1 = y(q αβ ) and u 2 = Ω αβ (q αβ ).  [24]. αβ ξ  is defined in Equation (22). Please note that for notation simplicity, the αβ subscripts are omitted in the following Equations and complex number notation is exploited.
Since the function 1 f is non-linear, a linearization process should be carried out, as shown in Equation (23). Moreover, since motor drives are discrete systems, Equation (23) Figure 7. Γ 2 loop of estimator proposed in [24].
. ξ αβ is defined in Equation (22). Please note that for notation simplicity, the αβ subscripts are omitted in the following Equations and complex number notation is exploited.
Since the function f 1 is non-linear, a linearization process should be carried out, as shown in Equation (23). Moreover, since motor drives are discrete systems, Equation (23) is linearized as in Equation (24), obtaining the linearized and discretized Equation of the loop in (27) after the algebraic simplifications of Equations (25) and (26). Evaluating the eigenvalues as in Equation (28), one obtains Equation (29), where Tc is the sampling time. . .
If one approximates the output of the observer as a sinusoidal function, as in Equation (30), and neglects the low-pass filter of Ω αβ (q αβ ) function, Equation (31) is derived. Neglecting the stator resistance and the stator inductance, i.e., considering ψω = v , where v represents the peak phase voltage value (e.g., 310 V for a 380 V motor), since the α − β domain is used, one can define the eigenvalues as in Equation (32).
Since, according to the classical control theory, a discrete system is stable if the eigenvalues are inside the circle with a centre in the axis origin and a unitary radius, it follows that the loop of Figure 7 is stable if the condition in Equation (33) is verified. Imposing null eigenvalue, the gain Γ 2 can be defined as in Equation (34).
In Equation (31) the low pass filter is neglected, i.e., the condition in Equation (35) is imposed. Indeed, the high-pass filter can be seen as a combination of a low-pass filter with the derivative operation, as specified in Equation (36). It is interesting to note that when the frequency of the stator voltage is higher than the cut-off frequency of the filter, the eigenvalue is defined as in Equation (37). Since this condition in Equation (38) is verified, it follows that, from a stability point of view, neglecting the low-pass filter is a conservative hypothesis.
As mentioned above, the gain Γ 1 is not critical and its design does not affect significantly the stability of the system compared to Γ 2 ; hence, in the following, the relation Γ 1 = Γ 2 has been imposed.

Experimental Results
Some experimental tests have been carried out in order to evaluate the performance of the gain definition analysis presented in the previous section. The observer was implemented in DSpace Microlab Box (dSPACE GmbH, Paderborn, Germany) control platform and the test bench is reported in Figure 8. Tables 1 and 2 show, respectively, the motor parameters and the observer gains, which are selected with the methodology presented in the previous section.  Γ 0.013 The DSpace system outputs were sent to a PWM inverter (rated current: 300 A, DC link voltage: 550 V) connected to the SPMSM. Both the sampling frequency and the PWM switching frequency were set to 5 kHz. The inverter nonlinearities were non-compensated and the deadtime was 4 μs. A 27 Nm SPMSM was coupled with the test motor and used to provide the load torque when needed. The two tests performed are listed as follows:

Parameter Value
Gain Γ 1 0.013 Gain Γ 2 0.013 The DSpace system outputs were sent to a PWM inverter (rated current: 300 A, DC link voltage: 550 V) connected to the SPMSM. Both the sampling frequency and the PWM switching frequency were set to 5 kHz. The inverter nonlinearities were non-compensated and the deadtime was 4 µs. A 27 Nm SPMSM was coupled with the test motor and used to provide the load torque when needed. The two tests performed are listed as follows: Test 1: a speed reference variation between 180 rad/s and −180 rad/s with linear load torque (rated torque at rated speed); Test 2: a speed reference variation between 180 rad/s and 5 rad/s with no-load. Figure 9 shows measured and estimated speed during a reference variation between 180 rad/s and −180 rad/s (Test 1), while in Figure 10, the results of Test 2 are reported. It can be noted from Figures 9 and 10 that the speed reference is correctly followed both with and without the starting load torque.

Conclusions
A robust sensorless algorithm for a SPMSM is considered. It is based on the rotor flux observer proposed in [21][22][23], and it was improved with a non-linear feedback loop in [24]. The mathematical modelling of the observer is presented in Section 2, while Section 3 contains some simulation results. None of the papers in which this observer is analysed show a methodology for an optimal design of the two observer gains. This paper discusses the architecture of the observer and the effects of the gains 1 Γ and 2 Γ on the system. In particular, since the feedback loop containing 1 Γ gain aims at increasing the robustness of the system with DC disturbances, but it does not directly affect the estimator inner loop (containing 2 Γ gain), its influence on the observer dynamic

Conclusions
A robust sensorless algorithm for a SPMSM is considered. It is based on the rotor flux observer proposed in [21][22][23], and it was improved with a non-linear feedback loop in [24]. The mathematical modelling of the observer is presented in Section 2, while Section 3 contains some simulation results. None of the papers in which this observer is analysed show a methodology for an optimal design of the two observer gains. This paper discusses the architecture of the observer and the effects of the gains 1 Γ and 2 Γ on the system. In particular, since the feedback loop containing 1 Γ gain aims at increasing the robustness of the system with DC disturbances, but it does not directly affect the estimator inner loop (containing 2 Γ gain), its influence on the observer dynamic Figure 10. Reference, measured and estimated speed during Test 2 (speed step from 180 rad/s to 5 rad/s with no-load).

Conclusions
A robust sensorless algorithm for a SPMSM is considered. It is based on the rotor flux observer proposed in [21][22][23], and it was improved with a non-linear feedback loop in [24]. The mathematical modelling of the observer is presented in Section 2, while Section 3 contains some simulation results. None of the papers in which this observer is analysed show a methodology for an optimal design of the two observer gains.
This paper discusses the architecture of the observer and the effects of the gains Γ 1 and Γ 2 on the system. In particular, since the feedback loop containing Γ 1 gain aims at increasing the robustness of the system with DC disturbances, but it does not directly affect the estimator inner loop (containing Γ 2 gain), its influence on the observer dynamic is limited. Hence, the contribution of Γ 1 can be neglected, while the procedure used to define an optimal solution for Γ 2 is proposed in Section 4. The linearization of the nonlinear discrete system and the stability analysis are achieved and validated through the experimental results presented in Section 5. The two tests reported in Figures 9 and 10 show that the speed reference is correctly followed both with and without the starting load torque, with the gains selected with the methodology presented.