A Novel Voltage Injection Based Offline Parameters Identification for Current Controller Auto Tuning in SPMSM Drives

Jiang Long 1 , Ming Yang 1,*, Yangyang Chen 1, Dianguo Xu 1 and Frede Blaabjerg 2 1 Institute of Power Electronics and Electrical Drives, Harbin Institute of Technology, Harbin 150001, China; volkswage.n@163.com (J.L.); chenyangyang_hit@163.com (Y.C.); xudiang@hit.edu.cn (D.X.) 2 Department of Energy Technology, Aalborg University, 9220 Aalborg, Denmark; fbl@et.aau.dk * Correspondence: yangming@hit.edu.cn; Tel.: +86-133-9460-4501


Introduction
Surface mounted permanent magnet synchronous motors (SPMSMs) are widely used in servo drives and electric vehicles due to their high efficiency, high torque density and good transient performance [1][2][3]. In many control schemes of SPMSMs, such as current controller auto-tuning, model predictive control and electromotive force (EMF) model based sensorless control, accurate values of stator resistance (R s ), dand q-axes inductances (L d and L q ) and permanent magnet (PM) flux linkage (ψ f ) are critical parameters that should be known to improve the control performance [4][5][6]. However, in many cases, the parameters are designed by the motor manufacturers and will not be accurately obtained prior to start up [7]. This has brought dilemmas in real applications and motivated the research on offline parameter identification.
Offline parameter identification has been widely studied in recent decades [7][8][9][10][11][12][13][14][15][16] due to its superior ability to provide motor parameters before the motor starts up [8,12]. Different signals are used in the control strategy to fulfill the parameter identification. Generally speaking, offline parameter identification can be divided into three categories: methods based on closed-loop controllers, methods that use open-loop signal injections and methods that combine both of them, respectively.
The already tuned current controller or speed controller is a must for parameter identifications that require closed-loop controllers [9,11,[13][14][15]. A typical flow chart of this type of method is shown   Flow chart comparison of offline parameter identification for surface mounted permanent magnet synchronous motors (SPMSMs): (a) flow chart of a traditional offline parameter identification [12]; (b) flow chart of the proposed offline parameter identification.
To sum up, voltage injection based offline parameter identification with controllable current or speed feedback and without requirement of inverter nonlinearity compensation is in great need in practical applications. Motivated by this, voltage signal injection based R s , L d , L q and ψ f identification for SPMSMs, which meets all the above-mentioned requirements, is proposed in this paper. Thet overall process can be achieved with very limited motor information such as the rated current (or maximum current) and number of pole pairs. A flow chart of the proposed method is shown in Figure 1b. More concretely: (1) An increased voltage signal is injected through the d-axis, and the R s is calculated using linear regression (LR) at standstill using the information from the voltages and currents.
(2) Two HF voltage signals (with different amplitudes but the same frequency) are injected through the dand q-axes for L d and L q identification, and the L q variation, which is caused by magnetic saturation, is also considered. In addition, with a predesigned voltage amplitude selection process, the desired HF voltage amplitudes are decided automatically, and current feedback is controlled properly.
(3) For ψ f identification, a ramp voltage signal is given as the q axis voltage reference to excite the back EMF, and a proportional-integral (PI) type voltage controller is first proposed to control the motor speed. Influence from inverter nonlinearity is eliminated with the designed operation routine.
The rest of the paper is organized as follows: in Section 2, open-loop voltage injection based offline parameter identification with controllable current and speed is proposed. Section 3 gives the automatic tuning process of the PI current controller. In Section 4, the proposed method is verified on two SPMSMs with different rated powers, and Section 5 concludes the whole paper.

PMSM Mathematical Model
If neglecting iron core saturation, losses and considering stator current as a symmetrical three phase sinusoidal wave, the PMSM stator voltage Equations in a d-q frame can be described as in Equation (1): where u d and u q are dand q-axes voltages, respectively. R s is the stator resistance. L d , L q are the dand q-axes inductances, respectively. ω e is the electrical angular velocity, i d and i q are the current feedback of the dand q-axes, respectively. ψ f is the PM flux linkage, and p is the d/dt operator in time domain. For surface-mounted PMSM (SPMSM) and neglecting the inductance variation caused by magnetic saturation, L d = L q = L.

Voltage Injection Based Stator Resistance Identification Methodology
The R s identification method solely based on voltage injection is proposed in the following. Figure 2 shows the block diagram of the R s identification. A linear increasing voltage signal, as expressed in Equation (2), is injected through the d-axis, and the real position feedback from the encoder is used for Park and inverse Park transmissions. By imposing voltage signals on u * d only (u * q = 0 V), the induced current will keep the rotor self-fixed at its original position.
where u * d and u * q refer to the dand q-axes voltage references, respectively, ∆u Rs d is the incremental voltage to be added at each step, and I max (RMS) is the maximum current of a given motor.

120
  In addition, the solutions of s R and Δuerror are [11] 126

SVPWM
Voltage reference generation (6)  When the motor shaft is at standstill, the values of elements with ω e in Equation (1) are 0. Considering the voltage reference in Equation (2), Equation (1) is expressed by Equation (3). If the current increasing speed is relatively slow by controlling the injected voltage, the value of L d pi d in Equation (3) can be as small as several millivolts. Therefore, it can be ignored. Thus, the R s can be calculated as the gradient of the u d and i d curve during the voltage injection. Moreover, for the safety of a motor, a stop sign is added in Equation (4).
When considering the voltage errors from the inverter nonlinearity, the relationship between u * d and i d is described as u * d = f (i d ) =R s i d + ∆u error during the voltage injection, where ∆u error refers to the lumped voltage errors caused by inverter nonlinearity effects andR s is the identified stator resistance. By using the LR method for R s identification, the relationship ofR s and ∆u error should satisfy n j=1 ∆u error +R s i dj − u * dj 2 = min. Then, Equation (5) should stand: In addition, the solutions ofR s and ∆u error are [11] where u * dj and i dj are the d-axis voltage reference and current feedback at the j-th moment, and n is the amount of sampling number. This is described as Equation (7): where u R s d_up and u R s d_low are voltages that induce the up current limit and the low current limit in the selected current range when using Equation (6), respectively. The selection of these two current limits will be further addressed in Section 2.2.2.
Moreover, since the voltage reference is used in Equation (6),R s should be the total values of stator resistance, resistance in the cables and IGBT on-state resistances. However, it is acceptable to use the identified R s in algorithms such as current controller tuning and model predictive control, because they also use the voltage references in their models.

Valid Current Range Selection for Stator Resistance Identification
One prerequisite to use Equation (6) for R s identification is that the ∆u error should be a constant; otherwise, the varied ∆u error may result in an ill convergence of the identified R s . According to the relationship of ∆u error , i d and u * d , as briefly shown in Figure 3 [19], the ∆u error only becomes a constant when the current is relatively high. This is also the reason why R s identification is always suggested to be conducted at a high current level [9,20]. because they also use the voltage references in their models.  One prerequisite to use Equation (6) for Rs identification is that the Δuerror should be a constant; 137 otherwise, the varied Δuerror may result in an ill convergence of the identified Rs. According to the 138 relationship of Δuerror, id and u * d , as briefly shown in Figure 3 [19], the Δuerror only becomes a constant 139 when the current is relatively high. This is also the reason why Rs identification is always suggested 140 to be conducted at a high current level [9,20].

141
However, the moment that Δuerror becomes a constant is decided by configuration of the inverter 142 (rated current of the IGBTs and switching frequency) in the test but not by a specific current or voltage 143 value [19]. Thus, it is not reasonable to judge when to conduct Equation (6) only using current 144 feedback. Comparatively speaking, it is wiser to suggest when to conduct Equation (6) using the It guarantees that the current range in Equation (6) has fully entered the saturated zone in Figure 3, 147 and it is summarized in the following:

148
(1) The output voltage references are given according to Equation (2)

150
Δuerror and s R , calculated using Equation (6), are defined as Δu

154
(3) Equation (2) is continued and Equation (6) is repeated when id is between a specific current range, say (Imedium, Iup). Δuerror and s R are calculated using Equation (6), and are renamed as Δu However, the moment that ∆u error becomes a constant is decided by configuration of the inverter (rated current of the IGBTs and switching frequency) in the test but not by a specific current or voltage value [19]. Thus, it is not reasonable to judge when to conduct Equation (6) only using current feedback. Comparatively speaking, it is wiser to suggest when to conduct Equation (6) using the variation of ∆u error . Therefore, a method that takes the change of ∆u error into consideration is proposed. It guarantees that the current range in Equation (6) has fully entered the saturated zone in Figure 3, and it is summarized in the following: (1) The output voltage references are given according to Equation (6) is conducted when i d is within a relatively low current range, say (I low , I medium ). ∆u error andR s , calculated using Equation (6), are defined as ∆u   (6) is repeated when i d is between a specific current range, say (I medium , I up ). ∆u error andR s are calculated using Equation (6), and are renamed as ∆u (2) error andR (2) s . The I low , I medium and I up are defined according to Equation (8), in which the α 1 , α 2 and α 3 should satisfy Equation (9).
(4) The values of ∆u (1) error and ∆u (2) error and the values ofR (1) s andR (2) s are compared if: s , Condition2: ∆u (1) error ≈ ∆u (2) error andR (1) s ≈R (2) s (say, the difference between ∆u (1) error and ∆u (2) error is less than 0.02 V and the difference betweenR (1) s andR (2) s is less than 0.02 Ω). If the result meets Condition2, then the correct R s is identified andR (1) s is regarded as the result. The current range I > I low of Condition2 is designated as the valid current range for R s identification under the specific inverter configuration used for test.
If the result meets Condition1, then α 1 , α 2 and α 3 are redefined in (10), but they should still satisfy Equation (9), and the processes in Equations (1)-(4) will be redone until the results meet Condition2 and finish an R s identification. The repetitive current increase process from a low current is shown by the diagram at the bottom of Figure 3.
For Condition1, ∆u s indicates that the current is still in the linear zone or straddles the linear zone and saturated zone, whereas for Condition2, ∆u (1) error ≈ ∆u (2) error andR (1) s ≈R (2) s represent that the current is sufficiently high and has fully entered the saturated zone. The identified R s is the desired value.
It should be noted, as stated above, the current value necessary for the ∆u error curve in Figure 3 to enter its saturated zone is decided by the configuration of the inverter. Therefore, the rated current of the power device can also be used as the baseline current to evaluate the valid current range for R s identification. The reasons to use the I max of a tested motor as the baseline in Equation (8) are as follows: (1) The induced test current during the voltage injection should not exceed the I max of a given motor; otherwise, safety issues such as overcurrent may occur in the motor.
(2) The rated current of the inverter is always higher than the I max of the motor in a typical drive system, and if the induced current is smaller than I max , then the safety of both the motor and the driver is guaranteed.
(3) The investigations in [9,20] show that the I max of the tested motor is always beyond the current value corresponding to the knee point of ∆u error in Figure 3, so it is reasonable to use the I max as a gauge to evaluate when ∆u error enters the saturated zone.

Voltage Injection Based d-and q-Axes Inductances Identification
The HF signal is one of the most commonly used methods for inductance identification. When an HF voltage in (11) is injected into the motor, the d-axis HF current response is in Equation (12): where U d_inj is the magnitude of the injected HF voltage, ω h = 2 × pi × f h (pi ≈ 3.1416 and f h is the injected frequency), ϕ is the phase angle between the resultant stator terminal voltage and current, and I dh is the amplitude of the induced HF current. From the Laplace transform and substituting s = jω h , the expression of U d_inj is in Equation (13): As seen from Equation (13), if the f h is high enough, the ω h will be sufficiently high, then the voltage drop on inductive reactance is much higher than that on stator resistance. Thus, the solution of L d is [9]:L d = U d_inj /I dh ω h (14) whereL d is the identified d-axis inductance. In addition, it should be noted that the current distortion near the zero current clamping (ZCC) zone may affect the identification accuracy. In order to pull the induced current out of the ZCC zone, a small fixed dc voltage U d_dc is added to u * d in Equation (11) to guarantee a more precise L d identification.
As stated in [8], the values of stator inductances are affected by the magnetic saturation level (current magnitude). Since the SPMSM is mostly operated under i * d = 0 (i * d is the d-axis current reference), the influence of the saturated effect on L d can be neglected. However, the variations in L q caused by the saturated effect should be considered. In this paper, the "dc+ac" voltage injection is used to extract L q at a random saturation level, where the dc signal determines the saturation point and the ac signal is used to identify the L q at that saturation point. When an HF voltage in Equation (15) is injected into the motor, the q-axis HF current response is in Equation (16): where U q_inj is the magnitude of the injected HF voltage, I qh is the amplitude of the induced HF current, U q_dc is the dc voltage signal, and its induced dc current is I q_dc . The identified L q is calculated in Equation (17) using a similar derivation of Equation (13) and Equation (14): whereL q is the identified q-axis inductance. However, when using the HF voltage signals for stator inductance identification, the following dilemmas are unavoidable: (1) Due to the existence of inverter nonlinearity effects, the U d_inj in Equation (14) and U q_inj in Equation (16) are not the real voltages that impose on the motor. When considering the voltage errors caused by inverter nonlinearity effects, the real voltages that impose on the motor are rewritten using Equation (18): where U d_inj_r and U q_inj_r refer to the real voltages that impose on a motor and they should be used to replace U d_inj and U q_inj in Equation (14) and Equation (17), respectively.
(2) Due to the absence of a current controller, it is not easy to precisely determine the dc current I q_dc in Equation (16). A strategy is proposed in [10] to approximate the I q_dc using calculation of "U q_dc /R s ", but it should be noted that due to the influence of inverter nonlinearity effects, the induced I q_dc is not a simple division of U q_dc by R s , and an incorrect I q_dc will inevitably cause error to L q identification.
(3) Due to the open-loop voltage injection based character, such as the method in [9,21], the amplitude of the excited HF current is not predictable. This may potentially trigger overcurrent protection, especially in case of low-impedance motors.
To solve the above-mentioned dilemma (1), two sets of HF voltage signals, with the same frequency (f h ), same dc voltage component but different amplitudes U d_inj1 and U d_inj2 (or U q_inj1 and U q_inj2 ), are sequentially injected through the d-axis or q-axis voltage for L d or L q identification. According to Equation (14), if the detected current amplitude excited by U d_inj1 sin(ω h t) is I dh1 and that excited by U d_inj2 sin(ω h t) is I dh2 , then the identified L d can be calculated in Equation (19), and the L q can be calculated in Equation (20) using a similar derivation. There are two advantages for using this method.
(i) Both the dc voltage bias and current bias are removed by simple subtraction in denominators and numerators in Equation (19) and Equation (20). (ii) The voltage errors caused by inverter nonlinearity effects are eliminated; the detailed reasons for this will be further explained at the end of this Subsection.
To solve the aforementioned dilemma (2) and dilemma (3), a general approach is proposed here which preserves the character of voltage injection and achieves a controllable current feedback during the stator inductance identification. First, a voltage signal, which is defined in Equation (21), is given as u * q to detect every U q_dc that should exert on the motor for each desired saturation point (I q_dc ), while the u * d is kept as 0 V. The duration between every k to k+1 period in Equation (21) should be enough to make sure the induced I q_dc has been fully stabilized at every dc voltage step. When the induced current achieves at a steady state, the excited I q_dc (k) and its corresponding U q_dc (k) are recorded accordingly. Second, in order to make sure the excited I dh and I qh are in the controllable range, a voltage amplitude selection strategy to determine the values of U x_inj1 and U x_inj2 (x = d or q) is designed in the following: After knowing the desired dc voltage at a specific saturation point (current level), two current thresholds are subjectively decided (defined as I L low and I L up ). They are bigger than the dc current but close to each other. Then, a fixed frequency HF voltage signal is superposed upon the predetermined U d_dc (for L d identification) or U q_dc (for L q identification). The amplitude of the HF voltage signal is increased from 0 V. Voltage references during this process are shown by Equation (22), and the voltages that induce I L low and I L up are set as U x_inj1 and U x_inj2 (x = d or q), respectively. The incremental voltage at each step can be relatively small for more accurate U x_inj1 and U x_inj2 (x = d or q) detection.
where ∆u L q in Equation (21) and ∆u L in Equation (22) are incremental voltage values to be added at each step. Figure 4 is the block diagram of the proposed dand q-axes inductances identification. Position information from the encoder is used to give the real position. For L d identification, the signal injected in the d-axis enables the rotor to be self-fixed and the identification is achieved at standstill. For L q identification, the q-axis current produces electromagnetic torque, which may rotate the rotor and affect the identification results, so the rotor shaft should be locked using a proper torque for L q identification.

264
The reason that Equation (19) and Equation (20) can eliminate the voltage errors caused by 265 inverter nonlinearity effects is as follows:
The inductance is identified under standstill, so the position feedback is a constant during the 269 identification. As seen from Figure 3, when the current is high enough, the Δuerror is in the saturated the proposed method to control the induced current, Equation (22) is able to decide Ux_inj2 and Ux_inj1 272 (x = d or q) and make their excitation current amplitudes Ixh2 and Ixh1 (x = d or q) quite close. Then,

273
Δuerror2 ≈ Δuerror1 stands. That is to say that Δuerror is eliminated at both high current levels and low 274 current levels by the two HF voltage injection method.

276
The q-axis voltage Equation is expressed in Equation (25). It can be seen that the ψf is associated 277 with electrical angular velocity ωe, so the rotor movement is needed to excite the back-emf and 278 compute the ψf accordingly. In this paper, the ψf identification is conducted under no load condition,

279
and motor shaft free rotation is allowed.
As seen from Equation (25), when the motor is at standstill, the existence of u * q will excite iq, and 281 the iq will generate shaft torque, which enable the movement of the rotor.   The reason that Equation (19) and Equation (20) can eliminate the voltage errors caused by inverter nonlinearity effects is as follows: The numerators of Equation (19) and Equation (20) can be expressed by Equation (23). According to Equation (18), Equation (23) is rewritten as Equation (24).
The inductance is identified under standstill, so the position feedback is a constant during the identification. As seen from Figure 3, when the current is high enough, the ∆u error is in the saturated zone, then ∆u error2 = ∆u error1 stands. When the current is in the linear zone, ∆u error2 ∆u error1 , but with the proposed method to control the induced current, Equation (22) is able to decide U x_inj2 and U x_inj1 (x = d or q) and make their excitation current amplitudes I xh2 and I xh1 (x = d or q) quite close. Then, ∆u error2 ≈ ∆u error1 stands. That is to say that ∆u error is eliminated at both high current levels and low current levels by the two HF voltage injection method.

Voltage Injection Based PM Flux Linkage Identification
The q-axis voltage Equation is expressed in Equation (25). It can be seen that the ψ f is associated with electrical angular velocity ω e , so the rotor movement is needed to excite the back-emf and compute the ψ f accordingly. In this paper, the ψ f identification is conducted under no load condition, and motor shaft free rotation is allowed.
As seen from Equation (25), when the motor is at standstill, the existence of u * q will excite i q , and the i q will generate shaft torque, which enable the movement of the rotor. The induced back-emf will lessen the voltage drop on R s , so the i q (shaft torque) is decreased. If the u * q is controlled properly, balanced voltage drops on R s i q and ω e ψ f can be achieved, then the motor can be regulated at a speed steady state by controlling the u * q only. The reason for the existence of i q under no load is to generate proper torque to overcome the friction on the motor shaft. In addition, since the i d of the SPMSM is always controlled to be 0 A and the L d is very small (just several milli-henry), the value of L d ω e i d in Equation (25) can be ignored compared with the value of ω e ψ f when the speed is not too low. An example can be given using parameters of motor #1 in Table 1. Supposing the speed is 300 r/min (which is 125.6 rad/s for ω e ) and the variation on i d is about 0.2 A, the maximum variation of L d ω e i d is only 0.06, whereas the value of ω e ψ f is 13.95 V. As stated in [14], the influence from inverter nonlinearities is a key factor influencing the identification accuracy of the ψ f . Under the steady state condition and considering the influence from inverter nonlinearity effects, Equation (25) is rewritten as [16]: where DqV dead is the lumped voltage errors caused by inverter nonlinearity effects, V dead is a constant that is related to the parameters of power devices, dc bus voltage and load condition, and Dq is a function of electrical angle θ e and directions of the three phase currents [14]. The expression of Dq is in Equation (27), and the simulated waveform of Dq when using i * d = 0 control is shown in Figure 5.
where i a , i b and i c are A, B and C phase currents, pi ≈ 3.1416, and sign(i) Energies 2020, 13, x FOR PEER REVIEW 10 of 21 As stated in [14], the influence from inverter nonlinearities is a key factor influencing the 292 identification accuracy of the ψf. Under the steady state condition and considering the influence from 293 inverter nonlinearity effects, Equation (25) is rewritten as [16]: where DqVdead is the lumped voltage errors caused by inverter nonlinearity effects, Vdead is a constant 295 that is related to the parameters of power devices, dc bus voltage and load condition, and Dq is a 296 function of electrical angle θe and directions of the three phase currents [14].

301
As seen from Figure 5, the voltage distortion caused by inverter nonlinearity effects on u * q is a 302 combination of a dc component and a sixth-order distortion. It will deteriorate ψf identification 303 accuracy, especially when the speed is relatively low. In order to get rid of the influence from DqVdead, 304 different compensation methods are adopted in [14,22]. However, the methods also have some As seen from Figure 5, the voltage distortion caused by inverter nonlinearity effects on u * q is a combination of a dc component and a sixth-order distortion. It will deteriorate ψ f identification accuracy, especially when the speed is relatively low. In order to get rid of the influence from DqV dead , different compensation methods are adopted in [14,22]. However, the methods also have some practical limitations. First, the polarity of phase currents cannot be accurately detected due to the zero current clamping effect. Second, the electrical angle detection error is inevitable, so the accuracy of Dq is affected, which consequently will affect ψ f identification.
In this paper, ψ f identification which does not need inverter nonlinearity compensation and the establishment of a speed controller and current controller is proposed. The overall process is achieved by controlling the u * q , and its block diagram is shown in Figure 6. It is described as follows: While the motor is at standstill under no load, the u * q is gradually increased, while the u * d is held as constant at 0 V. The torque excited by u * q will enable the speed to accelerate from 0 r/min. When the speed feedback arrives at ω m1 , the speed is maintained to be ω m1 as much as possible by controlling u * q in Equation (28), and the speed steady state is kept at ω m1 for at least time period T 1 . The averages of the accumulated u * q , i q and ω e within T 1 are calculated using Equation (29). Next, the u * q continues to increase in the ramp manner until the speed arrives at ω m2 , similar to the process when the speed is at ω m1 . The speed is maintained at ω m2 as much as possible by controlling u * q in Equation (28) for the duration of T 2 . Then, the mean values of the accumulated u * q , i q and ω e within T 2 are calculated using Equation (30). Finally, the u * q is decreased gradually to 0 V and the ψ f identification is finished. In addition, in order to guarantee that all the information is acquired under the speed steady state, the accumulation processes in T 1 and T 2 are started only when the speed has arrived at ω m1 and ω m2 after a little while.
where Δu ψf q is the adjustment voltage on u * q to control the speed feedback and is designed to be 326 relatively small so that the speeds in T1 and T2 will not suffer drastic variation and a speed steady 327 state is achieved.

328
where * can be expressed as follows: Eq.(28) where ∆u ψ f q is the adjustment voltage on u * q to control the speed feedback and is designed to be relatively small so that the speeds in T 1 and T 2 will not suffer drastic variation and a speed steady state is achieved.
where u * q_1 , i q_1 and ω e_1 are the average values of the q-axis voltage, q-axis current and electrical angular velocity within T 1 , and u * q_2 , i q_2 and ω e_2 are those within T 2 . Besides, N 1 = T 1 /T s and N 2 = T 2 /T s , T s is the sampling period. In this paper the T s is equal to the pulse width modulation (PWM) switching period.
With Equation (29), Equation (30) and the already identifiedR s , expressions of u * q_1 and u * q_2 can be expressed as follows: In this way the sixth-order distortion on DqV dead becomes a constant. Subtracting Equation (31) from Equation (32), the ψ f is calculated as: whereψ f is the identified PM flux linkage, and ∆ω e = ω e_2 − ω e_1 . The value of DqV dead is affected by load condition, since the ψ f is identified under no load and the motor torque is mainly used to overcome the shaft friction. Thus, 1/N 1 DqV dead (k) and 1/N 2 DqV dead (k) in Equation (31) and Equation (32) can be regarded as having the same values [16,23], and they are eliminated by the subtraction in Equation (33). Hence, the voltage error caused by inverter nonlinearity is removed.

Current Controller Parameters Configuration
The tuning process of the PI current controller with the identified motor parameters has been well explained in [4], the schematic of the dand q-axes current controller is shown in Figure 7, where i * d and i * q are the dand q-axes current references. The decoupling voltages u d0 and u q0 are in Equation (34). According to [4], for q-axis, if the transfer function of the current controller is G ACR = K p_iq (1 + K iq_iq /s), then the K i_iq = R s /L q according to R s -L pole cancellation, and the q-axis current closed-loop transfer function is in Equation (35).
where s is the Laplace operator. ω iq is the cutoff frequency of q-axis current controller, and it can be set by the users. According to Equation (35), K p_iq = L q ω iq . The gains for the d-axis current controller can be configured accordingly.

342
The tuning process of the PI current controller with the identified motor parameters has been 343 well explained in [4], the schematic of the d-and q-axes current controller is shown in Figure 7

Experiment Results
The proposed parameter identification scheme is verified on two different SPMSMs: motor #1 is 110SJT-M040D with rated power as 1 kW, and motor #2 is 130SJT-M100D with rated power as 2.5 kW (GSK CNC EQUIPMENT CO., LTD, Guanzhou, China). Their available parameters on the datasheet are listed in Table 1. Both motors are controlled by a servo driver (GE2030T-LA1) (GSK CNC EQUIPMENT CO., LTD, Guanzhou, China) with digital signal processor (DSP) TMS320F28377s (Texas Instruments, Dallas, TX, USA) as the control chip. The current sampling frequency and the voltage reference update frequency are both 8 kHz, the speed sampling frequency is 4 kHz and the dead-time is 1.6 µs. A Magtrol dynamometer (Model: HD-815-8NA from Magtrol, Buffalo, NY, USA) is used to provide torque to lock the motor shaft under L q identification. The experiment platform is shown in Figure 8.
All experiment data are sampled using the DSP and transmitted to the upper monitor software in the computer: the transmission frequency is 8 kHz.

354
The proposed parameter identification scheme is verified on two different SPMSMs: motor #1 is 355 110SJT-M040D with rated power as 1 kW, and motor #2 is 130SJT-M100D with rated power as 2.5 kW 356 (GSK CNC EQUIPMENT CO., LTD, Guanzhou, China). Their available parameters on the datasheet 357 are listed in Table 1

Voltage Injection Based Stator Resistance Identification
For R s identification, motor #1 is used for valid current range selection first. ∆u Rs d is designed small enough as 7.5 × 10 −5 V, the initial values of α 1 , α 2 and α 3 in Equation (10) are set as 0.05, 0.1 and 0.15, respectively, and ∆α is set as 0.05. It should be noted that the values of α n (n = 1, 2, 3) and ∆α can also be set as other values, the settings detailed in this section are just to offer verification that the proposed method in Section 2.2.2. has the ability to find the valid current range for R s identification. Related waveforms obtained by R s identification using the LR method are shown in Figure 9; the shaft is aligned to θ e = 0 • during R s identification. For better presentation, we divided the results into dots. The duration between two dots is 500 ms. The identified R s of motor #2 is 0.37 Ω and the related waveforms are similar to those of motor #1 in Figure 9. Furthermore, it is noteworthy that the proposed method is able to determine the R s but without the need to consider the current delay induced by inductance on the motor phase.
As seen from Figure 9, the results in Figure 9f Figure 9a-e has bigger deviation compared with thê R s in Figure 9f. It approves the effectiveness of the method in Section 2.2.2, which selects a valid current range for LR to obtain an accurate R s identification. Moreover, according to the results in Figure 9f, it should be noted that the selected valid current range (I valid > 5.73 A) for R s identification is already beyond the 1 p.u. of the rated current of motor #1. This further shows that the concept "the R s should be identified beyond 80% of the rated current" in [20] may not be suitable in all conditions, especially for motors with relatively low rated currents. Thus, the current range selection method for R s identification proposed in this paper is more reasonable.

388
As seen from Figure 9, the results in Figure 9f   period, which will influence the detection of Idh and Iqh. The fh is commonly set as or below one tenth

Voltage Injection Based d-and q-Axes Inductances Identification
As stated above, due to the fact that i * d = 0 for SPMSMs, L d only needs to be identified under unsaturated condition, whereas the L q variation caused by the magnetic saturation effect should be considered. The selection of the injected frequency f h is also a tricky task for HF based inductance identification. On the one hand, the f h should be as high as possible to increase the inductive impedance. On the other hand, a too high f h will result in very limited sampling points in a HF current period, which will influence the detection of I dh and I qh . The f h is commonly set as or below one tenth of the sampling frequency (8 kHz in this paper). For tradeoff between identification accuracy and sampling rate, the f h is set as 500 Hz.
By injecting a stepped increase dc voltage in the q-axis in Equation (21), the relationship between i q and u * q of motor #1 at standstill is shown in Figure 10a; similar results for motor #2 at standstill are shown in Figure 11a. Values of u * q and i q in Figures 10a and 11a can be regarded as U q_dc and I q_dc in Equation (15) and Equation (16) in L q identification. In this way, the L q can be identified at a random saturated point by voltage injection only. The identified L q of motor #1 and motor #2 using the proposed method under different current levels are shown by red curves in Figures 10b and 11b, respectively. Moreover, the identified L q of motor #1 and motor #2 using methods in [9] are shown by blue curves in Figures 10b and 11b, respectively. Good consistency of the results using two methods verifies the correctness of the proposed method. In order to avoid undesired shaft rotation, the motor shaft should be locked by the dynamometer with proper torque during the whole L q identification in Figures 10 and 11. shown in Figure 11a. Values of u * q and iq in Figure 10a and Figure 11a can be regarded as Uq_dc and shown by blue curves in Figure 10b and Figure 11b, respectively. Good consistency of the results 415 using two methods verifies the correctness of the proposed method. In order to avoid undesired shaft 416 rotation, the motor shaft should be locked by the dynamometer with proper torque during the whole 417 Lq identification in Figure 10 and Figure 11.

424
It should be noted that the inductance identification in [9] requires inverter nonlinearity 425 compensation, and it is achieved using the look up table based compensation method in [24]. The 426 2 (0.2 mH/div) Iq_dc in Equation (15) and Equation (16) in Lq identification. In this way, the Lq can be identified at a 411 random saturated point by voltage injection only. The identified Lq of motor #1 and motor #2 using 412 the proposed method under different current levels are shown by red curves in Figure 10b and Figure   413 11b, respectively. Moreover, the identified Lq of motor #1 and motor #2 using methods in [9] are 414 shown by blue curves in Figure 10b and Figure 11b, respectively. Good consistency of the results 415 using two methods verifies the correctness of the proposed method. In order to avoid undesired shaft 416 rotation, the motor shaft should be locked by the dynamometer with proper torque during the whole 417 Lq identification in Figure 10 and Figure 11.

424
It should be noted that the inductance identification in [9] requires inverter nonlinearity 425 compensation, and it is achieved using the look up table based compensation method in [24]. The 426 2 (0.2 mH/div) It should be noted that the inductance identification in [9] requires inverter nonlinearity compensation, and it is achieved using the look up table based compensation method in [24]. The voltage ∆u error that is used for inverter nonlinearity compensation is expressed in Equation (36), and the relationship of ∆u error and i d at θ e = 0 • is shown in Figure 12. voltage Δuerror that is used for inverter nonlinearity compensation is expressed in Equation (36), and 427 the relationship of Δuerror and id at θe = 0° is shown in Figure 12.

437
In Figure 13, the dc voltages at these current levels are obtained from the results in Figure 10a

444
The Ld only needs to be identified under unsaturated condition for SPMSMs, and the waveforms 445 for motor #1 and motor #2 are quite similar, so only the Ld identification results of motor #1 are shown 446 in Figure 14. In order to pull the excited id out of the zero current clamping zone, a small dc offset (2

447
A) that will not cause a severe magnetic saturation effect is added to the HF voltage signal.

448
(2 s/div) t (2 mH/div) As seen from Figure 12, the ∆u error increases with the increase of i d at the beginning and becomes a constant eventually. Moreover, the ∆u error has fully entered the saturated zone (with a value of 5.81 V approximately) when i d = 5.73 A. This further verifies the valid current range selection for R s identification in Figure 9.
The L q identification process of motor #1 at x A (x = 8, 9 and 10) is shown in Figure 13.
voltage Δuerror that is used for inverter nonlinearity compensation is expressed in Equation (36), and 427 the relationship of Δuerror and id at θe = 0° is shown in Figure 12.

434
The Lq identification process of motor #1 at x A (x = 8, 9 and 10) is shown in Figure 13.

437
In Figure 13, the dc voltages at these current levels are obtained from the results in Figure 10a

444
The Ld only needs to be identified under unsaturated condition for SPMSMs, and the waveforms 445 for motor #1 and motor #2 are quite similar, so only the Ld identification results of motor #1 are shown 446 in Figure 14. In order to pull the excited id out of the zero current clamping zone, a small dc offset (2

447
A) that will not cause a severe magnetic saturation effect is added to the HF voltage signal.

448
(2 s/div) t  In Figure 13, the dc voltages at these current levels are obtained from the results in Figure 10a and are set as 13.51 V, 14.61 V and 15.73 V, respectively. Voltage thresholds U q_inj1 and U q_inj2 in Equation (20) are chosen as ac voltage amplitudes that induce [x × (1 + 0.05)] A and [x × (1 + 0.1)] A (x = 8, 9, 10), respectively. Figure 13 shows the injected voltage amplitude selection process (waveforms in pink background), the 2 HF voltage injection process (waveforms in yellow background), and the identified L q under different saturation levels. A decrease L q can be seen with the increase of dc current, and this is caused by magnetic saturation effect.
The L d only needs to be identified under unsaturated condition for SPMSMs, and the waveforms for motor #1 and motor #2 are quite similar, so only the L d identification results of motor #1 are shown in Figure 14. In order to pull the excited i d out of the zero current clamping zone, a small dc offset (2 A) that will not cause a severe magnetic saturation effect is added to the HF voltage signal.

469
To sum up, the identified Rs, Ld, Lq and ψf of motor #1 and motor #2 are shown in Table 2  The waveforms in pink, grey and green background in Figure 14 represent the injected voltage amplitude selection, two HF voltage injection and L d calculation processes. The identified L d for motor #2 using similar methods under 2 A dc offset is 1.07 mH.

Voltage Injection Based PM Flux Linkage Identification
The waveforms of ψ f identification in motor #1 are shown in Figure 15, in which the ω m1 is set as 300 r/min and ω m2 is set as 500 r/min.

450
The waveforms in pink, grey and green background in Figure

469
To sum up, the identified Rs, Ld, Lq and ψf of motor #1 and motor #2 are shown in Table 2  As seen from Figure 15a,c, the speed steady state can be easily achieved by controlling the u * q . It is noteworthy that big current oscillation happens on i q , and the oscillation frequency changes with the speed variation. This might be caused by the current measurement offset error according to analysis in [25]. The average calculation in Equation (31) and Equation (32) can be used to extract the average values of i q under the conditions of ω m1 and ω m2 . Moreover, it should be noted that in Figure 15b a short time is needed for i q to reach the steady state after the speed arrives at ω m1 or ω m2 . Therefore, the calculations in Equation (31) and Equation (32) should also be started after the speed has reached the preset reference for a while. The identified ψ f of motor #2 using the same method is 0.127 Wb, and the waveforms are similar to those in Figure 15.
To sum up, the identified R s , L d , L q and ψ f of motor #1 and motor #2 are shown in Table 2. For both motors, the deviations between the identification results and the offline measured values are less than 7%. The accuracy of the methods in this paper is adequate to be potentially applied for the purposes of current controller tuning (PI parameter configuration) (the work in [4] allows a deviation less than 11%), current predictive control (where a 10% parameter deviation is allowed in model predictive control without robust algorithms [26]) or sensorless control (the work in [10] allows a deviation less than 7%). Table 2. Identification results summary.

Current Controller Auto-Tuning
With the identified parameters, the PI current controller of motor #1 is configured according to the contents of Section 3. The expected cutoff frequencies of the current loop of the dand q-axes are both set as 1 kHz (namely, ω id = ω iq = 2 × pi × 1000). The sinusoidal (1kHz) and step reference tracking tests are given through the d-axis and the results are shown in Figure 16. The dand q-axes current waveforms during the speed step (0-1000 r/min) process are given in Figure 17. results under saturated condition are compared in Figure 10 and Figure 11.

491
It can be seen from Figure 16a and Figure 16b that good current tracking ability can be obtained 492 when the current controller is automatically tuned. In Figure 16a, the amplitude attenuation ratio 493 between the feedback current and reference current is about 0.71, and the phase delay between the 494 sinusoidal reference and feedback currents is about 32°. In Figure 17, the q-axis current tracking 495 performance is deteriorated at the q-axis current saturation zone when decoupling voltages are not 496 added, and this can be well enhanced when the decoupling voltages are added.   results under saturated condition are compared in Figure 10 and Figure 11.

491
It can be seen from Figure 16a and Figure 16b that good current tracking ability can be obtained 492 when the current controller is automatically tuned. In Figure 16a, the amplitude attenuation ratio 493 between the feedback current and reference current is about 0.71, and the phase delay between the 494 sinusoidal reference and feedback currents is about 32°. In Figure 17, the q-axis current tracking 495 performance is deteriorated at the q-axis current saturation zone when decoupling voltages are not 496 added, and this can be well enhanced when the decoupling voltages are added.  It can be seen from Figure 16a,b that good current tracking ability can be obtained when the current controller is automatically tuned. In Figure 16a, the amplitude attenuation ratio between the feedback current and reference current is about 0.71, and the phase delay between the sinusoidal reference and feedback currents is about 32 • . In Figure 17, the q-axis current tracking performance is deteriorated at the q-axis current saturation zone when decoupling voltages are not added, and this can be well enhanced when the decoupling voltages are added.

Conclusions
In this paper, a novel voltage injection based offline parameter identification is proposed to obtain R s , L d , L q and ψ f in a given SPMSM and achieve an auto-tuned current controller, and the main contributions are: (1) The overall identification strategies are totally independent from the current controller and speed controller. Moreover, they can be completed automatically with very limited data that are accessible from the nameplate of an SPMSM, such as rated current and number of pole pairs. Thus, they can be easily adopted in industrial applications.
(2) Simple voltage amplitudes selection processes are designed in this paper. Together with the open-loop voltage injection strategies, the proposed methods are able to detect the inductance variation at a random saturation (current) level for a given motor. Meanwhile, it achieves a controllable current and speed by automatically deciding the voltage reference during the entire identification process. These are not achievable in the conventional voltage injection based methods due to the open-loop character.
(3) Practical issues that may influence the identification accuracy, such as valid current range selection for R s identification in a specific inverter configuration and identification errors that are caused by inverter nonlinearity effects, are carefully addressed in this paper. This further improves the accuracy of parameter identification.
The proposed method is experimentally validated through two SPMSMs with different power rates. The results show that the identification errors are less than 7%, which is sufficient for high dynamic current controller auto-tuning for SPMSM drive systems.