**2. Analysis of Rotor Position Estimation Strategy Based on Conventional Square-Wave Voltage Injection**

#### *2.1. Mathematical Model of IPMSM*

Assuming that the IPMSM operates in an unsaturated state with negligible hysteresis loss and eddy current loss, the mathematical model of the IPMSM in the α-β stationary reference frame is given as:

$$
\begin{bmatrix} u\_{\alpha s} \\ u\_{\beta s} \end{bmatrix} = R\_s \begin{bmatrix} i\_{\alpha s} \\ i\_{\beta s} \end{bmatrix} + \begin{bmatrix} L\_{sum}^r + L\_{dif}^r \cos 2\theta\_r & L\_{dif}^r \sin 2\theta\_r \\ L\_{dif}^r \sin 2\theta\_r & L\_{sum}^r - L\_{dif}^r \cos \theta\_r \\ -\sin 2\theta\_r & \cos 2\theta\_r \\ \cos 2\theta\_r & \sin \theta\_r \end{bmatrix} \begin{bmatrix} i\_{\alpha s} \\ i\_{\beta s} \end{bmatrix} + \begin{bmatrix} i\_{\alpha s} \\ i\_{\beta s} \end{bmatrix} + \begin{bmatrix} \omega\_r \\ \omega\_r \end{bmatrix} \tag{1}
$$

where *u*α,β*s*, *i*α,β*<sup>s</sup>* are the α- and β-axes stator voltage and current, respectively. *Rs* is the stator resistance; ω*<sup>r</sup>* is the rotor speed; ψ*<sup>r</sup>* is the linkage magnetic flux, and *d*/*dt*represents derivative operator. *Lr sum*, *L<sup>r</sup> di f* are average inductance and differential inductance, respectively, and are defined as *Lr sum* = (*L<sup>r</sup> <sup>d</sup>* <sup>+</sup> *Lr <sup>q</sup>*)/2 and *Lr di f* = (*L<sup>r</sup> <sup>d</sup>* <sup>−</sup> *Lr <sup>q</sup>*)/2, respectively, where *L<sup>r</sup> <sup>d</sup>* and *L<sup>r</sup> <sup>q</sup>* are d-and q-axis inductance, respectively. θ*<sup>r</sup>* is the actual rotor position, and the physical model of actual and estimated rotor reference frames is shown in Figure 1.

**Figure 1.** Physical model of the actual and estimated rotor reference frames.

According to Euler's formula, the voltage and current vector can be described as

⎧ ⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎩

$$\begin{array}{l} \stackrel{\rightarrow}{\underline{U}\_{\rm as}} = \mathcal{U}\_{\rm as} e^{j\phi\_{r}} \\ \stackrel{\rightarrow}{\underline{U}\_{\beta\kappa}} = \mathcal{U}\_{\beta\kappa} i e^{j\phi\_{r}} \\ \stackrel{\rightarrow}{I}\_{\rm as} = I\_{\alpha\kappa} e^{j\phi\_{r}} \\ \stackrel{\rightarrow}{I}\_{\beta\kappa} = I\_{\beta\kappa} i e^{j\phi\_{r}} \end{array} \tag{2}$$

where *<sup>U</sup>*α*s*, *<sup>I</sup>*α*s*, *<sup>U</sup>*β*s*, and *<sup>I</sup>*β*<sup>s</sup>* are the magnitudes of <sup>→</sup> *<sup>U</sup>*α*<sup>s</sup>* and <sup>→</sup> *I* <sup>β</sup>*<sup>s</sup>* on the α- and β-axes, respectively; *e* is the natural constant; *j* is the imaginary unit.

Under the premise that IPMSM operates at zero- and low-speed range, the product term related to ω*<sup>r</sup>* can be omitted because the speed is close to 0. Therefore, (1) can be simplified as

$$\begin{cases} \begin{aligned} \stackrel{\rightarrow}{L}\underline{I}\_{\rm as} &= R\_{\rm s}\stackrel{\rightarrow}{I}\_{\rm as} + \left(L^{r}\_{\rm sum} + L^{r}\_{\rm dif}\cos 2\theta\_{r}\right)\stackrel{\rightarrow}{d}\frac{\stackrel{\rightarrow}{I}\_{\rm as}}{\underline{d}} - jL^{r}\_{\rm dif}\sin 2\theta\_{r}\frac{\stackrel{\rightarrow}{d}\stackrel{\rightarrow}{I}\_{\rm f}}{\underline{d}}\\ \stackrel{\rightarrow}{L}\underline{I}\_{\rm fs} &= R\_{\rm s}\stackrel{\rightarrow}{I}\_{\rm fs} + jL^{r}\_{\rm dif}\sin 2\theta\_{r}\stackrel{\rightarrow}{d}\frac{\stackrel{\rightarrow}{I}\_{\rm uu}}{\underline{d}} + \left(L^{r}\_{\rm sun} - L^{r}\_{\rm dif}\cos 2\theta\_{r}\right)\stackrel{\rightarrow}{d}\frac{\stackrel{\rightarrow}{I}\_{\rm fs}}{\underline{d}} \end{aligned} \end{cases} \tag{3}$$

By adding the two equations in (3), (3) is rewritten as

$$\begin{split} \overrightarrow{\dot{L}I\_{ds}} + \overrightarrow{\dot{L}I\_{\beta s}} &= \mathcal{R}\_{s} \overrightarrow{\left(\overset{\cdot}{I}\_{ds} + \overset{\cdot}{I}\_{\beta s}\right)} + \frac{\left(\frac{I\_{d}^{r} + I\_{q}^{r}}{2}\right)}{2} \overrightarrow{\left(\frac{d\overset{\cdot}{I}\_{ds}}{dt} + \frac{d\overset{\cdot}{I}\_{\beta s}}{dt}\right)} \\ &+ \frac{\left(\frac{I\_{d}^{r} - I\_{q}^{r}}{2}\right)}{2} \cos 2\theta\_{l} \overrightarrow{\left(\frac{d\overset{\cdot}{I}\_{ds}}{dt} - \frac{d\overset{\cdot}{I}\_{\beta s}}{dt}\right)} + j \frac{\left(\frac{I\_{d}^{r} - I\_{q}^{r}}{2}\right)}{2} \sin 2\theta\_{r} \overrightarrow{\left(\frac{d\overset{\cdot}{I}\_{ds}}{dt} - \frac{d\overset{\cdot}{I}\_{\beta s}}{dt}\right)} \end{split} \tag{4}$$

#### *2.2. Signal-Process Method in the Estimated Rotor Reference Frame*

Figure 2 shows the control system scheme for obtaining position information with the conventional square-wave injection method. By reasonably selecting the injection voltage, the voltage generated on the stator resistance in (4) can be neglected. After Euler transform, (4) is derived as

$$\overrightarrow{I}\underset{a\less b}{\underset{a\less b}{\rightleftharpoons}} = \frac{L\_d^r(\overrightarrow{\mathcal{U}}\_{a\less b} - \overrightarrow{\mathcal{U}}^\*\_{a\less b}e^{i2\mathcal{O}\_r}) + L\_q^r(\overrightarrow{\mathcal{U}}\_{a\less b} + \overrightarrow{\mathcal{U}}^\*\_{a\less b}e^{i2\mathcal{O}\_r})}{2L\_d^rL\_q^r}dt\tag{5}$$

where <sup>→</sup> *U* ∗ αβ*<sup>s</sup>* is the conjugate vector of <sup>→</sup> *U*αβ*s*. Since *d* → *I* αβ*s*/*dt* can be regarded as Δ → *I* αβ*s*/Δ*t* during one PWM switching period, where Δ → *I* αβ*<sup>s</sup>* is the α- and β-axes current variation in the stationary reference frame. Therefore, the current variation can be expressed as

$$
\Delta \stackrel{\rightarrow}{I}\_{\alpha \text{\\$s}} = (\frac{L\_d^r + L\_q^r}{2L\_d^r L\_q^r} \mathcal{U}\_{\alpha \text{\\$s}} e^{j\mathcal{O}\_u} - \frac{L\_d^r - L\_q^r}{2L\_d^r L\_q^r} \mathcal{U}\_{\alpha \text{\\$s}} e^{j(2\mathcal{O}\_r - \mathcal{O}\_u)}) \Delta t \tag{6}
$$

where θ*<sup>u</sup>* is the angle of the voltage vector in the stationary reference frame. By converting the current variation in the <sup>α</sup>-<sup>β</sup> stationary reference frame to the estimated *dr*<sup>ˆ</sup> <sup>−</sup> *qr*<sup>ˆ</sup> rotating reference frame, the current variation can be rewritten as

$$
\Delta \overrightarrow{I}\_{d^\circ q^\circ s} = (\frac{L\_d^r + L\_q^r}{2L\_d^r L\_q^r} - \frac{L\_d^r - L\_q^r}{2L\_d^r L\_q^r} e^{j2(\vartheta\_r - \vartheta\_u - \vartheta\_r)}) \Delta t \cdot \overrightarrow{U}\_{d^\circ q^\circ s} \tag{7}
$$

where θˆ*<sup>r</sup>* is the estimated position angle. As shown in Figure 1, the relationship between different angles are given as

$$\begin{cases} \begin{array}{c} \theta\_{\text{\tiny $\mu$ }} = \hat{\theta}\_{\text{\tiny $\mu$ }} + \hat{\theta}\_{\text{\tiny $\sigma$ }}\\ \theta\_{\text{r}} = \overline{\tilde{\theta}}\_{\text{err}} + \hat{\theta}\_{\text{r}} \end{array} \tag{8}$$

where θ *err* and <sup>θ</sup>ˆ*<sup>u</sup>* are the error angle of the actual rotating reference frame and the estimated rotating reference frame, the angle of the voltage vector in the estimated rotating reference frame, respectively. If *dr*<sup>ˆ</sup> -axis is selected as the injection axis, the form of square-wave voltage is shown as

$$\mathcal{U}\_{\rm inj}(t) = \begin{cases} \mathcal{U}\_{\rm inj} e^{j2\hat{\vartheta}\_w}, 0 < t\_m(T) < \frac{T}{2} \\ 0, \frac{T}{2} < t\_m(T) < T \end{cases} \tag{9}$$

where *T* and *tm*(*T*) are the square-wave period, the remainder of t divided by *T*, respectively.

**Figure 2.** Control system scheme for obtaining position information with the conventional square-wave injection method.

The current variation in the estimated *dr*<sup>ˆ</sup> <sup>−</sup> *<sup>q</sup>r*<sup>ˆ</sup> rotating reference frame after injecting the conventional square-wave voltage can be calculated as

$$\Delta \stackrel{\rightarrow}{I}\_{d^{\tilde{q}} \dot{q}^{\tilde{s}} \text{s}} = \frac{\Delta t (L\_d^r + L\_q^r)}{2L\_d^r L\_q^r} \mathcal{U}\_{\text{inj}} - \frac{\Delta t (L\_d^r - L\_q^r)}{2L\_d^r L\_q^r} \mathcal{U}\_{\text{inj}} \cos(2\tilde{\theta}\_{\text{err}}) - \frac{\Delta t (L\_d^r - L\_q^r)}{2L\_d^r L\_q^r} \mathcal{U}\_{\text{inj}} \sin(2\tilde{\theta}\_{\text{err}}) \text{j} \tag{10}$$

It can be seen from (10) that the error angle can be directly extracted from the imaginary part of the current variation when the error angle is small, which is obtained as

$$\operatorname{Im}(\Delta \stackrel{\rightarrow}{\bar{I}}\_{d'q^s s}) = \Delta \stackrel{\rightarrow}{\bar{I}}\_{q's} = \mathbb{C} \cdot \sin(2\overline{\theta}\_{\ell\tau r}) \approx 2\mathbb{C} \cdot \overline{\theta}\_{\ell\tau r} \tag{11}$$

where *<sup>C</sup>* <sup>=</sup> <sup>Δ</sup>*t*(*Lr d*−*L<sup>r</sup> q*) 2*Lr d Lr <sup>q</sup> uinj*, which is a constant. The estimated rotor position <sup>θ</sup>ˆ*<sup>r</sup>* is obtained by signal-processing in the sensorless control, as shown in Figure 3. The full name of PLL in Figure 3 is phase-locked loop.

**Figure 3.** Signal processing diagram of the conventional square-wave voltage injection method for IPMSM.

#### *2.3. Voltage Vector Injection Scheme*

Since the motor speed is extremely low, i.e., less than 5% of rated speed and the motor state changes minimally during one PWM switching period, the performance of motor is basically the same when the PI controller integrates once every two PWM switching periods and integrates once for each PWM switching period. In the subsequent experiments, one switching frequency of 10 kHz was used, and the injection frequency was 1/2 of the switching frequency. Although the system of rotor position estimation can extract the position information of the rotor and obtain an estimated value, the estimated value may be consistent with the actual position, or may be offset by π rad, so that the positive direction of the actual d-axis cannot be determined. Therefore, the magnetic polarity must be judged before the motor runs at low speeds. The conventional method to solve the problem is usually to inject voltage pulses of equal width in both positive and negative directions into the d-axis in the estimated rotating reference frame. Considering that the duty period of the PWM calculated in the ARM controller will be updated in the next period, the conventional control sequence of injection voltage and sampling current under position-sensorless control at zero- and low-speed is shown in Figure 4.

As can be seen from Figure 4, current sampling was performed at the beginning of each current action period, and the current variation obtained by the difference between the measured currents in the two periods can be used for position estimation. The PI controller of the current loop only acts after the current sampling step in the FOC control period, so by separating the FOC control period and the voltage injection period, an additional low-pass filter for extracting the estimated rotor position can be omitted.

**Figure 4.** Conventional control sequence of injection voltage and sampling current at zeroand low-speed.

### **3. Analysis of Rotor Position Estimation Strategy Based on Improved Square-Wave Voltage Injection**

#### *3.1. Improved Signal-Process Method in the Estimated Rotor Reference Frame*

At low speeds, various position-sensorless driving methods are generally affected by the nonlinear voltage error of the inverter. The nonlinear factors in the voltage-type inverter cause the HF response current to be distorted, which results in the rotor position estimation error and affects the stability of sensorless control. If the error is not compensated, the injected voltage vector cannot be injected into the target axis accurately, resulting in the observation position offset. In (6), *Lr d*+*Lr q* 2*L<sup>r</sup> d Lr q* = −*Lr d*−*Lr q* 2*L<sup>r</sup> d Lr q* , when square-wave voltage is injected to the estimated *dr*<sup>ˆ</sup> -axis, the rotor position angle error signal is obtained from the term ! <sup>−</sup> <sup>Δ</sup>*t*(*L<sup>r</sup> d*−*Lr q*) 2*L<sup>r</sup> d Lr <sup>q</sup> uinj* sin(2<sup>θ</sup> *err*) # in the imaginary part of Δ → *I dr*<sup>ˆ</sup>*qr*<sup>ˆ</sup>*<sup>s</sup>* However, due to the nonlinearity of the voltage-source inverters, the square-wave voltage cannot be injected into the target position of *dr*<sup>ˆ</sup> -axis accurately, so a small error will be enlarged from the term ! Δ*t*(*Lr d*−*Lr q*) 2*L<sup>r</sup> d Lr <sup>q</sup> uinj*# in the real part of Δ → *<sup>I</sup> dr*<sup>ˆ</sup>*qr*<sup>ˆ</sup>*<sup>s</sup>* Therefore, when extracting the rotor position angle error signal, the term ! Δ*t*(*L<sup>r</sup> d*−*L<sup>r</sup> q*) 2*Lr d Lr <sup>q</sup> uinj*# will not be completely eliminated, which will seriously affect the accuracy of conventional square-wave

injection for estimating the rotor position angle. In the conventional method, the observation value of rotor position can be obtained by injecting only one voltage vector in the injection period, but the voltage error affected by the nonlinearity of the voltage-source inverters is not compensated. In addition, the conventional method first calculates the error and then compensates the error, which is not only complicated to operate, but also the digital control systems, e.g., DSP and dSPACE, have a delay of switching periods. Therefore, the voltage error calculated in each switching period will only be compensated in the next switching period, which leads to inaccurate voltage error compensation. Therefore, on the basis of the above injection method, it is important to study a simple and accurate inverter voltage error compensation method to improve the accuracy of rotor position estimation and the control performance of IPMSM.

In order to realize the compensation of the voltage error caused by the nonlinear factor of the inverter, e.g., dead-time of switches and turn-on and turn-off voltage drop of switches, another voltage vector with the same amplitude and opposite direction can be injected in the next switching period of injecting the positive voltage vector on the basis of separating the FOC control period and the square-wave injection period, at which time the PI controller of current loop acts and updates every three switching periods. Figure 5 shows the inverter single-phase bridge arm structure, and the improved physical model of actual and estimated rotor reference frames is shown in Figure 6.

**Figure 5.** Inverter single-phase bridge arm structure.

**Figure 6.** The improved physical model of actual and estimated rotor reference frames.

#### *3.2. Improved Voltage Vector Injection Scheme*

Similarly, the details of the ARM processor update in the next period after calculating the PWM duty period need to be considered. Figure 7 shows the improved control sequence of injection voltage and sampling current under position-sensorless control at zero- and low-speed. As shown in Figure 7, when the IPMSM operates at zero-speed, the initial position detection needs to be performed first, and then the magnetic polarity detection needs to be considered. When the IPMSM operates at low-speed, in the first PWM carrier period, the sensorless control system performs FOC control, without superimposing any high frequency vector. The current response generated by the FOC vector acts as the control current of three PWM periodic current loops. Then, before the beginning of the second PWM carrier period, a positive square-wave voltage is injected into the forward direction of *qr*<sup>ˆ</sup> , and then a negative square-wave voltage of the same magnitude is injected into the reverse direction of *qr*<sup>ˆ</sup> , before the beginning of the third PWM carrier period. Finally, the currents acquired by the second and third PWM periods are compared with the current acquired by the previous PWM period. By making a difference, two varying currents are obtained to calculate the rotor position angle.

**Figure 7.** The improved control sequence of injection voltage and sampling current at zeroand low-speed.

Define the inverter voltage error as Δ*Uerr*−*INV*. Since the motor speed is very low and the switching period is very short, assuming that Δ*Uerr*−*INV* does not change during the two switching periods, the voltage error caused by the nonlinearity of the inverter can be expressed as

$$\begin{cases} \overrightarrow{\mathcal{U}}\_{d^{\mathfrak{d}}q^{\mathfrak{s}}s1} = \mathcal{U}\_{\mathit{inj}}e^{j\partial\_{\mathfrak{s}1}} \\ \approx \mathcal{U}\_{\mathit{inj}}e^{j\pi/2} - \Delta\overrightarrow{\mathcal{U}}\_{\mathit{err}-\mathit{INV}} \\ \overrightarrow{\mathcal{U}}\_{d^{\mathfrak{d}}q^{\mathfrak{s}}s2} = \mathcal{U}\_{\mathit{inj}}e^{j\partial\_{\mathfrak{s}2}} \\ \approx \mathcal{U}\_{\mathit{inj}}e^{-j\pi/2} - \Delta\overrightarrow{\mathcal{U}}\_{\mathit{err}-\mathit{INV}} \end{cases} \tag{12}$$

By substituting (12) into (7), the simplified equation is rewritten as (13) and (14)

$$\begin{split} \Delta \overrightarrow{I}\_{d^{\dagger}q^{\prime}s1} &= \frac{\Lambda t (L\_{d}^{\prime} + L\_{q}^{\prime})}{2L\_{d}^{\prime}L\_{q}^{\prime}} \big( \mathcal{U}\_{\mathrm{in}j} \varepsilon^{\prime} \,^{\dagger} \boldsymbol{\Delta}^{\prime} \boldsymbol{\Pi}\_{\mathrm{crr} - \mathrm{INV}} \boldsymbol{\nu} \big) - \frac{\Lambda t (L\_{d}^{\prime} - L\_{q}^{\prime})}{2L\_{d}^{\prime}L\_{q}^{\prime}} \mathcal{U}\_{\mathrm{in}j} \varepsilon^{\prime} (\boldsymbol{2\tilde{\vartheta}\_{\mathrm{crr}}} - \boldsymbol{\vartheta}\_{\mathrm{il}}) \\ &= \Delta t \big( \frac{L\_{d}^{\prime} + L\_{q}^{\prime}}{2L\_{d}^{\prime}L\_{q}^{\prime}} \mathcal{U}\_{\mathrm{in}j} \varepsilon^{\prime} \,^{\dagger} \boldsymbol{\pi} \big{/} - \frac{L\_{d}^{\prime} + L\_{q}^{\prime}}{2L\_{d}^{\prime}L\_{q}^{\prime}} \Delta \mathcal{U}\_{\mathrm{crr} - \mathrm{INV}} - \frac{L\_{d}^{\prime} - L\_{q}^{\prime}}{2L\_{d}^{\prime}L\_{q}^{\prime}} \mathcal{U}\_{\mathrm{in}j} \varepsilon^{\prime} (\boldsymbol{2\tilde{\vartheta}\_{\mathrm{crr}} - \boldsymbol{\vartheta}\_{\mathrm{il}})} \big) \end{split} \tag{13}$$

$$\begin{split} \Delta \overrightarrow{I}\_{d'q'q2} &= \frac{\Delta t (L\_{q'}^{\prime} + L\_q^{\prime})}{2L\_{d}^{\prime}L\_{q}^{\prime}} (\mathsf{LI}\_{\mathrm{in}j}e^{-j\pi/2} - \Delta \overrightarrow{\mathrm{LI}}\_{\mathrm{err}-\mathrm{INV}}) - \frac{\Delta t (L\_{q}^{\prime} - L\_{q}^{\prime})}{2L\_{d}^{\prime}L\_{q}^{\prime}} \mathsf{LI}\_{\mathrm{in}j}e^{j(2\widetilde{\theta}\_{\mathrm{err}} - \widehat{\theta}\_{\mathrm{in}2})} \\ &= \Delta t (\frac{L\_{q}^{\prime} + L\_{q}^{\prime}}{2L\_{d}^{\prime}L\_{q}^{\prime}} \mathsf{LI}\_{\mathrm{in}j}e^{-j\pi/2} - \frac{L\_{q}^{\prime} + L\_{q}^{\prime}}{2L\_{d}^{\prime}L\_{q}^{\prime}} \Delta \mathsf{LI}\_{\mathrm{err}-\mathrm{INV}} - \frac{L\_{q}^{\prime} - L\_{q}^{\prime}}{2L\_{d}^{\prime}L\_{q}^{\prime}} \mathsf{LI}\_{\mathrm{in}j}e^{j(2\widetilde{\theta}\_{\mathrm{err}} - \widehat{\theta}\_{\mathrm{in}2})} \end{split} \tag{14}$$

Thus, the rotor position estimation scheme can be realized by an improved physical model of actual and estimated rotor reference frames, as shown in Figure 6. In Figure 6, the relationship between angles can be described as

$$\begin{cases} \dot{\theta}\_{\text{u1}} = \pi / 2 + \Delta\theta\_{\text{u1}} \\ \dot{\theta}\_{\text{u2}} = -\pi / 2 - \Delta\theta\_{\text{u2}} \\ \Delta\theta\_{\text{u1}} \approx \Delta\theta\_{\text{u2}} \end{cases} \tag{15}$$

Since Δθ*u*<sup>1</sup> is very close to 0, combining (13), (14), and (15), the obtained equation is calculated as (16).

$$\mathrm{Re}(\triangle \overset{\rightarrow}{I}\_{d'q^t \le 1} - \Delta \overset{\rightarrow}{I}\_{d'q^t \le 2}) = -\frac{\Delta t (L\_d^r - L\_q^r)}{L\_d^r L\_q^r} \mathsf{l} I\_{\mathrm{inj}} \cos \Delta \theta\_{u1} \cdot \sin 2\widetilde{\theta}\_{\mathrm{eff}} = 2\mathsf{C} \cdot \sin 2\widetilde{\theta}\_{\mathrm{eff}} \approx 4\mathsf{C} \cdot \widetilde{\theta}\_{\mathrm{eff}} \tag{16}$$

Similarly, if the injection voltage from the *dr*<sup>ˆ</sup> -axis is selected, the estimated rotor position angle can be expressed as

$$\operatorname{Im} (\Delta \stackrel{\rightarrow}{I}\_{d^{\dagger}q^{\prime}s1} - \Delta \stackrel{\rightarrow}{I}\_{d^{\dagger}q^{\prime}s2}) = 2 \mathbf{C} \cdot \operatorname{sin} 2 \overline{\theta}\_{\text{err}} \approx 4 \mathbf{C} \cdot \overline{\theta}\_{\text{err}} \tag{17}$$

It is observed that the (16) and (17) can finally estimate the rotor position angle after considering the voltage error caused by the nonlinearity of the inverter. Thus, the rotor position-sensorless estimation scheme can be realized by an improved square-wave injection method, as shown in Figure 8.

**Figure 8.** Control system scheme for obtaining position information with the improved square-wave injection method.

#### *3.3. Determining the Direction of Magnetic Polarity*

In the conventional method, after the square-wave voltage is injected, the magnetic polarity is determined by injecting two square-wave pulses of opposite directions and equal durations. However, in the process of software algorithm implementation, the switching task of the algorithm state machine is additionally increased, which makes the structure of the code more complicated, and the noise of the current sampling affects the accuracy of the judgment, which may lead to the magnetic polarity judgment error.

In this paper, a fast-initial position identification method is proposed. After the positive and negative square-wave injection, the given d-axis bias voltage *Ubias* is added and the direction of the bias voltage is changed on the basis of the uninterrupted square-wave injection. By comparing the absolute value of the peak-to-peak value of the d-axis HF current response, the magnetic polarity identification is completed, which is relatively simple.

At the same time, the bias current is not directly given in this paper, but the bias current is generated by a given bias voltage. Figure 9 shows the characteristics curve of the d-axis magnetic circuit and the high-frequency current response diagram. The incremental inductance at *X1* and *X2* can be defined as

**Figure 9.** The characteristics curve of the d-axis magnetic circuit and the high-frequency current response diagram.

As shown in Figure 9, the incremental inductance *L2* is larger than *L1*. Therefore, when the same flux is changed, the current at *X1* changes greatly and the current at *X2* changes little. Since the square-wave is not interrupted during the initial position identification process, the convergence speed of magnetic polarity identification is fast. In addition, it is necessary to set *Ubias* to 0 at an intermediate time period of a given bias voltage ±*Ubias*, so that the fundamental current returns to the initial state. When the d-axis DC bias voltage is the same as the magnetic polarity of the rotor (*X1*), the stator flux saturation is increased, the incremental inductance is decreased, and the absolute value of the d-axis HF response current peak-to-peak value is increased. When the voltage is opposite to the magnetic polarity of the rotor (*X2*), the saturation of the stator flux is weakened, the incremental inductance is increased, and the absolute value of the peak-to-peak value of the d-axis HF response current is decreased.

Therefore, the magnetic polarity identification of the rotor can be realized by comparing the absolute values of the peak-to-peak value of the HF current response generated by the HF voltage under the given bias of the positive and negative d-axis voltage. If the peak-to-peak value of forward HF current is greater than peak-to-peak value of the reverse HF current, the estimated position angle direction is directed to the N pole; i.e., the estimated position angle is the actual position angle of the rotor. In addition, if the peak-to-peak value of forward HF current is less than the peak-to-peak value of reverse HF current, the estimated position angle direction is directed to the S pole, which means the rotor position angle needs to be compensated for π. Figure 10 shows the flow charts of two methods for magnetic polarity identification of the rotor.

**Figure 10.** The flow charts of two methods for magnetic polarity identification of the rotor.

#### **4. Simulation and Experimental Results**

#### *4.1. Simulationl Results*

Because of the need to implement discrete simulation models in Matlab/Simulink, this paper uses the M function in Simulink and the data storage unit to save the discrete data for the next period of calculation. Before conducting the experiment, it is first determined by simulation that the square-wave injection is performed by injecting a HF voltage into the d-axis or a HF voltage into the q-axis. In the simulation, the bus voltage is 310 V, and the amplitude of the injected HF voltage vector is 70 V.

Figure 11 shows the current response when the q-axis is injected with positive and negative pulse voltages for position estimation. Figure 12 shows the current response when the d-axis is injected with positive and negative pulse voltages for position estimation. According to the torque equation of an IPMSM, the q-axis current has a predominant influence on the torque. As shown in Figure 11b, the HF current response with high amplitude is generated in the q-axis, which has a great influence on the torque ripple. However, as shown in Figure 12b, it can be seen that the amplitude of the HF current response in the q-axis is small, which is more conducive to the stability of the control system. Therefore, in subsequent experiments, the rotor position estimation is performed by injecting a HF voltage vector in the *d*-axis instead of the q-axis injection.

**Figure 11.** Current response when the q-axis is injected with positive and negative pulse voltages for position estimation.

**Figure 12.** Current response when the d-axis is injected with positive and negative pulse voltages for position estimation.

## *4.2. Experimental Platform*

In order to verify the feasibility of this method in engineering and the accuracy of rotor position estimation, the proposed position-sensorless control scheme was verified on the platform with a 400W IPMSM, as shown in Figure 13. As shown in Figure 13, the experimental platform mainly includes two parts: the tested system and the load system.

**Figure 13.** The experimental platform.

The tested system can be mainly divided into three groups: (1) the upper computer for status monitoring, (2) the built-in pump motor as the controlled object, and (3) the control and drive system with the Infineon XMC4500 chip as the core. The load system can be mainly divided into three groups: (1) the upper computer for command transmission and status monitoring, (2) the industrial servo drive, and (3) the high-performance servo motor as load. In addition, the controlled motor and the load motor are connected by speed and torque sensors. The IPMSM and system parameters are shown in Table 2.


**Table 2.** IPMSM and system parameters for experiment.

#### *4.3. Initial Rotor Position Estimation*

In the experiment, the PWM switching frequency remains unchanged at 10 kHz. The rotor position estimated by the conventional HF square-wave voltage injection method and the improved HF square-wave voltage injection method are compared, and the obtained experimental waveforms are shown in Figures 14 and 15.

The experimental conditions are as follows: the conventional HF square-wave injection frequency is 10 kHz, and the rotor position is estimated every two PWM switching periods. The improved HF square-wave injection frequency is 10 kHz, and rotor position estimation is performed every three PWM switching periods. The initial position angle is artificially fixed at 30◦, 60◦, 120◦, and 150◦ in advance by acquiring the angle of the encoder. Figure 16 shows the offset angles of the estimated and actual angles of the two methods. The initial position detection in Figure 14c,d and Figure 15c,d are both before the magnetic polarity judgment, and the magnetic polarity judgment are analyzed in the subsequent experiments.

ĐƚƵĂůĂŶŐůĞ ƐƚŝŵĂƚĞĚĂŶŐůĞ

**Figure 14.** Initial position estimation response curve under conventional HF square-wave voltage injection.

ĐƚƵĂůĂŶŐůĞ ƐƚŝŵĂƚĞĚĂŶŐůĞ

**Figure 15.** Initial position estimation response curve under improved HF square-wave voltage injection.

**Figure 16.** The angle error offset of the two methods.

By summarizing the eight initial position estimation response curves in Figures 14 and 15, the relevant data in Table 3 can be sorted out. In addition, the angle error offset is the size of the offset angle generated on the basis of the actual angle, and the fluctuation range of the angle error is generated on the basis of the angle error offset.

**Table 3.** Comparison of initial position estimation parameters for two injection methods.


As shown in Figure 16, the estimated angle of the conventional HF square-wave voltage injection method is offset from the actual angle, but this offset is weakened in the improved HF square-wave voltage injection method, in the conventional method, the angle error offset keep within 6.4◦, which is caused by the inverter voltage error, in the improved method, the angle error offset keep within 3.2◦, it can be seen that the angle error offset is greatly reduced, which is reduced by about 50%, because the improved method reduces the voltage error caused by the nonlinearity of the inverter. It can effectively compensate the voltage error and reduce the influence of the error on the accuracy of rotor position estimation.

#### *4.4. Estimation of Rotor Position at Low Speed*

4.4.1. Comparison of Rotor Position Estimation Before and After Improvement

In the HF injection sensorless control period, the FOC control period time is 100 microseconds, and the positive voltage injection period and negative voltage injection period are also 100 microseconds. Figure 17 shows the comparison of rotor position estimation before and after improvement. As shown in Figure 17a, in the conventional method, the estimation error results in an offset error of around 5◦ and an estimated ripple error of ±7◦. However, in the improved method of Figure 17b, the offset error is close to 0◦ and the estimated ripple error is kept within ±5◦. The analysis diagram of steady-state estimation error of two methods under different low speed conditions is shown in Figure 18.

**Figure 17.** Comparison of rotor position estimation effects between two methods (**a**) Conventional method; (**b**) Improved method.

**Figure 18.** Steady-state estimation error of two injection methods at different speeds.

4.4.2. Rotor Position Observation Experiment Under Forward and Reverse

Figure 19a shows the rotor angle and estimation error waveform of conventional HF square-wave voltage injection method switching back and forth from 5 r/min to −5 r/min. It can be seen that the estimated ripple error can be stabilized within ±10◦ when the rotation speed is 5 r/min, as shown in Figure 19a. The rotor angle and estimation error waveform of conventional HF square-wave voltage injection method switches back and forth from 20 r/min to −20 r/min, as shown in Figure 19b. It can be seen that the estimated ripple error can be stabilized within ±10◦ when the rotation speed is 20 r/min, as shown in Figure 19b.

**Figure 19.** The rotor angle and estimation error waveform of conventional HF square-wave voltage injection method at low-speed operation (**a**) at 5 r/min. (**b**) at 20 r/min.

The rotor angle and estimated error waveform switching back and forth from 5 r/min to −5 r/min and the rotor angle and estimated error waveform switching back and forth from 20 r/min to −20 r/min are shown in Figure 20a,b, respectively. As shown in Figure 20a, it can be seen that the estimated ripple error can be stabilized within ±6◦ when the rotation speed is 5 r/min. It can be seen that the estimated ripple error can be stabilized within ±8◦ when the rotation speed is 20 r/min, as shown in Figure 20b.

**Figure 20.** The rotor angle and estimation error waveform of improved HF square-wave voltage injection method at low-speed operation (**a**) at 5 r/min. (**b**) at 20 r/min.

#### *4.5. Judging Compensation of Magnetic Polarity Direction*

In this section, the effects of the two magnetic polarity discrimination methods are compared at 30◦ and 120◦, respectively. The magnetic polarity discrimination experiments of the two methods at 30◦ are shown in Figure 21a,b, respectively. As shown in Figure 21a, the conventional method uses a 20 V DC bias voltage to identify the magnetic polarity. The proposed method uses a 20 V DC bias voltage to superimpose a 16 V HF square-wave voltage signal, as shown in Figure 21b.

**Figure 21.** The d-axis current characteristic of the rotor at 30◦ for magnetic polarity judgment (**a**) conventional method. (**b**) proposed method.

Similarly, the magnetic polarity discrimination experiments of the two methods at 120◦ are shown in Figure 22a,b, respectively. The experimental data are compared in detail, as shown in Figures 23 and 24. We can divide the process into two stages. When t is between 0 and 0.18 s, the first stage period is the from standstill to startup, that is no procedure and no equipment to be performed at standstill, and the rotor is fixed initially in the startup period. Then, during the second stage, when t is between 0.18 and 0.38 s, the magnetic polarity judgment is performed in order to ensure the accuracy of rotor position estimation. The magnetic polarity identification method proposed in this paper is a combination of HF square-wave voltage injection method and DC bias voltage. In the process of magnetic polarity identification, the HF square-wave voltage injection method has also been updating its angle.

GD[LVYROWDJHJLYHQ GD[LVFXUUHQWUHVSRQVH

**Figure 22.** The d-axis current characteristic of the rotor at 120◦ for magnetic polarity judgment (**a**) conventional method. (**b**) proposed method.

**Figure 23.** Comparative data of *d*-axis current characteristics for magnetic polarity judgment when rotor is located at 30◦.

**Figure 24.** Comparative data of *d*-axis current characteristics for magnetic polarity judgment when rotor is located at 120◦.

Therefore, the method of magnetic polarity identification proposed in this paper is not only suitable for the case where the motor is stationary, but also suitable for the free running condition of the motor. As can be seen from the Figures 21 and 22, the effect of only injecting DC bias voltage on the initial position observation is not very obvious either from the difference of the extreme value of the d-axis current response or from the average value of the steady-state current of the d-axis. If the burr of the current is large, it is easy to affect the judgment result. In 50 repetitive experiments, the probability of method (a) judging errors was about 10%. For method (b), the discrimination is more obvious from the difference of high frequency response of current. In 50 repetitive experiments, the probability of misjudgment was 0, which directly proved that the improved direction judgment of magnetic polarity method proposed in this paper is effective.

#### **5. Conclusions**

In this paper, a HF square-wave voltage injection scheme-based position sensorless control of IPMSM in the low-speed range and a new method of magnetic polarity detection in zero-speed range are proposed. The strategy realizes the switch between zero-speed algorithm and low-speed algorithm for sensorless control of IPMSM. Since the proposed method is an improvement on the conventional square-wave injection method, the method is applicable to AC motors with salient pole effect that can be applied in the conventional method. Furthermore, the voltage error caused by the nonlinearity of the inverter are compensated to improve the accuracy of rotor position estimation. In addition, based on the principle analysis of d-axis magnetic circuit characteristics, a method for determining the direction of magnetic polarity of d-axis two-opposite DC voltage offset by uninterruptible square-wave injection is proposed, which is fast in the convergence rate of magnetic polarity detection Compared with the conventional method, the new method is more distinct and the success rate is higher. Finally, comprehensive simulation and experimental results verify that the improved HF square-wave voltage injection method and the detection of magnetic polarity method perform faster and more accurately compared with the conventional method.

**Author Contributions:** Conceptualization, S.W. and J.Z.; methodology, S.W. and J.Z.; software, K.Y.; validation, S.W., J.Z. and K.Y.; formal analysis, W.S.; data curation, K.Y.; writing—original draft preparation, S.W. and J.Z.; writing—review and editing, S.W. and J.Z. All authors gave advice for the manuscript.

**Funding:** This work was supported in part by the National Key Research and Development Program of China under Grant 2018YFB0104801.

**Conflicts of Interest:** The authors declare no conflict of interest.
