A Study of Interpolation Compensation Based Large Step Simulation of PWM Converters

: Real-time online simulation based on a real-time workshop (RTW) plays a vital role in the study and application of power electronics. However, restricted by the performance of equipment and hardware, the simulators so far available in the market mainly support simulation steps over 50 µ s, while large step simulation may result in the action delay of pulse-width modulating (PWM), numerical oscillation and high-level non-characteristic harmonic distortion. In view of these problems, this paper puts forward a modeling method based on integral prediction and interpolation compensation. First of all, prediction is performed one step in advance by the implicit trapezoidal method to ﬁnd out the accurate time when the triangle carrier wave intersects with the modulation wave. At the same time, a mathematic model is built for the insulated gate bipolar transistor (IGBT) to output equivalent voltage waveform according to the principle of area equivalent. Next, in MATLAB / Simulink, o ﬄ ine simulation is performed with the three-phase AC-DC-AC converter as the subject. By comparing the control accuracy, the content of harmonic wave and the simulation time, the simulation e ﬀ ects of the 50 µ s ﬁxed-step interpolation prediction model are the same as that for a 5 µ s ﬁxed-step standard model. Finally, the e ﬀ ectiveness and high e ﬃ ciency of this algorithm are veriﬁed on a real-time simulator, marking the application of o ﬄ ine models on real-time simulators.


Introduction
Currently, power electronics have been extensively applied in high-voltage direct current (HVDC) transmission, flexible AC transmission and distributed renewable energy power generation systems, bringing an electronic development tendency into electrical systems [1][2][3]. The rapid and periodic action of a power electronics switch model makes the power system typically non-linear, putting forward new requirements and challenges for computer simulation, including system modeling and state equation solution [4][5][6]. Computer simulation has been an important tool that has been extensively applied in power system analysis, design and research due to advantages such as good repeatability, safety and economics [7,8]. According to the relationship between real-time response time and system simulation time, power system simulation can be non-real-time and real-time, of which real-time simulation is more frequently applied in pure digital real-time simulation and hardware in-loop simulation due to its high confidence level [9,10].
When a fixed step is adopted to simulate the transient electromagnetic state, the switch action is responded only at the time of integral steps and therefore delayed, leading to a large number of non-characteristic harmonic waves [11][12][13]. Besides, switch action may also result in non-original numerical oscillation, which can generally be solved by an appropriate numerical integral method.
(1) dSPACE [20]: The dSPACE real-time simulation system is a development and testing platform of a control system developed by the German company dSPACE, which can seamlessly access MATLAB/Simulink. The software system and hardware cards adopted in this simulation platform are independently developed by dSPACE with a high computational capacity and processing speed. Besides, various I/O boards are offered so that users can make combinations based on their demands for semi-physical simulation in various fields. dSPACE is highly reliable and real-time, but relatively expensive due to the exclusive systems and hardware platforms. (2) RT-LAB [21]: RT-LAB is a real-time simulation platform developed by the Canadian company OPAL-RT. It can also seamlessly access MATLAB/Simulink. For real-time simulation of power electronics systems, the Artemis real-time solution algorithm and RT-EVENTS are developed. By in-event interpolation compensation, the fixed-step real-time simulation of a power electronics system is realized. The main features of RT-LAB real-time simulation system include openness, expandability and compatibility with PC microprocessors and standard I/O cards. As a result, the hardware cost is reduced, and practicability is enhanced. However, RT-LAB toolboxes are data encrypted. Users have to pay a high price for use. (3) PSCAD [22]: All switches and trigger modules in the electromagnetic transients including DC (EMTDC) toolbox of power systems computer aided design (PSCAD) support interpolation. By identifying and using the interpolation time based on input information, this function changes the state of switches and the parameters of other modules, such as voltage and current. However, most real-time simulators are based on the RTW of MATLAB/Simulink and poorly compatible with PSCAD. To replace the background program temporarily will result in unnecessary time and cost.
For problems such as non-real-time switch models' failure of real-time simulation on a large-step simulator and the non-characteristic harmonic waves introduced when the switch acts delayed, the following solutions are proposed in this paper: (1) An integral prediction algorithm based on the implicit trapezoid method can accurately predict the value of the modulation wave of the next step and solve the switch delay in a fixed-step real-time simulation by a linear interpolation algorithm. Relying on the algorithm, the moment when the switch acts between the sampling points of simulation steps can be accurately determined to offer favorable conditions for the correction of output voltage from the converter. (2) In this paper, a S-function-based PWM generator modeling and Simulink-function-based insulated gate bipolar transistor (IGBT) modeling are proposed. The PWM generator mathematical model can output not only normal PWM signals but also time variables of pulse indication signals This paper consists of following parts: Section 2 gives an introduction to the integral prediction algorithm, linear interpolation algorithm and multiple switching; Section 3 provides the modeling method of the PWM generator and the IGBT, and the computing method of three-phase converter's voltage at the AC side and current of the DC bus; Section 4 introduces and analyzes the output voltage correction algorithm proposed in this paper in details; Section 5 offers and discusses the simulation results of an AC-DC-AC converter at varying conditions; conclusions are given in Section 6.

Integral Prediction
To ascertain the moment when the modulation wave and the carrier wave intersect, the correlations between the modulation wave and the carrier wave at the present moment and at the sampling point of the next step need to be understood. The integral prediction method is used in this paper to predict the next step of the modulation wave.
The numerical integral method has been extensively applied in the transient simulation of power electronics. To use this method, consideration shall be given to its convergence and stability, namely truncation error attenuation is guaranteed at any simulation step. The implicit trapezoid method is chosen to predict the modulation wave of the next step, and its integral equation is as follows [23]: where t n = n * h, h is the simulation step size, y n is the sampled value at time t n , y n+1 is the sampled value at time t n+1 , and f (t n ,y n ) is a given function. The implicit trapezoid method is used widely due to its simplicity, stability, high accuracy and adaptability to the stiff equation [23,24]. Equation (1) predicts the integral of modulation wave in a step (i.e., predicting the y n+1 of the next step at t n+1 by the y n at t n ). The predicted value is compared to the one a step ahead. The prediction results are comparably ideal.

Interpolation Algorithm
Given the significant action delay of the PWM signal during large step simulation, to improve simulation accuracy it is required that the fixed-step simulation algorithm can accurately consider the moment when the switch acts. An effective method is the linear interpolation algorithm in Figure 1, which is simple, rapid and effective. In this algorithm, the system characteristics of two adjacent switch actions are assumed to fit by a linear relationship. The carrier frequency of power electronics devices is considered linear in a switch cycle as it is generally far higher than that of the modulation wave. Therefore, the linear interpolation algorithm is more appropriate [25][26][27].
To accurately predict the moment when the modulation wave and the carrier wave intersect, the difference between the two is studied. The intersection point of the modulation wave and the carrier wave corresponds to the zero-crossing point of their difference. Assuming that the modulation wave is greater than the carrier wave is logically true, and the modulation wave is smaller than the carrier wave is logically false, logical truth values as specified in Table 1 are obtained.

Correspondence
Logical Value In Table 1: u r is the modulated wave, u c is the carrier wave. If both are logically true or false, the relationships between the modulation wave and the carrier wave at the present sampling point and the sampling point of the next step can be defined as logical XNOR, otherwise logically XOR. In the case of logical XNOR, the modulation wave and the carrier wave do not intersect in the next step at the current moment. Otherwise, there is an intersection point in the next step, and the time of intersection shall be calculated.
Energies 2020, 13, 3069 4 of 16 smaller than the carrier wave is logically false, logical truth values as specified in Table 1 are obtained.

Correspondence
Logical Value ur > uc 1 (True) ur < uc 0 (False) In Table 1: ur is the modulated wave, uc is the carrier wave. If both are logically true or false, the relationships between the modulation wave and the carrier wave at the present sampling point and the sampling point of the next step can be defined as logical XNOR, otherwise logically XOR. In the case of logical XNOR, the modulation wave and the carrier wave do not intersect in the next step at the current moment. Otherwise, there is an intersection point in the next step, and the time of intersection shall be calculated. As shown in Figure 1, the linear section ABC represents the difference curve of the modulation wave and the carrier wave, while ti and ti+1 are fixed-step sampling points. ti = i*Ts and ti+1 = (i+1)*Ts, where Ts is the simulation step and i = 1, 2, 3… A is the sampling point at the current moment, C is the sampling point at the next step moment, and B is the zero-crossing point of the linear section ABC, namely, the intersection point of the modulation wave and the carrier wave. Given the zero-crossing moment of point B is tx, the following equation is obtained according to the principle of similar right triangles: then: where yi is the value at point A, yi+1 is the value at point C, and Ts is the step. By Equation (2) the intersection time of the modulation wave and the carrier wave is obtained.

Solution of Multiple Switching
Multiple switching is defined as multiple switch actions in a simulation step at two or more moments. It is quite common in PWM converters and has a close connection with the switch frequency of power electronics devices, the system complication and the simulation step [28,29]. As the data in a simulation model can only be exchanged with other modules at the integral step, the generation process of PWM shall be done in the same submodule. In case of a group of 6-channel As shown in Figure 1, the linear section ABC represents the difference curve of the modulation wave and the carrier wave, while t i and t i+1 are fixed-step sampling points. t i = i * T s and t i+1 = (i+1) * T s , where T s is the simulation step and i = 1, 2, 3 . . . A is the sampling point at the current moment, C is the sampling point at the next step moment, and B is the zero-crossing point of the linear section ABC, namely, the intersection point of the modulation wave and the carrier wave. Given the zero-crossing moment of point B is t x , the following equation is obtained according to the principle of similar right triangles: then: where y i is the value at point A, y i+1 is the value at point C, and T s is the step. By Equation (2) the intersection time of the modulation wave and the carrier wave is obtained.

Solution of Multiple Switching
Multiple switching is defined as multiple switch actions in a simulation step at two or more moments. It is quite common in PWM converters and has a close connection with the switch frequency of power electronics devices, the system complication and the simulation step [28,29]. As the data in a simulation model can only be exchanged with other modules at the integral step, the generation process of PWM shall be done in the same submodule. In case of a group of 6-channel PWM, there may be 4 or more PWMs that take switch actions in a step. While 3/6 channels are negative to the other 3 channels, only the situation when two or three groups of switches act at the same time is studied.
At the time of the integral step, integral prediction is used to determine whether the switching action of each PWM occurs. If there are two switching actions at the same time, then the switching time of one group is delayed by 1 ns to prevent the switch from missing. Reordering is performed based on the moments when switches act to realize multiple switching.

PWM Generator Modeling
As noted before, the implicit trapezoid method can be used to obtain the sampling value of the modulation wave at the next step, and the moment when the modulation wave and the carrier wave intersect is known by logic judgment and the interpolation algorithm. In the following, an analysis will be conducted to understand how to use these variables in the mathematical modeling of a PWM generator. As shown in Figure 2, t i , t i+1 , t i+2 , t i+3 and t i+4 represent the fixed-step sampling points. At each sampling point, in addition to sampling the modulation wave and carrier wave signal at the current moment, the PWM generator will judge the logic relationship between them at the present and the next moments. If the relationship is logical XOR, the logic level of pulse width indication signal will be changed; otherwise, it remains the same.
negative to the other 3 channels, only the situation when two or three groups of switches act at the same time is studied.
At the time of the integral step, integral prediction is used to determine whether the switching action of each PWM occurs. If there are two switching actions at the same time, then the switching time of one group is delayed by 1 ns to prevent the switch from missing. Reordering is performed based on the moments when switches act to realize multiple switching.

PWM Generator Modeling
As noted before, the implicit trapezoid method can be used to obtain the sampling value of the modulation wave at the next step, and the moment when the modulation wave and the carrier wave intersect is known by logic judgment and the interpolation algorithm. In the following, an analysis will be conducted to understand how to use these variables in the mathematical modeling of a PWM generator. As shown in Figure 2, ti, ti+1, ti+2, ti+3 and ti+4 represent the fixed-step sampling points. At each sampling point, in addition to sampling the modulation wave and carrier wave signal at the current moment, the PWM generator will judge the logic relationship between them at the present and the next moments. If the relationship is logical XOR, the logic level of pulse width indication signal will be changed; otherwise, it remains the same.  (1) Fixed-step sampling point t i : sampling the logic relationship between the modulation wave and the carrier wave is known as false (u r < u c ) at the current step and true (u r > u c ) at the next step. Therefore, the modulation wave and the carrier wave are expected to intersect in a step from t i to t i+1 , and the PWM signal at the intersection changes from low level to high level. Therefore, at the present moment, PWM', the pulse indication signal, is changed from low level to high level, and the time corresponding to t x is recorded as t x (i). (2) Fixed-step sampling point t i+1 : the logic relationship between t i+1 and t i+2 is judged as XNOR by the method used in (1). Accordingly, the pulse indication signal remains at the high level as before. As the modulation wave intersects with the carrier wave in the previous step (between t i and t i+1 ), the PWM signal changes from low level to high level here. (3) Fixed-step sampling point t i+2 : the logic relationship between t i+2 and t i+3 is judged as XNOR.
Accordingly, the pulse indication signal remains at the high level as before while the PWM signal does not change. (4) Fixed-step sampling point t i+3 : the logic relationship between t i+2 and t i+3 is judged as XOR.
Accordingly, the pulse indication signal changes from high level to low level, and the time when the carrier wave intersects with the modulation wave is calculated and recorded as t x (i+3). The PWM signal remains unchanged. (5) Fixed-step sampling point t i+4 : the logic relationship between t i+3 and t i+4 is judged as XOR.
Accordingly, the pulse indication signal PWM' changes from low level to high level again, and the time corresponding to t x is recorded. As the modulation wave intersects with the carrier wave in the previous step (between t i+3 and t i+4 ), the PWM signal changes from high level to low level.
By analyzing the waveforms at each fixed-step sampling point in Figure 2, the following conclusions are drawn: (a) If at the present and the next-step sampling points, the logic relationship between the modulation wave and the carrier wave is XOR, the logic level of the pulse width indication signal shall change, and the time when they intersect shall be recorded. Otherwise, neither the logic level of the pulse width indication signal shall be changed, nor shall the time of intersection be recorded. (b) If the carrier wave intersects with the modulation wave between the present and the previous-step sampling points, the logic level of the PWM signals shall change; otherwise, it remains the same. (c) The pulse indication signal PWM' is as wide as the PWM, but acts at 1 step in advance, creating conditions for correcting IGBT output voltage later. (d) The t x at the rising/falling edge of the pulse indication signal PWM' is recorded as the initial/final value, and their difference is expressed as ∆t =t x (i + 3) − t x (i). (e) As the PWM signal changes only at the fixed-step sampling point, a delay is expected as compared to the actual time when the modulation wave and the carrier wave intersect. The time difference ∆t calculated based on the pulse indication signal PWM' accurately represent the pulse width of the PWM signal in a switching cycle.

IGBT Mathematical Modeling
As a voltage-based power device extensively used in power electronics converters, IGBT controls the turn-on and turn-off through the gate voltage signal and is inversely parallel to fly-wheel diodes to prevent current breakdown due to sudden changes in inductive load current. Therefore, the combination of one-circuit IGBT, internal resistance, internal induction and fly-wheel diodes is equivalent to the series circuit in Figure 3 [30,31]. In Figure 3, the gate G, the collector C and the emitter E of IGBT are connected to the control signal, the positive and negative terminals of voltage respectively for mathematical modeling. By neglecting the conduction loss and switching loss of IGBT and its antiparallel diode, the equation to calculate the phase voltage of converter modeled based on IGBT/DIODES can be simplified as follows: In Figure 3, the gate G, the collector C and the emitter E of IGBT are connected to the control signal, the positive and negative terminals of voltage respectively for mathematical modeling. By neglecting Energies 2020, 13, 3069 7 of 16 the conduction loss and switching loss of IGBT and its antiparallel diode, the equation to calculate the phase voltage of converter modeled based on IGBT/DIODES can be simplified as follows: where: U jO is the voltage to the midpoint of the DC voltage (j = A, B, C); U CEk is the voltage between the collector and the emitter of the IGBT, k = 1, 2; and 1 represents the upper arm and 2 represents the lower arm. !G is contrary to the gate control signal and values 1 or 0; U L and U R represent the voltages at both ends of the internal induction and internal resistance, respectively; while U F is the simulated external voltage.

Calculation of Phase Voltage
The output voltage from the IGBT model is a numerical signal corresponding to the midpoint of DC bus. The phase voltage calculation equation can be expressed as: where: U jN is the phase voltage (j = A, B, C), and U jO is the voltage corresponding to the midpoint of DC. By Equation (4), the numerical signal of the three-phase voltage of the converter is calculated and transferred to an electrical signal through the controlled voltage source, realizing the connection with the electronics in the Simulink for joint simulation.

Calculation of DC Bus Current
Power loss is generally neglected in power electronics simulation. According to the principle of conservation of energy, the input/output power at the DC side is equal to the output/input power at the AC side of the converter, namely: where: U dc and I dc represent the voltage and current of the DC bus, respectively; U jN and I jN represent the phase voltage and phase current, respectively. According to Equation (5), the current of DC bus is calculated. As the signal is numerical, it shall be converted to an electrical signal by the controlled current source to connect with the power module in Simulink.

Correction Compensation Algorithm
When the PWM signal in Figure 2b is used to control the IGBT for turn-on and turn-off, the output voltage is inaccurate as it contains many non-characteristic harmonics, and therefore requires necessary correction. In the following, the area equivalence principle is introduced by taking the A-phase upper-tube IGBT of a three-phase converter as an example. The output voltage amplitude of IGBT is U AO (U AO = U dc /2). Figure 4a shows the waveforms of the modulation wave and the carrier wave. Ideally, it is expected to control the IGBT actions at the intersection to output the voltage waveform as shown in Figure 4b. However, IGBT only acts at the integral-step sampling point, and the actually output voltage waveform is shown in Figure 4c. Evidently, there is an error as the pulse area S 1 S 2 .

of 16
A-phase upper-tube IGBT of a three-phase converter as an example. The output voltage amplitude of IGBT is UAO (UAO = Udc/2). Figure 4a shows the waveforms of the modulation wave and the carrier wave. Ideally, it is expected to control the IGBT actions at the intersection to output the voltage waveform as shown in Figure 4b. However, IGBT only acts at the integral-step sampling point, and the actually output voltage waveform is shown in Figure 4c. Evidently, there is an error as the pulse area 12 SS  . In Figure 4d, the numerical model-based IGBT output voltage is corrected in the last step of the pulse width by the area equivalent principle. The area equivalent equation is as follows: According to Equation (6): where: t= ( 3) ( )  In Figure 4d, the numerical model-based IGBT output voltage is corrected in the last step of the pulse width by the area equivalent principle. The area equivalent equation is as follows: According to Equation (6): where: ∆t =t x (i + 3) − t x (i) is the actual pulse width between two intersection points of the modulation wave and the carrier wave; U AO and U AO are the output voltage amplitudes when IGBT is normal and at the last step, respectively; ∆s is the correction, which may be positive or negative. At t i+3 , the actual pulse width ∆t is calculated according to the pulse indication signal in Figure 4c; when the IGBT is still outputting, the output voltage amplitude from the IGBT numerical model in the last step can be corrected necessarily to change it from U AO to U AO , so that the area S 1 = S 2 + ∆s. Therefore, the equivalency between the output volume of the IGBT and the actual pulse in a switching cycle is guaranteed.
For other IGBT mathematical models of the three-phase converter, similar methods also apply.

Case Analysis
According to the relationship between the actual response time and the system simulation time, the simulation of a power system may be offline or real-time online. In offline simulation, the operation of actual objects is simulated in software installed on the computer, while in the real-time online simulation, the real-time simulator is used to simulate the operation of an actual object in real conditions, in which, the simulation clock is perfectly consistent with the real clock. Under the two conditions, the interpolation prediction algorithm is analyzed and verified.

Interpolation Algorithm-Based Case Analysis of Converter
To verify the correctness and effectiveness of PWM converters based on an integral prediction and interpolation algorithm under large-step simulation, MATLAB/Simulink software is used here for offline simulation. An AC-DC-AC converter model built by IGBT was used as a simulation example, as shown in Figure 5, and the parameters of the simulation example are listed in Table 2. In this example, the power grid is a 25 kV/60 Hz alternating current, and the power is converted to a 380 V/50 Hz alternating current to supply load through step-down transformer and converter. The load power is 25 kW when the simulation begins and rises to 50 kW at 0.15 s when the breaker is closed. the simulation of a power system may be offline or real-time online. In offline simulation, the operation of actual objects is simulated in software installed on the computer, while in the real-time online simulation, the real-time simulator is used to simulate the operation of an actual object in real conditions, in which, the simulation clock is perfectly consistent with the real clock. Under the two conditions, the interpolation prediction algorithm is analyzed and verified.

Interpolation Algorithm-Based Case Analysis of Converter
To verify the correctness and effectiveness of PWM converters based on an integral prediction and interpolation algorithm under large-step simulation, MATLAB/Simulink software is used here for offline simulation. An AC-DC-AC converter model built by IGBT was used as a simulation example, as shown in Figure 5, and the parameters of the simulation example are listed in Table 2. In this example, the power grid is a 25 kV/60 Hz alternating current, and the power is converted to a 380 V/50 Hz alternating current to supply load through step-down transformer and converter. The load power is 25 kW when the simulation begins and rises to 50 kW at 0.15 s when the breaker is closed.
Step-down transformer   Figure 6a and 6b, though the simulation step of the interpolation prediction model is 50 μs, its simulation result is consistent with the 5 μs standard model. According to the steady-state waveform, the simulation accuracy of the interpolation prediction model with step of 50 μs is exactly the same as a 5 μs standard model.
To verify the simulation accuracy of the interpolation prediction model, the A-phase current of the load is observed. Figure 7a is the waveform of load A-phase current obtained in a standard model with step of 5 μs and 50 μs, respectively. Figure 7b is the waveform of load A-phase current obtained in a standard model with step of 5 μs and in an interpolation prediction model with step of 50 μs, respectively. The current waveform at 5 μs is marked as blue, and the current waveform at 50 μs is marked as red.
According to the global waveform in Figure 7a, when the simulation step increases to 50 μs, the current waveform in the standard model fluctuates significantly and cannot overlap with the current waveform at 5 μs. When the load suddenly increases at 0.15 s, there is a significant error between the 50 μs current waveform (red) and the 5 μs current waveform (blue) according to the local transient process from 0.149 to 0.151 s, suggesting that the increase in step will amplify the delay in switch action when Simulink basic module is used for simulation, resulting in many non-characteristic harmonic waves.

Project Parameter
Step-down transformer capacity 50 kVA Rectifier grid sideline voltage 400 V, 60 Hz Inverter load sideline voltage 380 V, 50 Hz DC bus voltage 750 V By comparing, the simulation waveforms in Figure 6a,b, though the simulation step of the interpolation prediction model is 50 µs, its simulation result is consistent with the 5 µs standard model. According to the steady-state waveform, the simulation accuracy of the interpolation prediction model with step of 50 µs is exactly the same as a 5 µs standard model.
To verify the simulation accuracy of the interpolation prediction model, the A-phase current of the load is observed. Figure 7a is the waveform of load A-phase current obtained in a standard model with step of 5 µs and 50 µs, respectively. Figure 7b is the waveform of load A-phase current obtained in a standard model with step of 5 µs and in an interpolation prediction model with step of 50 µs, respectively. The current waveform at 5 µs is marked as blue, and the current waveform at 50 µs is marked as red.
According to the global waveform in Figure 7a, when the simulation step increases to 50 µs, the current waveform in the standard model fluctuates significantly and cannot overlap with the current waveform at 5 µs. When the load suddenly increases at 0.15 s, there is a significant error between the 50 µs current waveform (red) and the 5 µs current waveform (blue) according to the local transient process from 0.149 to 0.151 s, suggesting that the increase in step will amplify the delay in switch action when Simulink basic module is used for simulation, resulting in many non-characteristic harmonic waves.
According to the global waveform in Figure 7b, though the simulation step increases to 50 µs, the current waveform in the interpolation prediction model overlaps with the current waveform at 5 µs in the standard model. When the load suddenly increases at 0.15 s, there is an insignificant error between the 50 µs current waveform (red) and the 5 µs According to the global waveform in Figure 7b, though the simulation step increases to 50 μs, the current waveform in the interpolation prediction model overlaps with the current waveform at 5 μs in the standard model. When the load suddenly increases at 0.15 s, there is an insignificant

Analysis of PWM Effectiveness Based on Interpolation Prediction Model
To analyze the effectiveness of PWM based on the interpolation prediction model, the key lies in accurately restoring the harmonic waves. Here, the A-phase voltage at the converter load side is taken as the subject. The content of harmonic wave in the A-phase bridge arm voltage waveform at the 5 μs standard model and the 50 μs interpolation prediction model are compared. The FFT analysis results are shown in Figure 8.

Analysis of PWM Effectiveness Based on Interpolation Prediction Model
To analyze the effectiveness of PWM based on the interpolation prediction model, the key lies in accurately restoring the harmonic waves. Here, the A-phase voltage at the converter load side is taken as the subject. The content of harmonic wave in the A-phase bridge arm voltage waveform at the 5 µs standard model and the 50 µs interpolation prediction model are compared. The FFT analysis results are shown in Figure 8. Figure 8a shows the FFT analysis results of the load-side A phase in the detailed model of the converter built on the basis of Simulink basic modules at the step of 5 µs while Figure 8b represents the FFT analysis results of the load-side A-phase in the interpolation prediction model at the step of 50 µs. The area equivalent principle is adopted to calculate the phase voltage. Therefore, the output voltage waveform in this model varies from that of the 5 µs standard model.  Figure 8a shows the FFT analysis results of the load-side A phase in the detailed model of the converter built on the basis of Simulink basic modules at the step of 5 μs while Figure 8b represents the FFT analysis results of the load-side A-phase in the interpolation prediction model at the step of 50 μs. The area equivalent principle is adopted to calculate the phase voltage. Therefore, the output voltage waveform in this model varies from that of the 5 μs standard model.
The THD is 89.78% in Figure 8a and 92.90% in Figure 8b. Regardless of the slight difference, both show a generally basic tendency. By comparing the 5 μs detailed switch model to the 50 μs The THD is 89.78% in Figure 8a and 92.90% in Figure 8b. Regardless of the slight difference, both show a generally basic tendency. By comparing the 5 µs detailed switch model to the 50 µs interpolation prediction model, the effectiveness of PWM in the 50 µs interpolation prediction model is verified.

Efficient Analysis Based on Interpolation Prediction Model
To verify whether the interpolation prediction model can improve simulation efficiency, a 1 s simulation test was performed with the 5 µs standard model and the 50 µs interpolation prediction model, and the time consuming data was checked in the Diagnostic Viewer of MATLAB, as shown in Table 3. Table 3. Model actual execution time.

Simulation Type
Step According to the time consuming data of the simulation operation in Table 3, under the simulation conditions using the same device, the time consumed by the 50 µs interpolation model is significantly shorter and accounts for only about one third of the time consumed by a 5 µs detailed standard model. This is typically due to the increased model calculation times and therefore improved simulation efficiency by enlarging the simulation step. It also certifies the efficiency of the interpolation prediction model. Figure 9a,b shows the voltage and current waveforms of the standard model and the interpolation prediction model on the real-time simulators, respectively. As the simulation step adopted in the real-time simulation is 50 µs, the waveforms of voltage and current in the standard model are disordered, while these in the interpolation prediction model are beyond comparison. Therefore, real-time simulation comparison further verifies the correctness and effectiveness of the interpolation prediction model, and also suggests that the interpolation prediction model could realize the simulation of a small-step model in a large-step real-time simulator.

Real-Time Simulation Based on Interpolation Prediction Model
Energies 2020, 13, 3069 13 of 16 interpolation prediction model, the effectiveness of PWM in the 50 μs interpolation prediction model is verified.

Efficient Analysis Based on Interpolation Prediction Model
To verify whether the interpolation prediction model can improve simulation efficiency, a 1 s simulation test was performed with the 5 μs standard model and the 50 μs interpolation prediction model, and the time consuming data was checked in the Diagnostic Viewer of MATLAB, as shown in Table 3. Table 3. Model actual execution time.

Simulation Type
Step Length According to the time consuming data of the simulation operation in Table 3, under the simulation conditions using the same device, the time consumed by the 50 μs interpolation model is significantly shorter and accounts for only about one third of the time consumed by a 5 μs detailed standard model. This is typically due to the increased model calculation times and therefore improved simulation efficiency by enlarging the simulation step. It also certifies the efficiency of the interpolation prediction model. Figures 9a and 9b shows the voltage and current waveforms of the standard model and the interpolation prediction model on the real-time simulators, respectively. As the simulation step adopted in the real-time simulation is 50 μs, the waveforms of voltage and current in the standard model are disordered, while these in the interpolation prediction model are beyond comparison. Therefore, real-time simulation comparison further verifies the correctness and effectiveness of the interpolation prediction model, and also suggests that the interpolation prediction model could realize the simulation of a small-step model in a large-step real-time simulator.

Real-Time Simulation Based on Interpolation Prediction Model
(a)

Conclusions
This paper puts forward an interpolation-prediction-based PWM generator modeling method and an area-equivalent-based IGBT modeling method. Offline simulation and case analysis were performed in MATLAB/Simulink, and real-time simulation verification was performed in a real-time simulator. The following conclusions area drawn.
(1) In the interpolation-prediction-based PWM generator modeling method, the switching point at any moment under the fixed-step simulation condition can be determined by one-time integral prediction and linear interpolation. The accuracy of the switching point can be equal to or even higher than a 5 μs standard model. (2) In the area-equivalent-based IGBT modeling method, the IGBT action process is processed for equivalence according to the predicted switching time points, so as to ensure the accuracy of output signals from the IGBT numerical model in each switching cycle, and realize the compatibility with the power modules in the Simulink by signal conversion through the controlled voltage source. (3) By case analysis, the effectiveness and efficiency of the control algorithm proposed in this paper are verified. The interpolation-prediction-based control algorithm effectively reduces the non-characteristic harmonic waves arising from switch delay, while the steadiness and transience are good. Due to the increase in simulation step, the operation efficiency of the model also significantly rises. (4) The modeling methods and control algorithm recommended in this paper apply not only to hardware in-loop simulation and real-time simulation platforms, but also to fixed-step electromagnetic transient simulation.
In conclusion, the modeling methods and control algorithm suggested in this paper realize the offline simulation and real-time online simulation at large steps, ensure the accuracy and efficiency of simulation, and play an active role in the simulation research of power electronics.
Author Contributions: Z.H. contributed to the project idea and the results discussion. Y.L. contributed to the specific strategy, theoretical analysis, simulation experiment design, data analysis, results discussion, and

Conclusions
This paper puts forward an interpolation-prediction-based PWM generator modeling method and an area-equivalent-based IGBT modeling method. Offline simulation and case analysis were performed in MATLAB/Simulink, and real-time simulation verification was performed in a real-time simulator. The following conclusions area drawn.
(1) In the interpolation-prediction-based PWM generator modeling method, the switching point at any moment under the fixed-step simulation condition can be determined by one-time integral prediction and linear interpolation. The accuracy of the switching point can be equal to or even higher than a 5 µs standard model. (2) In the area-equivalent-based IGBT modeling method, the IGBT action process is processed for equivalence according to the predicted switching time points, so as to ensure the accuracy of output signals from the IGBT numerical model in each switching cycle, and realize the compatibility with the power modules in the Simulink by signal conversion through the controlled voltage source. (3) By case analysis, the effectiveness and efficiency of the control algorithm proposed in this paper are verified. The interpolation-prediction-based control algorithm effectively reduces the non-characteristic harmonic waves arising from switch delay, while the steadiness and transience are good. Due to the increase in simulation step, the operation efficiency of the model also significantly rises. (4) The modeling methods and control algorithm recommended in this paper apply not only to hardware in-loop simulation and real-time simulation platforms, but also to fixed-step electromagnetic transient simulation.
In conclusion, the modeling methods and control algorithm suggested in this paper realize the offline simulation and real-time online simulation at large steps, ensure the accuracy and efficiency of simulation, and play an active role in the simulation research of power electronics.