A Desktop Electric Machine Emulator Implementation Method Based on Phase Voltage Reconstruction

An electric machine emulator (EME) system plays a fundamental role in design and validation of hardware and software for power electronic converters and electric drives. In this paper, a desktop digital signal processor (DSP)-based EME is developed for power converters function test. The principle of EME is demonstrated with mathematical derivation. Since the instantaneous phase voltage is either power supply voltage or ground, high-rated voltage sensors are not suitable for DSP-based EME to obtain the average voltage in a pulse-width modulation cycle. To accurately acquiring phase voltages, a method which reconstructs the phase voltage considering the amplitude and duty cycle error is proposed. Voltage drops, dead time, propagation delay, parasitic rising and falling time delay are all considered in reconstructed voltages based on voltage-second balance theory. This is accomplished without any assistant physical circuits. Based on the reconstructed phase voltages, reference current is derived in motor model by using second order Runge-Kutta method. Factors affecting phase voltage accuracy are verified by simulations step by step. The simulation and experimental results support the validity of the proposed method.


I. INTRODUCTION
The development and validation of power electronics of motor control units (MCU) are facing great challenges since the existing facilities do not fit desired requirements. A test bench called electric machine emulator (EME) or powerlevel hardware-in-the-loop (PHIL) emerges in such situation. Compared with dyno test bench, EME holds the merits of low cost, short time-to-market cycle, testing extreme conditions, etc. Therefore, it is widely used in electric vehicles [1], [2], aerospace [3], wind power generation [4] and other fields.
The principle of EME system is to mimic the motor electrical characteristics via current tracking. The target current is calculated by motor model whose input is phase voltages. A typical EME schematic diagram is shown in Fig. 1. It consists of output filters, power amplification unit (PA), interface algorithms (IA), real-time digital system (RTDS) and The associate editor coordinating the review of this manuscript and approving it for publication was Xiaofeng Yang . sampling circuits. The function of output filter is to filter high-frequency phase current harmonics caused by inverters. The structure of output filters can be L [5] or LC [6] or LCL [7] type. Comparisons are carried out in [8] in four aspects and it concludes that the LCL type has better performance but needs accurate state equation, or else the system will be unstable. L type is a first-order system which has better robustness. Paper [9] gives out L type inductance selection form according to the max current tracking slope and max current fluctuation restriction. PA is the core part to output voltages to regulate the current. Paper [10] points out that ideal PA owns the traits of unit gain, infinite bandwidth and no time delay. The frequently-used PA is switchedmode type which can be classified as two-level inverter and multi-level inverter. Multi-level PA [11]- [13] can reach higher output frequency and lower current harmonics via parallel connection and phase-shift sinusoidal pulse-width modulation (PS-SPWM) control, which is always used in Field Programmable Gata Array (FPGA)-based EME system. This structure may bring complexity like common mode current [5] and branch current balance problem [14]. As for IA part, IA realizes the current tracking algorithm of target current by RTDS and sampling current. Paper [15] adopts PI controller which is simple, but it may lead to instability of current tracking when operation state changes. Paper [16] combines back electromagnetic force feedforward control and PI control to increase stability. Paper [17] compares the stability and accuracy of five different IAs. Paper [18] proposes an accurate evaluating method based on transfer function. RTDS includes FPGA and DSP. FPGA [19] owns the traits of fast speed (over 500KHz) and high accuracy. DSP-based EME can lead to lower price for partial function testing.
As for sampling circuits in EME system, current is captured by high precision current sensor directly. The sampling voltage is the input of motor model which will transfer the sampling error to motor model and influence the accuracy of system. The terminal voltage sampling method can be divided into two types: the high-rated AD chip to capture the instantaneous line-line voltage [20] and the voltage integrator to calculate equivalent voltage in a given time [21]. The high-rated AD chip (higher than 1MHz) can just be used on FPGA-based EME system since the motor model calculating frequency is at about 1MHz or higher. It is not suitable for DSP-based EME system with 10KHz model calculating frequency. For DSP-based EME system, the latter method is a better choice. Paper [22] uses the voltage integrator to capture the terminal voltage indirectly which will cause sampling error with the existing of lowpass filter or resetting of the integrator. In a specific condition, the integral time is equal to PWM period and the terminal voltage can be obtained by real PWM capturing with a comparator circuit [23], but this method does not consider the voltage drops of diodes and insulated gate bipolar translators (IGBTs). Thus, an accurate and reliable equivalent phase voltage sampling method is necessary.
In this paper, an accurate phase voltage sampling method based on phase voltage reconstruction used on DSP-based EME system is proposed. Section II introduces the principle of EME. Section III are the proposed phase voltage reconstruction method. Section IV and V are simulation and experimental verification of the proposed method. Section VI lays the conclusion.

II. PRINCIPLE OF EME
The implementation schematic of EME system in this paper is shown in Fig. 2. Compared with Fig. 1, this implementation substitutes the regenerative system with direct current (DC) power supply or battery and the energy is absorbed directly. Meanwhile, the line voltage sampling unit is removed. The MCU inverter and EME inverter are both voltage source two-level converters and have independent power supply.

A. MATHEMATICAL DERIVATION OF EME
The mathematical model of EME is derived based on Fig. 2 schematic. The power supply of MCU and EME are defined as U DC and U dc respectively. Points O and N are reference ground for MCU and EME. The operation of upper inverter is defined as S x = 1, x ∈ {A, B, C, a, b, c}, while VOLUME 8, 2020 S x = 0 for lower inverter operation. L f and R f are output filter inductance and its equivalent resistance. i x are phase current.
Similarly, we can get the other two phase equations. For motor model, we can obtain (3) based on Kirchhoff current law.
Adding three phase voltage equation, reference point voltage can be written as One can deduce mathematical model of EME by introducing (4) into (2) The expression of d-q rotating coordinate axis (6) can be obtained using PARK transformation from (5).
Equation (6) is the foundation of current control. We can derive the mathematical model of PMSM in d-q axis. i d and i q are d-axis and q-axis currents, U d_eme and U q_eme are d-axis and q-axis voltages of EME part, U d_mcu and U q_mcu are d-axis and q-axis voltages of MCU part.
T e −T L −Bω = J dω dt (10) where, i d_ref and i q_ref are calculated reference d-axis and q-axis currents, ω e is electric angular velocity of motor, ω is mechanical angular velocity of motor. ψ f is rotor flux linkage. B is friction coefficient, T e and T L are electromagnetic torque and load torque of motor, respectively.

B. CURRENT CONTROL STRATEGY OF EME
The IA of EME is same as the part in Fig. 1. The input and output of the motor model are phase voltages and phase target currents, respectively. The resolved currents are set as current references and the error between reference current and measured current is sent to a PI controller to obtain instruction voltage for EME inverters. This method is known as direct current control. The aims are to simulate real motor current characteristics via current tracking. The PI controller principle can be expressed as (11) and (12). K pq and K iq are q-axis proportion and integral factors. K pd and K id are d-axis proportion and integral factors. Q-axis current control principle is shown in Fig. 3.
The optimization design of PI parameters is analyzed detailly in [8], and will not elaborate here. From (11) and (12), we can know that there is coupling relationship between d-q axis. In addition, U dq_mcu mainly influences the instantaneous current tracking response and can be considered as perturbation in the control system.

III. PROPOSED PHASE VOLTAGE RECONSTRUCTION
As mentioned above, DSP-based EME is a low-cost testing system and the existing sampling methods either have relatively large errors or high cost. This part will elaborate the phase voltage reconstruction method to substitute the existing high-error pulse width sampling method or high-cost highrate line-line voltage sampling circuit.

A. VOLTAGE DISTORTION ANALYSIS
Insertion of dead time, nonideal characteristics of inverters like turn-on/-off delays, voltage drop of inverters and parasitic capacitor of switching device are the prime reasons for voltage distortion. This paper takes dead time, propagation delay, turn-on/-off time, voltage drops and parasitic capacitor influence into consideration. The voltage distortion analysis is shown in Fig. 4. PWM Ideal is the ideal given PWM, PWM DT inserts the dead time, PWM DT+TR considers the propagation delay and turn-on/-off time. U Ideal , U Actual and U Eq are ideal output terminal voltage, actual output terminal voltage and equivalent actual output terminal voltage. The current is defined as positive when it flows from MCU to EME, vice versa.

B. VOLTAGE MAGNITUDE RECONSTRUCTION
The magnitude of output terminal voltage is influenced by the voltage drops of diodes or IGBTs. The voltage drops directly depend on the current value and the sign of current. A precise current measurement is required to determine the voltage drops. Since a precise current sensor is essential for EME system to operate current tracking, it is not an issue. We just need to get the voltage drop values of diodes and IGBTs. Usually, the forward voltages of semiconductor components of the same type, voltage and power class are in the same order. The voltage drops of diode and IGBT can be tested directly. The voltage drops of IGBT and diodes are shown in Fig. 5 and Fig. 6. V CE and V EC is IGBT voltage drop and diode voltage drop, respectively. The relationship between current and voltage drops is shown in Fig. 7. U AL represents the terminal voltage of phase A and only the low voltage part is shown.

C. PULSE WIDTH RECONSTRUCTION
The pulse width error between ideal and actual pulse width is demonstrated in Fig. 4. T c is defined as pulse width error. VOLUME 8, 2020 One can obtain T c equation from T rise and T fall .
In equation (13), dead time T d can be considered as constant. For transformation time T ton , T toff and turn-on/-off time T don , T doff , they change little from the rising edge to the falling edge since the current can be seen as a constant in a PWM period. They can be seen as offsets, but not affect the value of T c . Therefore, equation (13) can be simplified to (14).
As for rising time T r and falling time T f , they cannot be counteracted since the charging and discharging effect of parasitic capacitor of IGBT differ a lot even in a same current condition. Hence, the effect of rising time T r and falling time T f will be studied in detail.
As mentioned above, rising time T r and falling time T f are affected by current amplitude and polarity and parasitic capacitor. The influence can be elaborated by (15) v = i r t/C p (15) where, v is terminal voltage, C p is the sum of parasitic capacitor of upper and lower switch, i r is current at the rising edge which is assumed as constant in T d time.
We define a critical current I c shown in (16), in which current, the terminal voltage reaches U DC at the time of T d in the function of capacitor.
When current at the rising edge T r is positive, the time T r is short enough to be omitted since the parasitic capacitor is connected to positive pole of DC link directly after the upper switch is under operation. Fig. 8(a) shows the equivalent rising time at various current according to voltage-second balance theory which is demonstrated that the blue shadow area equal to the red shadow area. According to Fig. 8(a), we derive the rising time T r as (17). In which, G H and G L are gate signal of upper switch and lower switch, respectively.  Similarly, when current at the falling edge T f is negative, the time T f is short enough to be omitted since the parasitic capacitor is connected to negative pole of DC link directly after the lower switch is under operation. Fig. 8(b) shows the equivalent falling time at various current. The falling time T f at various current can be written as (18).
The experimental result at the condition of T d = 3us, U DC = 210V, C p = 1nF is shown in Fig. 9. It coincides with the conclusion above.

D. PHASE VOLTAGE RECONSTRUCTION CONSIDERING BOTH FACTORS
Take phase A as an example, i A is the current of phase A, equation (18) can be obtained.
The terminal voltage error in one operation period can be concluded according to the voltage-second balance principle. When current i A is positive, we can get (20) When current i A is negative, we can derive The value T PWM and T H can be obtained by the transfer of MCU. This makes the MCU is open for EME, which can be in situation that low-cost EME is setup by the same producer of MCU. We can get the equivalent terminal U A voltage via (22).
With the same principle, we can get the equivalent voltage of phase B and C. The phase voltage of A defined as U phA can be reconstructed by (23).
And the same for phase voltage B and C.

IV. SIMULATION RESULTS
The voltage drops and PWM transfer nonlinearity can be analyzed and verified in simulation, respectively. To verify the effectiveness of the reconstruction method, an EME simulation model is built up on Matlab/Simulink according to EME principle in Section II. The EME setup parameters and PMSM parameters are shown in The simulation result analyses mainly focus on the comparison of voltage waveforms and current waveforms among ideal EME output without considering the nonlinearity, EME output using captured voltage value and EME output adopting reconstruction method. Since voltage is the prerequisite for current response, the voltage error and current error are both displayed.

A. VOLTAGE MAGNITUDE RECONSTRUCTION VERIFICATION
The effects of voltage drops are demonstrated in this section, and non-ideal characteristics of inverters are ignored. Fig. 10(a) green curve is the ideal PWM output voltage, blue curve is the voltage captured by high-precision voltage sensor as a reference, and red curve is the voltage reconstructed using the proposed reconstruction method. So do Fig. 11(a) and Fig. 12(a). Since the voltage drops are neglected, the ideal voltage is larger than captured and reconstructed voltage. The captured and reconstructed voltage almost coincide with each other which means the voltage reconstruction method is effective. Compare the reconstructed voltage with the captured voltage and ideal output voltage, we obtain the voltage error shown in Fig.10(b). Current is the result of voltage via PMSM model calculation, three corresponding current is shown in Fig. 10(c). The current using the reconstructed voltage can track the current using captured voltage.

B. PULSE WIDTH RECONSTRUCTION VERIFICATION
The effects of EME inverter non-ideal characteristics like dead time insertion and transfer delay are considered in this section, other conditions remain ideal. The simulation results are shown in Fig. 11. From Fig. 11(b), one can see that the insertion of dead time and transformation delay lead to square wave voltage error. Fig. 11(c) shows the duty cycles of the corresponding voltage in Fig. 11(a). Fig. 11(d) shows the current comparison.

C. PHASE VOLTAGE RECONSTRUCTION VERIFICATION CONSIDERING BOTH FACTORS
This part takes the both factors into consideration. Fig. 12 demonstrates the simulation results. The figures are corresponding to Fig. 11. We can conclude that the reconstructed voltage and current can perfectly track those captured by the voltage sensors.

V. EXPERIMENTAL RESULTS
The experimental platform is set up to verify the method, the parameters are same as

B. SAME METHOD USED FOR EME COMPENSATION
Since the EME part adopts the same voltage source inverter as the MCU, the EME inverter will have voltage output distortion which will cause the current distortion. The real output voltage and the target output voltage of EME are not  the same due to the existing of voltage drops, dead time and transfer delay. Fig. 14 gives out the current clamping phenomenon caused by voltage distortion. One can see that the distortion pollutes the current output harmonics which do not exist in real current. It is necessary to compensate the voltage distortion for EME inverters which will largely improve the current harmonics performance. Fig.15 gives out the current output analysis without and with the voltage compensation method. Compare Fig.15(a) and Fig. 15(b), we can see the total harmonics distortion (THD) of the compensated waveform is largely decreased.

VI. CONCLUSION
In this paper, a desktop DSP-based EME system is setup for the validation of power converters and electric drives. A method is proposed to improve the EME accuracy without using any high-speed high-accuracy voltage sensors. It reconstructs the phase voltages by considering the voltage drops and non-ideal characteristics of voltage source converters. Voltage drops, dead time, propagation delay, parasitic rising and falling time delay are all considered in reconstructed voltages based on voltage-second balance theory. Simulation and experimental results demonstrate the proposed method can improve the EME current tracking accuracy. Moreover, the developed method can also be applied for EME compensation which can reduce the inverter harmonics.