Keywords

1 Introduction

High-performance permanent magnet synchronous motor (PMSM) control systems require position sensors to detect rotor position in real time, but in complex electromagnetic environments and harsh operating conditions position sensors are susceptible to interference or even damage, endangering system safety. Thus, sensorless control has become a focus of motor control research. Recently, rotor current is widely used in PMSM sensorless control due to its extraordinary dynamic performance, and there has been a bunch of successful sensorless control system based on it. For example, Bui’s team has presented one position estimation method by using the slope of the transient fundamental current under the action of the fundamental voltage vector in one PWM cycle [1]. The specific relationship between the fundamental current slope and the position is also obtained by using the artificial neural network slope identification instead of the least square method [2].

Undoubtedly, tons of calculation such us data acquisition, data processing and curve fitting will be involved in this current-position estimation method. When the motor is under high-speed condition, it is very likely that long calculation-time will lead to estimation deviation, affecting the performance of motor. To solve this problem, this paper selects the rotor current slope under the action of a specific voltage vector for position estimation based on SVPWM control. In other words, this method doesn’t collect the whole section of current signal for position estimation, which greatly reduces the amount of calculation in position prediction, and solves the problem of position estimation delay at high motor speed.

On the choice of control chip, FPGA is widely favored for its rapidity and parallelism, while VHDL also has high flexibility and simplicity [5]. However, there are a lot of trigonometric operations and irrational number operations in SVPWM algorithm. Since FPGA can only realize fixed-point operation, when it comes to trigonometric function and radical operation, FPGA need to call the IP core to solve the problem, which makes it difficult to realize SVPWM algorithm. Many researches have simplified SVPWM algorithm by using new sector judgment method [3, 4] to make programming easier. This paper will build a complete Simulink SVPWM control model, and complete the VHDL project by using the combination of MATLAB code generation and manual writing. This method can avoid triangle operation and irrational number operation, reduce a large number of fixed-point operations, and ensure the high accuracy of the system.

2 Fundamental Current Model

In the three-phase coordinate system, the three-phase voltage Eq. of the motor and the self inductance of stator phase winding and mutual inductance Eq. (only phase A is given) is as follows [6]:

$$ \begin{array}{*{20}c} {V_{A} = R_{A} i_{A} + L_{AA} \frac{{di_{A} }}{dt} + L_{AB} \frac{{di_{B} }}{dt} + L_{AC} \frac{{di_{C} }}{dt} + e_{A} } \\ {L_{AA} = L_{{\Sigma }} + L_{\sigma } + L_{\Delta } {\text{cos}}\left( {2\theta_{e} } \right)} \\ {L_{AB} = - L_{{\Sigma }} /2 + L_{\Delta } {\text{cos}}\left( {2\theta_{e} - 2\pi /3} \right)} \\ \end{array} $$
(1)

where \({V}_{A}\), \({V}_{B}\), \({V}_{C}\) are stator voltage, \({i}_{A}\), \({i}_{B}\), \({i}_{C}\) are stator current, \({R}_{A}\), \({R}_{B}\), \({R}_{C}\) are stator resistance, \({e}_{A}\), \({e}_{B}\), \({e}_{C}\) are stator back electromotive force (EMF), \({L}_{AA}\), \({L}_{BB}\), \({L}_{CC}\) are self inductance of stator phase winding, \({L}_{AB}\), \({L}_{BC}\), \({L}_{AC}\) refer to mutual inductance between stator phase windings, where \({L}_{AB}={L}_{BA}\), \({L}_{AB}={L}_{BA}\), \({L}_{AB}={L}_{BA}\), \({\theta }_{e}\) is the electrical angle of the motor, \({L}_{\Sigma }\) and \({L}_{\Delta }\) are the constant component and double frequency component of the main self inductance respectively, \({L}_{\sigma }\) is the leakage inductance of motor stator phase winding.

Taking the voltage vector in the first sector as an example, as shown in Fig. 1. The current slope under the action of two vectors which are the effective voltage vector \({V}_{1}\) (100) in one PWM switching cycle and zero vector \({V}_{7}\) (111) respectively is selected for position estimation [1].

Fig. 1
3 waveforms with step peaks for phases A to C, and a total length of T p w m. The waveforms are divided into 7 segments V 0, V 1, V 3, V 7, V 2, V 1, and V 0 respectively. The step peak is between V 1 and V 1 for phase A, between V 2 and V 2 for phase B, and at V 7 for phase C.

Voltage vector distribution in one PWM cycle

When \({V}_{1}\) (100) is valid, phase A is powered on, while phase B and C is not. The corresponding line voltage is as follows:

$$ \begin{array}{*{20}l} {V_{AB} = V_{DC} = \left( {R_{A} i_{A}^{\left( 1 \right)} + L_{AA} \frac{{di_{A}^{\left( 1 \right)} }}{dt} + L_{AB} \frac{{di_{B}^{\left( 1 \right)} }}{dt} + L_{AC} \frac{{di_{C}^{\left( 1 \right)} }}{dt} + e_{A}^{\left( 1 \right)} } \right)} \hfill \\ { - \left( {R_{B} i_{B}^{\left( 1 \right)} + L_{BA} \frac{{di_{A}^{\left( 1 \right)} }}{dt} + L_{BB} \frac{{di_{B}^{\left( 1 \right)} }}{dt} + L_{BC} \frac{{di_{C}^{\left( 1 \right)} }}{dt} + e_{B}^{\left( 1 \right)} } \right)} \hfill \\ {V_{BC} = 0 = \left( {R_{B} i_{B}^{\left( 1 \right)} + L_{BA} \frac{{di_{A}^{\left( 1 \right)} }}{dt} + L_{BB} \frac{{di_{B}^{\left( 1 \right)} }}{dt} + L_{BC} \frac{{di_{C}^{\left( 1 \right)} }}{dt} + e_{B}^{\left( 1 \right)} } \right)} \hfill \\ { - \left( {R_{C} i_{C}^{\left( 1 \right)} + L_{CA} \frac{{di_{A}^{\left( 1 \right)} }}{dt} + L_{CB} \frac{{di_{B}^{\left( 1 \right)} }}{dt} + L_{CC} \frac{{di_{C}^{\left( 1 \right)} }}{dt} + e_{C}^{\left( 1 \right)} } \right)} \hfill \\ {V_{AC} = V_{DC} = \left( {R_{A} i_{A}^{\left( 1 \right)} + L_{AA} \frac{{di_{A}^{\left( 1 \right)} }}{dt} + L_{AB} \frac{{di_{B}^{\left( 1 \right)} }}{dt} + L_{AC} \frac{{di_{C}^{\left( 1 \right)} }}{dt} + e_{A}^{\left( 1 \right)} } \right)} \hfill \\ { - \left( {R_{C} i_{C}^{\left( 1 \right)} + L_{CA} \frac{{di_{A}^{\left( 1 \right)} }}{dt} + L_{CB} \frac{{di_{B}^{\left( 1 \right)} }}{dt} + L_{CC} \frac{{di_{C}^{\left( 1 \right)} }}{dt} + e_{C}^{\left( 1 \right)} } \right)} \hfill \\ \end{array} $$
(2)

Similarly, when \({V}_{7}\) is valid, phase A, B, C are all powered on. So, \({V}_{AB}={V}_{BC}={V}_{AC}=0\), the corresponding line voltage is as follows:

$$ \begin{array}{*{20}l} {V_{AB} = 0 = \left( {R_{A} i_{A}^{\left( 7 \right)} + L_{AA} \frac{{di_{A}^{\left( 7 \right)} }}{dt} + L_{AB} \frac{{di_{B}^{\left( 7 \right)} }}{dt} + L_{AC} \frac{{di_{C}^{\left( 7 \right)} }}{dt} + e_{A}^{\left( 7 \right)} } \right)} \hfill \\ { - \left( {R_{B} i_{B}^{\left( 7 \right)} + L_{BA} \frac{{di_{A}^{\left( 7 \right)} }}{dt} + L_{BB} \frac{{di_{B}^{\left( 7 \right)} }}{dt} + L_{BC} \frac{{di_{C}^{\left( 7 \right)} }}{dt} + e_{B}^{\left( 7 \right)} } \right)} \hfill \\ {V_{BC} = 0 = \left( {R_{B} i_{B}^{\left( 7 \right)} + L_{BA} \frac{{di_{A}^{\left( 7 \right)} }}{dt} + L_{BB} \frac{{di_{B}^{\left( 7 \right)} }}{dt} + L_{BC} \frac{{di_{C}^{\left( 7 \right)} }}{dt} + e_{B}^{\left( 7 \right)} } \right)} \hfill \\ { - \left( {R_{C} i_{C}^{\left( 7 \right)} + L_{CA} \frac{{di_{A}^{\left( 7 \right)} }}{dt} + L_{CB} \frac{{di_{B}^{\left( 7 \right)} }}{dt} + L_{CC} \frac{{di_{C}^{\left( 7 \right)} }}{dt} + e_{C}^{\left( 7 \right)} } \right)} \hfill \\ {V_{AC} = 0 = \left( {R_{A} i_{A}^{\left( 7 \right)} + L_{AA} \frac{{di_{A}^{\left( 7 \right)} }}{dt} + L_{AB} \frac{{di_{B}^{\left( 7 \right)} }}{dt} + L_{AC} \frac{{di_{C}^{\left( 7 \right)} }}{dt} + e_{A}^{\left( 7 \right)} } \right)} \hfill \\ { - \left( {R_{C} i_{C}^{\left( 7 \right)} + L_{CA} \frac{{di_{A}^{\left( 7 \right)} }}{dt} + L_{CB} \frac{{di_{B}^{\left( 7 \right)} }}{dt} + L_{CC} \frac{{di_{C}^{\left( 7 \right)} }}{dt} + e_{C}^{\left( 7 \right)} } \right)} \hfill \\ \end{array} $$
(3)

Since the switching action is extremely fast, it can be assumed that the motor position and EMF will not change in one switching cycle. In Eq. 2 and Eq. 3, it can be obtained that eA(1) = eA(7), eB(1) = eB(7), eC(1) = eC(7). At the same time, the voltage drop of the stator winding is far less than the bus voltage VDC, which can be ignored. Meanwhile, the stator windings adopt star connection mode, which means \({i}_{A}+{i}_{B}+{i}_{C}=0\). Equation 4 can be obtained after derivation.

$$ \left( {\frac{{di_{A}^{\left( 1 \right)} }}{dt} - \frac{{di_{A}^{\left( 7 \right)} }}{dt}} \right) + \left( {\frac{{di_{B}^{\left( 1 \right)} }}{dt} - \frac{{di_{B}^{\left( 7 \right)} }}{dt}} \right) + \left( {\frac{{di_{C}^{\left( 1 \right)} }}{dt} - \frac{{di_{C}^{\left( 7 \right)} }}{dt}} \right) = 0 $$
(4)

Subtract Eq. 3 from Eq. 2 and combine Eq. 4, finally we can get Eq. 5 as follows:

$$ \begin{array}{*{20}c} {\frac{{di_{A}^{\left( 1 \right)} }}{dt} - \frac{{di_{A}^{\left( 7 \right)} }}{dt} = \frac{1}{g}\left( {2 - \frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}\cos \left( {2\theta_{e} } \right)} \right)} \\ {\frac{{di_{B}^{\left( 1 \right)} }}{dt} - \frac{{di_{B}^{\left( 7 \right)} }}{dt} = - \frac{1}{g}\left( {1 + \frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}\cos \left( {2\theta_{e} - \frac{2\pi }{3}} \right)} \right)} \\ {\frac{{di_{C}^{\left( 1 \right)} }}{dt} - \frac{{di_{C}^{\left( 7 \right)} }}{dt} = - \frac{1}{g}\left( {1 + \frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}\cos \left( {2\theta_{e} - \frac{4\pi }{3}} \right)} \right)} \\ {g = \frac{9}{{2V_{DC} }}\left( {L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}} \right)\left( {1 - \left( {\frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}} \right)^{2} } \right)} \\ \end{array} $$
(5)

Define three positional variables \(p_{A}\), \(p_{B}\), \(p_{C}\) and make it equal to the following equation:

$$ \begin{array}{*{20}c} {p_{A} = \frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}\cos \left( {2\theta_{e} } \right)} \\ {p_{B} = \frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}\cos \left( {2\theta_{e} - \frac{2\pi }{3}} \right)} \\ {p_{C} = \frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}\cos \left( {2\theta_{e} - \frac{4\pi }{3}} \right)} \\ \end{array} $$
(6)

Substitute Eq. 6 into Eq. 5, finally we can obtain the relationship between the slope of the transient current and the position variables:

$$ \begin{array}{*{20}c} {p_{A} = 2 - g\left( {\frac{{di_{A}^{\left( 1 \right)} }}{dt} - \frac{{di_{A}^{\left( 7 \right)} }}{dt}} \right)} \\ {p_{B} = - 1 - g\left( {\frac{{di_{C}^{\left( 1 \right)} }}{dt} - \frac{{di_{C}^{\left( 7 \right)} }}{dt}} \right)} \\ {p_{C} = - 1 - g\left( {\frac{{di_{B}^{\left( 1 \right)} }}{dt} - \frac{{di_{B}^{\left( 7 \right)} }}{dt}} \right)} \\ \end{array} $$
(7)

It can be seen from the above derivation that in one PWM switching cycle, the three-phase position variables can be calculated using the slope of the transient rotor current under the action of the effective vector V1 and the zero vector V7, and the rotor position can be finally calculated. Similarly, the position information can also be estimated by using the current slope under the action of other effective vectors and zero vector V7. See Table 1 [1] for the specific results.

Table 1 Position variables under different effective vectors

Taking the first sector as an example, as shown in Fig. 1, the transient current slope under the action of effective vector V1 and zero vector V7 is selected for position estimation in one PWM switching cycle. The specific formula corresponds to the second line of Table 1. Where \(d{i}_{A}^{\left(1\right)}/dt\) is the slope of phase A current under the action of voltage vector V1; \(d{i}_{A}^{\left(7\right)}/dt\) is the slope of phase A current under the action of voltage vector V7, and so on. The variable g can be regarded as unchanged in one PWM switching cycle, but when the voltage vector sector changes, the calculation formula of g will also change. The specific formula is shown in Table 2. In this way, by selecting the appropriate effective voltage vector and zero vector in a switching cycle, the corresponding position of the motor in the switching cycle can be quickly obtained.

Table 2. g under different selected voltage vector

The SVPWM closed-loop control model is built in Simulink. Theoretical analysis shows that the stronger the motor saliency, the better the experimental effect. In this model, Ld = 0.011715H, Lq = 0.001715H. At the same time, in order to increase the current amplitude, the load torque TL of the current can be increased. Set the simulation duration to 0.1 s to see more details of the transient current. After the simulation, the measured three-phase current, six channel PWM signals output by SVPWM module and the measured motor position signal are imported into the state space for data processing. Finally, by collecting the ABC three-phase current Ia, Ib, Ic corresponding to each voltage vector, and using linear regression, the current slope corresponding to each voltage vector is calculated. According to Table 1 and Table 2, the three-phase position variables of \(p_{A}\), \(p_{B}\), \(p_{C}\) can be calculated, and the rotor position can be finally estimated by Eq. 8.

$$ \begin{array}{*{20}c} {p_{\alpha } = \frac{{\left( {2p_{A} - p_{B} - p_{C} } \right)}}{3} = \frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}\cos 2\theta_{e} } \\ {p_{\beta } = \frac{{\left( {p_{B} - p_{C} } \right)}}{\sqrt 3 } = - \frac{{2L_{\Delta } }}{{L_{{\Sigma }} + \frac{{2L_{\sigma } }}{3}}}\sin 2\theta_{e} } \\ \end{array} $$
(8)

This simulation model adopts seven segment SVPWM control. The instantaneous state of sector change is not considered. Obviously, there are at least four effective vectors in a sector, as shown in Fig. 2. In sector (2), there are two V1 and two V2. To reduce the error and simplify the calculation, the first effective vector is selected, that is, V1 and V2 marked in sector (2). At the same time, it can be seen from Table 1 that the position variables under the action of each effective vector can be estimated. To reduce the amount of calculation, the following modifications can be made:

Fig. 2
A line graph of current and V e c versus time with sectors 1 and 2. V e c has a step trend with a rise and fall for V 1 in sector 1 and for V 2 and V 7 in sector 2. Current has uniform wavelike fluctuations, with K a power 1 in sector 1, and K a power 2 and 7 in sector 2.

Effective voltage vector selection

When the voltage vector is in the first sector and the second sector, V1 is used for position estimation; When the voltage vector is in the third sector and the fourth sector, V3 is used for position estimation; When the voltage vector is in the fifth sector and the sixth sector, V5 is used for position estimation. Finally, code according to the above conditions for location estimation. Simplified calculation can effectively improve the real-time and rapidity of position estimation at high speed. However, when the motor is at low speed, due to the above algorithm, there is only one position estimation value in a PWM cycle causing low accuracy. In order to solve this problem, as shown in Fig. 3 this paper uses triangle fitting to fit the corresponding trigonometric function curve in real time by using the numerical points of palpha and pbeta, which can make up for the position accuracy of under low-speed condition. At the same time, through triangle fitting, the data points with large or wrong errors of palpha and pbeta are eliminated to a certain extent, and the accuracy of position estimation is improved.

Fig. 3
A scatterplot of p alpha versus time in microseconds. The points for p alpha are clustered on the peaks and troughs of the sinusoidal fit curve.

Triangle curve fit

The experimental results are shown in Fig. 4. It can be found that the palpha and pbeta form a sinusoidal curve, but there are several error points in each cycle. After analysis, the error is mainly caused by the switching of voltage vector sectors. Since the switching time of voltage vector is very short, the rotor position of the motor can remain unchanged. Therefore, during sector switching, the values of palpha and pbeta at the previous time can be used to replace, which can eliminate error. Finally, through the phase-locked loop, the palpha and pbeta are converted into position signals \({\theta }_{e}\) (Fig. 5).

Fig. 4
2 line graphs of p beta and p alpha versus time plot sinusoidal trends. Graph a has noisy peaks and sharp falls for p alpha and p beta, with points A to E marked on a single fluctuation. Graph b has sharp uniform fluctuations for p alpha and p beta, that are out of phase.

Position variables and noise elimination

Fig. 5
2 line graphs. a. A line graph of position in radians versus time with 2 overlapping sawtooth waveforms for real and estimated positions. b. A line graph of position in degree versus time plots a fluctuating line for the position error.

Simulation experiment results

As shown in Fig. 6 (a), when the speed is under 170 r/min, the solid line in the figure represents the real motor position actually measured by the position sensor, and the dotted line is the position estimation signal. It can be seen that the coincidence between the two is good, and the position error can be controlled between - 5° and 5° except in the initial stage. Therefore, the position information contained in the slope of the fundamental wave of the transient current has been verified.

Fig. 6
A Simulink block diagram of the S V P W M module with 4 blocks titled time underscore x y z, time underscore p w m, sector, and time underscore cut. The inputs are alpha, beta, U d c, and T s. Outputs are T a, T b, and T c.

Simulink fixed-point model of SVPWM module

3 Experimental Methods and Results

3.1 Code Generation

Although the readability of the code is improved by manually writing the VHDL code, the project amount is large. At the same time, when the data is basically added, subtracted, multiplied and divided, there is also a large number of fixed-point processes. In order to simplify the experimental process, MATLAB can be used to generate module code, and then the top-level file can be manually written for signal communication before the module. Using the hdlsetup function in MATLAB, the final SVPWM fixed-point model is shown in the following figure.

3.2 FPGA and Linux Control Platform

Experiment platform is shown in Fig. 7. The switching frequency of the system is set to 8 kHz. In order to better observe the common mode current and better fit the fundamental current slope, the sampling frequency should be as large as possible. In this experiment, the sampling frequency of the oscilloscope is set to 5 MHz, and the AB two-phase current is oversampled. At the same time, the signal of the sector where the voltage vector is located and the rotor position signal are collected through the DAC7716 to facilitate the verification of the relationship between the fundamental current slope and the common mode current amplitude and the rotor position.

Fig. 7
A photograph of an experimental setup. The components are F P G A and Linux control platform, power source, scope, A D C, and P M S M.

FPGA and Linux Control Platform

Set the given speed to 220 r/min, DC load to 15 Ω, and measure the three-phase current IA, IB and IC of the motor. The phase current measured electrical angle and waveform is shown in Fig. 8. The estimated position waveform and position error are shown in Fig. 9.

Fig. 8
2 line graphs. a. A line graph of stator current versus time plots 3 out-of-phase, noisy sinusoidal trends. b. A line graph of theta r in radians versus time plots a sawtooth wave.

Three-phase current and electrical angle

Fig. 9
2 line graphs. a. A line graph of angle in degrees versus time plots 2 overlapping sawtooth waves for estimated and real positions, that have short wavelengths. b. A line graph of angle in degrees versus time plots a fluctuating line for position error, between 25 and minus 25 degrees.

Estimated position and estimation error (medium-speed)

At the same time, in order to verify the accuracy and rapidity of the position estimation when the motor under low-speed state condition and the feasibility of the improved algorithm at high motor speed. We set the given speed of the motor to 30 r/min and 24000 r/min, bring in the mechanical load, and collect the speed signal and estimated position error signal of the motor. The specific waveform is shown in Fig. 10 (A). When the motor is under low-speed condition, the estimated position can successfully follow the actual position when the time is 0.156 s according to the position error waveform, and the error is controlled within 5°. The speed of the motor also reached the expected speed within 0.2 s, which successfully verified that when the motor was in the starting stage and low speed state, the position estimation using the rotor current had the advantages of rapidity, high dynamics and high accuracy. When the motor is at high speed, the estimated position can still follow the actual position, which successfully proves the feasibility of the improved algorithm. However, the position error is large, and a few estimated positions lag behind the actual position, which is shown as spike in the waveform.

Fig. 10
4 line graphs. a. Position error in radians and real speed in revolutions per minute, Position error rises, with a small dip at 0.156 seconds, and is then constant. b. Estimated position in radians and position error in degrees versus time, plot a sawtooth wave and a fluctuating line respectively.

30 r/min and 24000 r/min experiment results

4 Conclusion

By analyzing the coupling relationship between the transient current and the rotor position in one switching period under SVPWM control, this paper successfully uses the fundamental linear current in the effective voltage vector action time to estimate the position through simulation and experiment. This method has the advantages of fast speed and good dynamic performance. The experimental results show that the position error can be controlled within the range of 5° under medium and low speed conditions, which can meet the most actual motor control requirements and has reference value.