High Frequency Square-Wave Voltage Injection Scheme-Based Position Sensorless Control of IPMSM in the Low- and Zero- Speed Range

: In this paper, a new sensorless control scheme with the injection of a high-frequency square-wave voltage of an interior permanent-magnet synchronous motor (IPMSM) at low- and zero-speed operation is proposed. Conventional schemes may face the problems of obvious current sampling noise and slow identiﬁcation in the process of magnetic polarity detection at zero speed operation, and the e ﬀ ects of inverter voltage error on the rotor position estimation accuracy at low speed operation. 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 o ﬀ set by uninterruptible square-wave injection is proposed, which is fast in convergence rate of magnetic polarity detection and more distinct. In addition, the strategy injects a two-opposite high-frequency square-wave voltage vectors other than the one voltage vector into the estimated synchronous reference frame (SRF), which can reduce the e ﬀ ects of inverter voltage error on the rotor position estimation accuracy. With this approach, low-pass ﬁlter (LPF) and band-pass ﬁlter (BPF), which are used to obtain the fundamental current component and high-frequency current response with rotor position information respectively in the conventional sensorless control, are removed to simplify the signal process for estimating the rotor position and further improve control bandwidth. Finally, the experimental results on an IPMSM drive platform indicate that the rotor position with good steady state and dynamic performance can be obtained accurately at low-and zero-speed operation with the sensorless control strategy.


Introduction
Permanent-magnet synchronous motors (PMSMs) have been widely applied in industrial fields [1][2][3][4] for the excellent features of high reliability, high efficiency, high torque density, good dynamic performance, etc. According to the structure of the permanent magnet of the rotor, the PMSM can be divided into interior permanent-magnet synchronous motor (IPMSM) and surface-mounted permanent-magnet synchronous motor (SPMSM). Compared with the SPMSM, the IPMSMs have attracted much attention in industrial fields recently due to their greatly improved overload capacity, power density and speed regulation range, which ascribes to the permanent magnet of the IPMSM is located inside the rotor.
To take advantage of these features, the information of rotor position acquired generally by the mechanical sensors, i.e., resolver or encoder, is necessarily required when the field-oriented control (FOC) scheme [5,6] is adopted. However, these mechanical sensors [7,8] mounted on the shaft of a In order to solve the problem of initial position detection in conventional sensorless control of IPMSM, a rotating voltage injection sensorless method of estimating the initial rotor position of a direct torque controlled IPMSM drive is proposed in [22], which injects a HF voltage to the windings and extracts the amplitude of the corresponding stator current components based on motor salient effect. However, this method still has some problems, such as obvious current sampling noise, influence by motor parameter variations, and special position interference. The improvement of the RSVI, PUVI, which has been proven to be the best injection type for the low-and zero-speed position sensorless control [23], can rarely be found for the initial rotor position detection in the sensorless control system. Xie et al. [24] proposed a PUVI method in which the two opposite voltage vectors were injected to reduce the effects of inverter voltage error on the position estimation accuracy. However, this method only studies the low-speed range, and does not conduct research and analysis on the zero-speed range, especially the lack of research on magnetic polarity detection, which is essential for smooth startup and robust control of IPMSM. In [25], the positive and negative test pulse voltages are injected into the estimated d-axis, and the positive direction of the magnetic polarity is judged by the time when the currents at different magnetic polarity are attenuated from the steady state value to 0. However, the position estimation is stopped in the process of polarity identification, which makes the structure of the code more complicated. This problem also exists in [26] and [27], and the interval of signal injection must be existed, resulting in long execution time and poor stability. Then, [28] uses the difference in current measured at zero time of each PWM period to determine the magnetic polarity. The advantage is that no additional injection voltage is required, and the convergence speed is fast. The disadvantage of this method is that the position estimation depends on the accuracy of the current. Once the current signal-to-noise ratio is too small, the rotor position cannot be accurately obtained. Based on the above references and the improvement points of this article, the comparison of Table 1 is obtained. Therefore, in view of the existing sensorless estimation methods for rotor position, a HF square-wave voltage injection scheme-based rotor position estimation of IPMSM in low-speed range and a new method of magnetic polarity detection in zero-speed range are proposed. 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 simple and can quickly converge by comparing the absolute value of the peak-to-peak value in the d-axis high-frequency current response. 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. At the same time, the strategy injects a two-opposite HF square-wave voltage vectors into the estimated SRF, which considers the effects of inverter voltage error on the rotor position estimation accuracy. With this approach, the LPF and the BPF are removed to simplify the signal process for estimating the rotor position and further improve control bandwidth. This paper is organized as follows. First, the rotor position estimation strategy based on conventional HF square-wave voltage injection is analyzed in Section 2. In Section 3, the rotor position estimation strategy based on improved HF square-wave voltage injection and proposed magnetic polarity detection are investigated. Then, in Section 4, comprehensive simulation and experimental setup are introduced and experiments are provided to prove the effectiveness of the improved sensorless control strategy and proposed magnetic polarity detection method. Finally, Section 5 concludes this paper.

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: where u α,βs , i α,βs are the αand β-axes stator voltage and current, respectively. R s is the stator resistance; ω r is the rotor speed; ψ r is the linkage magnetic flux, and d/dt represents derivative operator. L r sum , L r di f are average inductance and differential inductance, respectively, and are defined as L r sum = (L r d + L r q )/2 and L r di f = (L r d − L r q )/2, respectively, where L r d and L r q are d-and q-axis inductance, respectively. θ r is the actual rotor position, and the physical model of actual and estimated rotor reference frames is shown in Figure 1. According to Euler's formula, the voltage and current vector can be described as According to Euler's formula, the voltage and current vector can be described as where U αs , I αs , U βs , and I βs are the magnitudes of → U αs and → I βs 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 ω r can be omitted because the speed is close to 0. Therefore, (1) can be simplified as By adding the two equations in (3), (3) is rewritten as 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 I αβs is the αand β-axes current variation in the stationary reference frame. Therefore, the current variation can be expressed as

Signal-Process Method in the Estimated Rotor Reference Frame
U αβs e j(2θ r −θ u ) )∆t (6) where θ u is the angle of the voltage vector in the stationary reference frame. By converting the current variation in the α-β stationary reference frame to the estimated dr − qr rotating reference frame, the current variation can be rewritten as whereθ r is the estimated position angle. As shown in Figure 1, the relationship between different angles are given as θ u =θ u +θ r θ r = θ err +θ r where θ err andθ u 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-axis is selected as the injection axis, the form of square-wave voltage is shown as where T and t m (T) are the square-wave period, the remainder of t divided by T, respectively.   The current variation in the estimated dr − qr rotating reference frame after injecting the conventional square-wave voltage can be calculated as 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 where C = ∆t(L r d −L r q ) 2L r d L r q u inj , which is a constant. The estimated rotor positionθ r 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.

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

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.

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), when square-wave voltage is injected to the estimated dr -axis, the rotor position angle error signal is in the imaginary part of ∆ → I drqrs However, due to the nonlinearity of the voltage-source inverters, the square-wave voltage cannot be injected into the target position of dr -axis accurately, so a small error will be enlarged from the term ∆t(L r d −L r q ) 2L r d L r q u inj in the real part of ∆ → I drqrs Therefore, when extracting the rotor position angle error signal, the term 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.
Energies 2020, 13, x FOR PEER REVIEW 5 of 24 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. Energies 2020, 13, x FOR PEER REVIEW 6 of 24 Figure 6. The improved physical model of actual and estimated rotor reference frames.

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-

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, and then a negative square-wave voltage of the same magnitude is injected into the reverse direction of qr, 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.
1 Figure 7. The improved control sequence of injection voltage and sampling current at zeroand low-speed.
Define the inverter voltage error as ∆U err−INV . Since the motor speed is very low and the switching period is very short, assuming that ∆U err−INV does not change during the two switching periods, the voltage error caused by the nonlinearity of the inverter can be expressed as By substituting (12) into (7), the simplified equation is rewritten as (13) and (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 Since ∆θ u1 is very close to 0, combining (13), (14), and (15), the obtained equation is calculated as (16).
Similarly, if the injection voltage from the dr-axis is selected, the estimated rotor position angle can be expressed as 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.
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.

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

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 U bias 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 Energies 2020, 13, x FOR PEER REVIEW 9 of 24 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. 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 U bias to 0 at an intermediate time period of a given bias voltage ±U bias , 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.

Magnetic polarity detection
Obtain

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 squarewave 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.

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.

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.
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.

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.    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.

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.    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. 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 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. 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.

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 19a shows the rotor angle and estimation error waveform of conventional HF squarewave 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.  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. 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 and 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. 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.

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 and 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.
Similarly, the magnetic polarity discrimination experiments of the two methods at 120° are shown in Figure 22a and 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

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. 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. 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.   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.

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.