Analysis of Rotor Position Detection Performance According to the Frequency of Square Waveform Voltage in the Harmonic Injection Sensorless Method through HILS

: In this paper, the rotor position estimation performance of the sensorless scheme for permanent magnet synchronous motors (PMSMs) implemented through the injection of high-frequency square-wave voltage according to the frequency of the square-wave voltage is presented through HILS (Hardware In the Loop Simulation) experiments. An inverter using an IGBT device usually has a switching frequency of around 15 kHz. On the other hand, GaN devices that can be switched on and off at frequencies higher than 100 kHz have been recently developed, and research is being actively conducted to apply GaNs to a variable speed system. The purpose of this study is to conduct HILS experiments to analysis the rotor position estimation ability of the sensorless technique in cases where a high switching frequency was applied, such as GaN devices, with that of a system having a usual switching frequency, such as IGBT. In the HILS system used in this study, an inverter and motor model implemented with Simulink are located in a real-time simulator. A sensorless motor control method was implemented with an FPGA control board, which includes a PWM interrupt service routine of 100 kHz frequency and a harmonic injection and position detection algorithm. The HILS experiments show rotor position detection errors according to the various frequency of the harmonic voltage injected for estimating the rotor position with a PWM frequency of 100 kHz cases. According to the experimental results, good position estimation was possible not only when the harmonic of 10 kHz corresponding to 1/10 of the PWM frequency was injected, but also when the harmonic of 1 kHz corresponding to 1/100 of the PWM frequency was injected. The experiments suggest that position estimation errors decrease as the frequency of the harmonic voltage increases, and, based on the foregoing, it is thought that the application of a GaN device capable of realizing a high switching frequency in a variable speed drive system can be another advantage.


Introduction
Due to the increase in electro-mobility, industrial applications of permanent magnet motors are expanding [1]. Permanent magnet motors are applied to various variable speed driving systems because their efficiency is higher compared to other motors and their output torque ratio per unit volume is excellent. In the vector control of general AC motors, a resolver or encoder is used for position detection, and a DSP is used to control the current and speed [2,3]. However, the position sensors of electric motors are vulnerable to external impacts so that they are damaged or deteriorated to the extent that they cannot work in some cases. To solve this problem, sensorless control techniques have been proposed [4][5][6][7][8].
In the case of the sensorless control of motors, the motors can be driven even without any position sensors such as encoders and resolvers so that the cost and system size are reduced, and reliability is enhanced because the risk of position sensor failure is reduced. However, a major disadvantage of sensorless motor control is that there are error values between actual motor information and estimated values. Therefore, sensorless systems cannot be used as main systems due to the limited performance of sensorless control, but there are cases where a sensorless control algorithm is used only as an emergency backup system when the position sensor does not operate normally or when it is out of order [9,10].
Sensorless control techniques are largely divided into methods that use counter electromotive force and methods that apply high-frequency signals [11]. The square waveform harmonic injection sensorless control system enables easier estimation of positions than the existing counter-electromagnetic force estimation sensorless control technique at a low-speed region. At high and medium speeds, it can be used in combination with the counter-electromotive force sensorless control technique. In addition, it has the advantage that its efficiency is higher compared to the existing sinusoidal harmonic voltage injection technique because it has less noise and that it has fewer errors in angle estimation at low speeds compared to the counter-electromagnetic force sensorless technique. In this technique, a square harmonic voltage is injected into the current that is the output from the inverter and converted with the dq coordinate system and the q-axis current of the current controller, and the position is estimated on the d-axis. If the frequency of the injected harmonic voltage is changed, the errors in the estimated angle and the estimated speed will be changed [12].
Meanwhile, studies on electric power converters applied with GaN devices that can switch at higher switching have been actively conducted recently. In addition, as shown in the simulation results in [12], the efficiency of the inverter differs by up to 6% according to the change in the switching frequency of the inverter using the GaN device and the Si device [13]. Thus, these electric power converters have higher efficiency than existing Si-based power semiconductors, and high dielectric breakdown fields, which enable highvoltage operation. Therefore, the system can be downsized due to lower heat generation and switching at higher speeds compared to the existing IGBT device. GaN devices are expected to bring about an improvement in inverter system control performance thanks to high-speed switching, as well as an improvement in physical aspects such as downsizing owing to a switching frequency not lower than 100 kHz.
Several papers on the sensorless control method using GaN have been published [14,15]. In [14], the sensorless control results at a 40 kHz switching frequency using a matlab simulation were presented. Meanwhile, it is assumed that DSP is used for the controller. Although GAN is mentioned in [15], the actual inverter configuration uses SiC devices and shows position detection performance at a 40 kHz switching frequency. Therefore, these two papers do not present the position detection characteristics at 100 kHz switching frequency, which this study attempts to show, and do not contain information about HILS experiment.
A motor controller using an IGBT element usually has a switching frequency of around 15 kHz. Accordingly, the frequency of the harmonic waves injected in the existing harmonic injection sensorless technique is usually about 1 kHz, which is about 1/10 of the PWM frequency. Therefore, in this paper, the effects of different frequencies of the harmonic waves injected for sensorless control in a system having a switching frequency of about 100 kHz will be compared. That is, since the frequency of harmonic waves can be increased in cases where a GaN device is used, changes in the position estimation performance following the increase in the frequency will be shown. Figure 1 is a block diagram of the control system of a permanent magnet synchronous motor (PMSM) with a speed sensor attached. The motor control system consists of a speed controller, a current controller, dq transformation, and a space vector voltage pulse width modulation (SVPWM) subsystem. The speed controller outputs the command current through the PI controller using the speed command value and the measured speed. The current controller outputs the voltage reference using the output of the speed controller and the current value obtained by transforming the current measured through current transformers (CTs) into the dq coordinate system. The output voltage is transformed again into abc coordinates to generate the gate signals through SVPWM, and the power semiconductor device switches to supply 3-phase AC power to the PMSM to operate.   Figure 3 displays a block diagram of motor position estimation. The harmonic voltage for estimating the position is applied to the d-axis, and from the harmonic current generated due to this, the harmonic part is extracted using a band stop filter (BSF) to estimate the position of the rotor. The square waveform injection sensorless scheme is described below. In the PMSM, since the stator resistance (R s ) can be ignored because its size is smaller compared to the size of jω h L dq , the impedance of the motor is expressed as shown in Equation (1). Here, ω h is the angular frequency of the harmonic, and h stands for harmonic. The relationship between the harmonic voltage and the harmonic current is shown in Equation (2). Here, R(θ) denotes a matrix that transforms fixed coordinate system values into synchronous coordinate system values. In the equation, the superscript s stands for the stationary reference frame and r stands for the rotor reference frame.  If Equation (2) is organized with i dqsh , it will be as shown in Equation (3), where, if θ, which is the actual position of the rotor, andθ, which is the estimated position obtained through the high-frequency voltage injection technique, are used, the foregoing can be expressed as shown in Equation (4). (6), and if the inverse matrix of R(θ) and z r is obtained, substituted into Equation (4), and organized, Equation (7) can be obtained. In Equation (5),θ means the error of the estimated rotor angle, and the angle error is assumed to be 0 degrees in the development of the equation hereafter.

Square Waveform Harmonic Injection Sensorless Control and GaN FET
Equation (7) expresses the relational expression of the injected harmonics and harmonic currents [16]. In Equation (7), it can be seen that i s dqsh appears in the form of cosine and sine. Therefore, the rotor position can be estimated by taking the arc tangent to the harmonic dand q-axis currents as expressed in Equation (8) [17][18][19]. Figure 4 is a conceptual diagram of the magnitude of the current generated in the dand q-axis magnetic flux paths corresponding to the harmonic voltage injected, and Figure 5 depicts the motor impedance corresponding to the injection position for each frequency of harmonic voltage [20]. When the harmonic voltage is injected into the d-axis, the impedance is minimized due to the phenomenon of saturation of the magnetic flux of the frequency corresponding to the harmonic voltage so that it becomes the position where the largest harmonic current for the same voltage occurs. This relationship applies equally to SPM and IPM. In the case of general inverters using an IGBT with a switching frequency of around 15 kHz, the frequency range of the voltage injected in previous studies is 200 to 1000 Hz. This corresponds to about 1/50 to 1/10 of the PWM frequency. Since the power semiconductor used in this study is capable of 100 kHz PWM, as with the GaN device, square waveform voltages in a range of 0.2~10 kHz corresponding to 1/50~1/10 of the switching frequency will be injected and the characteristics of rotor position detection will be investigated.  For your reference, the characteristics of the GaN power transformation device and the silicon-based device are shown in Table 1. GaN devices have higher carrier movement speeds and lower breakdown voltages compared to silicon-based devices because they have the characteristics of wide bandgaps, high breakdown voltage, and low impedance. Therefore, when a GaN power transformation device is applied to an inverter, the thickness can be reduced more than that of a silicon-based power semiconductor because the dielectric breakdown field is large. Meanwhile, since the ban gap of GaN is wide, the efficiency of performance is not reduced even at relatively high temperatures. Therefore, when a power semiconductor device using GaN is used, the inverter can be downsized and has a high-power density [21][22][23].  Figure 6 is a sensorless control simulation model of PMSM using the square waveform harmonic voltage injection technique implemented with MATLAB/Simulink. In HILS experiments, this model is implemented using an FPGA control board. Individual subsystems indicated their respective controllers, and on comparison with the existing sensored control, it can be seen that a square waveform harmonic voltage injection block has been added. A PI controller is used for speed controller and current controller, and the space vector PWM uses the min-max method.   Figure 8 shows the internal configuration of the blocks in Figure 7. As shown in Figure 8, MATLAB function blocks were used for individual blocks to implement Equations (6)-(8) and bandstop filter (BSF). The filter part is implemented by discretizing the continuous terms, as done in [24]. The three-phase current containing harmonics is transformed into a two-phase current and passes through the BSF so that the harmonic part is detected, and the rotor position is estimated using the MATLAB function block that implemented Equation (7). LPF is used in measuring the phase currents to remove the harmonic current. The coefficient value of the BSF corresponds to the frequency of the injection voltage. In the case of Figure 7, f bp f is 1 kHz, and 100 Hz was applied as the bandwidth (B). Table 2 shows the specifications of the motor used in the simulation. The ratio of L d and L q is 2, and it is a setting to simulate the degree of saturation of harmonics following harmonic voltage injection.    Figure 9 shows the HILS configuration in this study. VHDL was used to implement the 100 kHz PWM and sensorless algorithm, and the sensorless controller algorithm using harmonic injection was implemented in the FPGA controller. An inverter and a PMSM are modeled with Simulink and implemented in RT4510, a real-time simulator. The inverter and PMSM are operated in the real-time simulator, and the signals necessary for the controller are applied from the FPGA board. Meanwhile, the output from the control board to the real-time simulator is the gate signal of the inverter. The data designated by the user at the user PC are transmitted so that the user can monitor the system operation in HILs, and the resultant values are shown in a graph. In Figure 9, the flow diagram of the controller part is the same as the typical motor controller configuration.

Configuration of HILS Experimental Equipment
Signal transmission between the real-time OS and DE1-SoC board, which is the control board, is as follows. The RT4510 transfers the motor current to the control board through the analog port, and this signal is connected to the ADC of DE1-SoC to detect the motor phase current value. Using this current, the sensorless algorithm derives a controller written in VHDL, which is a digital value, through the program. This digital value is connected to the gate signal of the inverter in the RT4510 through the digital port to generate a PWM signal. The resultant values of the experiment are sent to the user's PC using TCP/IP communication, and they are graphed and displayed on the monitor [25][26][27]. Figure 10 depicts a photo of the experimental equipment. Table 3 summarizes the names of individual devices. Device 3 is a board for matching the signal level between the control board 2 and real-time OS 1 , and devices 4 and 5 are the power supply for board 3 . Meanwhile, the parameters of the PMSM used in HILS experiments are the same values as those used for the MATLAB simulation as shown in Table 2.

Controller Implementation Using FPGA
In this section, the configuration of the FPGA program and the implementation of the arc tangent in Equation (7) to obtain rotor information are described. In this experiment, the DE1-SoC board from Terasic Co. was used. The Altera Cyclone ® 5CSEMA5F31C6N was used on this board. The controller was designed using Verilog HDL through Altrera Co.'s Tool Quartus II. To receive the current value, which is an analog waveform, the analog-to-digital converter (ADC) of LTC2308 built in DE1-SoC was used. The ADC has 12-bit resolution, and since, unlike DSP, FPGA performs horizontal instead of vertical operation, each controller was implemented as a state machine.
As illustrated in Figure 11, the sections were composed of a total of five level controllers: initial state, ADC state, dq state, speed-control state, and current-control state. In the initial state, the controller is in the standby state, and operates when an input is received. When the operation in each controller is finished, the start signal of the next controller is generated and the controller operates. When a series of operations is completed, the controller returns to the initial state and executes the series of operations again. If the RESET signal is input, all operations will be stopped regardless of which state the controller is in, and the operation will return to the initial state so that the controller waits for operation.

Arc Tangent Calculation Using VHDL
To obtain the position of the motor in Equation (7), the arc tangent should be calculated, and this is done using a lookup table. To utilize the limited memory space, a lookup table is constructed for values corresponding to 0 • to 45 • , and values corresponding to other angles are calculated through the characteristics of atan (arc tangent) values in eight areas as shown in Figure 12 [28,29]. The data sheet for atan IP core used in the Quartus prime tool is provided by Inter Co., and information about the atan IP core is provided in the data sheet. The adaptive lookup tables (ALUTs) that store atan2 values of the atan IP core store 2454 data. Since the atan2 interpolation method used in this study uses 450 data for each of the ALUTs, and the number of data corresponding to eight sectors is 3600. Therefore, it outputs more accurate data than the atan IP core [30]. Interpolation was applied to calculate median values. Interpolation uses the fact that when a tangent value of 0 • to 45 • is multiplied by 100, sequential values from 1 to 100 are derived as approximate values. As shown in Figure 12, angles were divided into eight sectors, and the calculation of each sector produced the values stored in the 45 • atan2 lookup table as summarized in Table 4. Therefore, 360 • of arc tangents can be expressed through calculations using 45 • lookup tables by sector. Here, x corresponds to the q-axis harmonic current component, and y corresponds to the d-axis harmonic current component. The data were stored in the lookup tables, and the sizes of the required values were retrieved from the lookup tables by calculation. In the table, θ are angles corresponding to 0 • to 45 • , and θ are angles ranging from 0 • to 360 • estimated using 45 • data.

Condition
Sector θ θ Figure 13a,b displays the codes that were implemented. Each figure illustrates the arc tangents implemented by calculation for each quadrant as shown in Table 4. A total of 100 lookup tables were constructed, and the formula for each sector is shown in Table 4. In the figure, tan_cal_d and tan_cal_q are the currents (i dqsh ) in the state where the injection voltage was applied through the BSF, and tan_cnt is the address to find the data specified in the lookup table. When absolute values are taken for the sine and cosine values, the |cos(θ)| and |sin(θ)| values have the range of 45 • and the large and small ones are changed. Through the foregoing, each quarter was divided by 45 • to create eight areas. As shown in the codes by sector, the value of the numerator and the denominator were determined using the formulas in Table 4. In addition, when the value of one of cos(θ) and sin(θ) is negative, the value is multiplied by −1 so that only positive values are output as the values of tan_cnt. Since the LUTs value stored in advance is output after multiplying the tan_cnt value by 100, atna2 is implemented by interpolation. (d)

Experimental Results
Through experiments, the rotor position detection performance of sensorless techniques for 200 Hz~10 kHz high-frequency injection voltage is examined when the PWM frequency is 100 kHz as with GaN devices. Figure 14 shows representative waveforms appearing when harmonics are injected. Figure 14a depicts the phase a current of the motor. Figure 14b shows that harmonics were added in the terminal voltage waveform. Figure 14c,d displays the d-axis and q-axis harmonic component current HILS experimental waveforms that passed through the BSF.
In the experiment, the rotation speed command value (n * ) is 200 rpm. In Figures 15 and 16, the PWM switching frequencies are f sw1 = 10 kHz and f sw2 = 100 kHz , respectively. The waveforms in Figures 15 and 16 are the experimental waveforms when the frequencies of the injected harmonic voltage are 200-2000 Hz and 200-10,000 Hz, respectively. In the case of a system with a 10 kHz switching frequency, the maximum frequency of the injection voltage frequency was 2 kHz, and in the case of a GaN device capable of 100 kHz switching, the experiments were conducted while increasing the frequency of the injection voltage up to 10 kHz.
It can be seen that the errors in the angle estimation vary according to the magnitude of the frequency of the harmonic voltage, and that in cases where f sw1 = 10 kHz, the error rate between the estimated speed and the command speed becomes larger when the frequency of the injection voltage becomes smaller or larger than 1 kHz. In cases where the switching frequency was f sw2 = 100 kHz, the command speed was followed well when the frequency of the harmonics was 10 kHz. It can be seen that the error in the estimated rotor angle was smaller than cases where the switching frequency was f sw1 = 10 kHz. In Figure 15, the red waveform (indicated by θ_x_real) is the actual position of the rotor, and the blue solid line (indicated by θ_x_cal) is the estimated position where x denotes the corresponding frequency of the injection voltage. In each waveform, the figure on the left shows the command speed and the calculated speed, and the figure on the right shows the estimated rotor angle and the actual rotor angle waveforms. The left figure of Figure 16d shows that the speed has a lot of ripple. That means the operating state of the motor is very unstable when operating at the 2 kHz injection frequency.
In Figure 16, it can be clearly seen that when the switching frequency is 100 kHz, as the injection frequency increases (200 Hz → 500 Hz → . . . → 10 kHz), that is, as figures are switched from Figure 16a → Figure 16b → . . . → Figure 16e, the error in the rotor angle estimation is reduced. Looking at the right figure of Figure 16e, it is obvious that the position error is almost zero. As shown in Figure 5, as the frequency of the voltage increases, the ratios of the magnitudes of the impedance between the d-axis and the q-axis show a shape closer to sine, and this is thought to be the reason why the position estimation error is reduced.     The x-axis is the frequency of the injection voltage, and the y-axis is ∆θ (θ real − θ cal ), which is measured at the moment when the actual angle of the rotor was changed from 2π radian to 0 radian. In the case of 10 kHz PWM, when the injection voltage frequency was 2000 Hz or higher, the angle error is 25.2 • , indicating that the sensorless motor control was unstable. Therefore, there is no position error result for the 10 kHz injection voltage frequency because the speed control of the motor is not possible in the case of 10 kHz PWM.
In contrast, in the case of 100 kHz PWM, there is a position estimation error result even for an injection harmonic of 2 kHz or higher. As clearly shown in Figure 17, the position estimation performance in the case of 2000 Hz harmonic injection was shown to be better at 100 kHz PWM case. Furthermore, it can be seen that if 10,000 Hz, that is, 10 kHz, voltage is injected, the position estimation error becomes smaller. Meanwhile, the position estimation performances when 500 Hz and 1000 Hz harmonics were injected in the case of 100 kHz PWM were shown to be the same as those in the case of 10 kHz PWM.

Conclusions
In this study, the motor position estimation performance of the sensorless method carried out through the application of harmonic voltage with a frequency of about 1/10 of the switching frequency in an inverter system, which normally has 10 kHz switching frequency, was compared and experimented with the sensorless motor position control performance according to the frequency of the injected harmonic voltage in a system with high switching frequency, which is about 100 kHz, as with GaN using HILS system. To implement a 100 kHz PWM interrupt service routine for systems with high switching frequencies as with GaN devices, a sensorless technique was implemented with FPGA, and the ability of the sensorless technique to estimate rotor positions was shown through the HILS experiment. In addition, in the arc tangent calculation for position estimation, a method of calculating the 0-360 degree sector using only 0-45 degree data in the FPGA was described.
The fact that the estimation error decreases as the injection voltage frequency increases in a system with a high switching frequency, such as a GaN device, was shown through the HILS experiments. The effect of increase in the frequency of the injection voltage in the sensorless technique in a system with a high frequency of 100 kHz in comparison with a system with a switching frequency of around 15 kHz was shown. In summary, when the frequency of the injection voltage was increased to 200 Hz, 500 Hz, 1 kHz, 2 kHz, and 10 kHz at the 100 kHz switching frequency, the position detection error started at 52.08 • and decreased to 10.25 • , 9.34 • , 7.62 • , and 1.26 • , respectively. For the injection voltage having a frequency of 10 kHz, the rotor position error was only 1.26 • . From these experimental results, it can be inferred that the reduction in the rotor position error is due to the fact that the change in inductance according to the position becomes more sinusoidal compared to the low frequency as the frequency of the harmonic voltage increases. As a result, it is thought that the application of a GaN device capable of realizing a high switch frequency in a variable speed drive system can be one of other advantages. In addition, the derivation of these results shows the efficacy of the technique using the HILS system in the development of sensorless control system.