Simulation of Power Converters Using Matlab-Simulink

The development of specific software dedicated to simulation of power electronic systems (PSIM, SABER, PSCAD, “SimPowerSystems” toolbox of Simulink...) allows simulating fast and accurately the converter behavior. Unfortunately, the designers of converters don’t always have such available software. In many cases, they have to simulate power electronics devices for occasional need. So they don't want to buy the SimPowerSystems toolbox in addition to Matlab and Simulink. The purpose of this chapter is to present the ability to simulate power converters using only Simulink. Simulink is a graphical extension to MATLAB for representing mathematical functions and systems in the form of block diagram, and simulate the operation of these systems.


Introduction
A static converter is an electrical circuit which can control the transfer of energy between a generator and a receiver.The efficiency of a converter should be excellent.The components constituting a converter are: -Capacitors, inductors and transformers with minimum losses, -Power semiconductors operating as switches.
The design of power converter consumes time with a significant cost.Performance is generally determined after testing converters at nominal operating points.Thus, simulation can substantially reduce development cost.
The development of specific software dedicated to simulation of power electronic systems (PSIM, SABER, PSCAD, "SimPowerSystems" toolbox of Simulink…) allows simulating fast and accurately the converter behavior.Unfortunately, the designers of converters don't always have such available software.In many cases, they have to simulate power electronics devices for occasional need.So they don't want to buy the SimPowerSystems toolbox in addition to Matlab and Simulink.The purpose of this chapter is to present the ability to simulate power converters using only Simulink.Simulink is a graphical extension to MATLAB for representing mathematical functions and systems in the form of block diagram, and simulate the operation of these systems.
Traditionally two approaches are used to simulate power electronic systems: -The first, so called fixed topology, where semiconductors are impedances with low or high values based on their on-state or off-state.Equations system does not depend on the state of the semiconductor.Despite its simplicity, this approach raises problems of compromise between accuracy of the results and stability of numerical integration methods. - The second, so called variable topology, assimilates the switches to open-circuits or short-circuits.The system equations then depend on the state of the semiconductor.There are no accuracy problems but writing the equations of different configurations can be laborious as well as obtain switching conditions of the semiconductor.
In this chapter, we propose a method for simulating static converters with Simulink based on the variable topology approach where switching conditions of semiconductor are realized by switching functions.

Linear load modeling in Simulink
This paragraph deals with the modelling of linear elements commonly encountered in the electrical energy conversion.Elementary linear dipoles are described by a system of linear differential equations.There are several different ways to describe linear differential equations.The state-space representation (SSR) is the most easy to use with Matlab.The SSR is given by equations (1) and (2).
where X is an n by 1 vector representing the state (commonly current through an inductance or voltage across the capacitance ), U is a scalar representing the input (voltage or current), and Y is a scalar representing the output.The matrices A (n by n), B (n by 1), and C (1 by n) determine the relationships between the state and input and output variables.
The commonly elementary dipoles encountered in power electronics are: -RL series dipole -RLC series dipole -RC parallel dipole -L in series with RC parallel dipole

RL series dipole
The variation of the current through the dipole is governed by equation (3).
The RL series dipole is modelled by the scheme illustrated in figure 1.

RLC series dipole
The variation of the current through the dipole is governed by equation ( 4) and the variation of the voltage across the capacity is governed by equation ( 5).
  The RLC series dipole is modelled by the scheme illustrated in figure 2.

RC parallel dipole
The variation of the voltage across the dipole is governed by equation ( 6).
  The RC parallel dipole is modelled by the scheme illustrated in figure 3.

L in series with RC parallel dipole
In a L in series with RC parallel dipole, the variation of the current through the inductance is governed by equation ( 7) and the variation of the voltage across the capacity is governed by equation ( 8).
The L in series with RC parallel dipole is modelled by the scheme illustrated in figure 4.

DC-DC converter model in Simulink
This part will be dedicated to the DC-DC converter modelling with Simulink.The input generator is a DC voltage source and the output generator is also a DC voltage source.The output voltage is always smoothed by a capacitor.Only the non-isolated DC-DC converters are studied in this paragraph.The switches are assumed ideal, as well as passive elements (L, C)

Operating phases
The buck converter circuit is illustrated in figure 5a.The most common strategy for controlling the power transmitted to the load is the intersective Pulse Width Modulation (PWM).A control voltage vm is compared to a triangular voltage vt.The triangular voltage vt determines the switching frequency ft.The switch T is controlled according to the difference vm -vt (figure 5b).Three operating phases are counted (figure 5c): -

Open-loop buck converter
Simulink model of the open-loop buck converter is shown in figure 6a.The Buck block is illustrated in figure 6c.Equation ( 12) is modelled by blocks addition, multiplication and logic.The structure of the converter requires a current iL necessarily positive or zero.Also, the inductance current is modelled by an integrator block that limits the minimum value of iL to zero.
The PWM control block is illustrated in figure 6b.
In the case of a resistive load, the load block is constituted by a gain block (value 1/R).Relational Operator

Closed-loop buck converter
A closed-loop buck converter circuit is illustrated in figure 7a.The measurement of the output voltage is realized by 2 resistances R1 and R2.The regulation is achieved by a PID controller.Simulink model of the closed loop converter is shown in figure 7b.Simulink PID control block is illustrated in figure 7c .
The parameters used for the closed-loop simulation are :   In steady-state, Vref = Vmes = 2.5 V. From figure 7a, we deduce the theoretical value of Vo: Simulation is in good agreement with theoretical value.From figure 7d, we deduce that the transient state last roughly 0.2 ms.

Operating phases
The boost converter circuit is illustrated in figure 8a.The principle of the switch control is described in figure 5b Three operating phases are counted (figure 8c) : -T state-on and D state-off -T state-off and D state-on -T and D state-off The variation of the voltage across the inductance L (equation 14) and the current through the capacity (equation 15) depend on the operating phase.
 

Open-loop operation
Simulink model of a open-loop boost converter is shown in figure 9a.The Boost block is illustrated in figure 9b.Equation ( 14), ( 15) and ( 16) are modeled by addition blocks, multiplication blocks and logic blocks.The structure of the converter requires a current iL necessarily positive or zero.Also, the inductance current is modeled by an integrator block that limits the minimum value of iL to zero.
The PWM control block is illustrated in figure 6b.
In the case of a resistive load, the load block is constituted by a gain block (value 1/R).

Simulation example:
The parameters used for of an open-loop simulation are : The simulation of the open-loop boost converter is illustrated in figure 9c.The list of configuration parameters used is: Start time : 0 Stop time : 7 e-3 Type : Variable-step Solver : ode15s (stiff/NDF) Max step size : 1e-6 Relative tolerance : 1e-3 Min step size : auto absolute tolerance : auto Knowing that vt varies from -1 V to + 1 V and vm = 0, we deduce that the duty cycle  is equal to 0.5.In steady-state, we deduce theoretical value of Vo : Simulation is in good agreement with theoretical value.From figure 9c, we deduce that the transient state last roughly 2.5 ms.

DC-AC converter model in Simulink
An inverter is a DC -AC power converter.This converter obtains AC voltage from DC voltage.The applications are numerous: power backup for the computer systems, variable speed drive motor, induction heating...In most cases, the dead times introduced into the control of the switches do not change the waveform of the inverter.
This paragraph is dedicated to the simulation of a three-phase inverter without taking into account the dead times introduced into the control of the switches.

Electrical circuit
A variable speed drive for AC motor is shown in figure 10.It consists on a continuous voltage source and a three-phase inverter feeding an AC motor.
In order to simplify the modelling, the electrical equivalent circuit of the AC motor is described by an inductance LM in series with a resistance RM.The motor runs with delta connection of the stator.
Knowing the conduction intervals of the switches, it is then possible to determine the waveform of different voltages and currents.
The line to neutral voltage v10, v20 et v30 are dependent on the state of the switches. Examples: K1 state-on and K2 state-off: v10 = + VDC K1 state-off and K2 state-on: v10 = 0 K3 state-on and K4 state-off: v20 = + VDC K3 state-off and K4 state-on: v20 = 0 K5 state-on and K6 state-off: v30 = + VDC K5 state-off and K6 state-on: v30 = 0 The phase-phase voltage can be deduce from the line to neutral voltage: u 23 = v20 -v30 ( 19) The input current ii is deduced from the current of switches K1, K3 and K5:

Simulink model
Simulink model of the three-phase inverter is shown in figure 12a.The control block is illustrated in figure 12b.It models a three phases PWM control.The inverter block is illustrated in figure 12c.
In the case of a resistive load, the load block is constituted by a gain block (value 1/R).

Simulation example
The Neglecting the current harmonics, the maximum value of the line current is deduced from equation ( 22 Simulations are in good agreement with theoretical values.

Modeling and simulation of diode rectifiers
Three-phase AC to DC converters are widely used in many industrial power converters in order to obtain continuous voltage using a classical three-phase AC-line.These converters, when they are used alone or associated for specific applications, can present problems due to their non-linear behaviour.It is then important to be able to model accurately the behaviour of these converters in order to study their influence on the input currents waveforms and their interactions with the loads (classically inverters and AC-motors).
Several studies have shown the importance to have tools to simulate the behaviour of complex power electronics systems (Ladoux et al., 2005), (Qijun et al. 2007), (Zuniga-Haro & Ramirez, 2009) and several methods have been also presented in order to reduce the simulation time or to improve the precision.Although constant topology methods have been developed (Araujo et al., 2002), variable topology methods seem to be very suitable for simulation of power-electronics converters (Terrien et al., 1999).
In this chapter, an original and simple method is developed to model and simulate AC-DC converters taking into account overlap phenomenon with continuous and discontinuous conduction modes using Matlab-Simulink.The diodes are assumed ideal (vd = 0 when the diode is state-on, id = 0 when the diode is state-off) If the electrical network is considered as ideal (no line inductance) and the conduction is maintained continuous, (id>0), the modelling of the converters can be realised very simply by a functional approach (commutation functions) where the switches are opened or closed.An example is presented in figure 14.In this chapter, the proposed approach is completely different from the approach based on commutation functions.It permits to simulate accurately the commutation in the six-pulse AC-DC converter, even under unbalanced supply voltages (the influence of voltages unbalances on AC harmonic magnitudes currents has been demonstrated (de Oliveira & Guimaraes, 2007) or line impedances conditions.
The overlap phenomenon and the unbalance of line impedances can be taken into account by modifying the commutation functions to correspond to the real behaviour of the rectifiers in these conditions.Indeed, the commutations are not instantaneous.Several contributions have already been proposed in scientific literature to refine the modelling of rectifiers.Most of these contributions show good simulation results but the analytical models used are complex and not reflecting precisely the real behaviour of the converter (Hu & Morrison, 1997), (Arrillaga et al., 1997).Some methods have been developed in order to model and simulate power factor corrected single-phase AC-DC converters (Pandey et al., 2004).

Electrical model
The six-pulse AC-DC converter is illustrated in figure 15a.Inductances Li characterize the line inductances and Lo characterizes the output inductance.The AC-DC converter modelling is based on the variable topology approach.The diodes are modelled by an ideal model which traduces the state of the switch: -vD = 0 when the diode is state-on; -iD = 0 when the diode is state-off.
There are 13 operating phases: -1 phase of discontinuous conduction mode (P0) All the diodes are state-off (figure 15b)  Naturally, the method is equivalent under unbalanced conditions but the mathematical expressions of the different variables are more complex.
As an example, we will consider the following succession of phases: P0, P1, O1, P2, O2, P3…: To shift from phase P0 (diodes state-off) to phase P1 (D1 D5 state-on), the voltage across diodes D1 and D5 have to be equal to zero.
To shift from phase P1 (D1 D5 state-on) to overlap phase O1 (D1 D5 D6 state-on), the voltage across the diode D6 has to be equal to zero.
To shift from overlap phase O1 (D1 D5 D6 state-on) to phase P2 (D1 D6 state-on), the current through the diode D5 has to be equal to zero.
And so forth …

Discontinuous conduction mode
This mode corresponds to the case where io = 0 (figure 15b).In this case, all diodes are opened.Equation ( 24) describes this mode.

Continuous conduction mode
Let's take example of the continuous conduction mode P1.From the figure 15c, we can write equations ( 25), ( 26) and ( 27) : We obtain the di/dt corresponding to the other continuous conduction modes by making circular permutations of indexes.For example, for conduction mode P2: D1 and D6 are stateon.The indexes s and t are permuted as presented below:

Overlap phases
Let's take example of the overlap phase O1.From the figure 15c, we can write equations ( 30) and (31) : The expression of the di/dt as a function of the device parameters is more complicated to obtain here than in the case of a classical operating phase.Equations have been detailed in (Batard et al., 2007) and the final result is recalled below: We obtain the di/dt corresponding to the other overlap modes by making circular permutations of indexes.For example, for overlap mode O2: D1, D2 and D6 are state-on.The indexes r and t are permuted and the sign of vs and dio/dt are changed:

Simulink model
The simulink model of the six-pulse diode rectifier is illustrated in figure 16a.The resistive load is modelled as a gain.The internal structure of the diodes rectifier block is presented in figure 16b.Four different blocks can be seen on this scheme.
The first one called MF1 is a Matlab function which computes each diode voltage.The inputs of this block are the initial phase and the three-phase network voltages.
The second one called MF2 is also a Matlab function which computes the new operating phase and each inductance di/dt.Its computing algorithm is shown in figure 16d.The new operating phase depends on the initial phase, the diode voltages and currents.
The third, called "Initial Phase" extract the operating phase of the MF2 block, this operating phase becomes the initial phase of the next calculation step (the Simulink block "memory" is used).
The Current block computes each diode current which permits to obtain the DC current and the line currents.The internal structure of the Current block is shown in figure 16c.The originality of our approach is the calculation of the values of each diode current with the values of di/dt of inductances Li and Lo.We use then six integrator blocks (one for each diode).The integrator blocks are set to limit their minimal output value to zero (lower saturation limit), this feature permits to avoid the problem of accurate determination of the instant when diodes currents reach to zero.
It is then possible to determinate the output current of the rectifier (io = iD1 + iD2 + iD3) and the input line currents (ir = iD1 -iD4, is = iD2 -iD5, it = iD3 -iD6).This model has also been tested with a load constituted of an inverter and an induction machine.The results of this test have validated operations for discontinuous conduction mode.For the same configuration parameters, the simulation time was 5 s.

Modeling and simulation of thyristor rectifiers
The Simulink model of the controlled rectifier is very close to the Simulink model of the diode rectifier.Only the condition to turn the thyristor on is different to the condition to turn the diode on.For an ideal thyristor, it is recalled that the thyristor turn-on if its voltage is positive and if a current pulse is sent to the gate.To illustrate the modelling of controlled rectifier with Simulink, let's look at one of the principles of speed control of DC machines.

Electrical model
Let us consider the electrical scheme presented on figure 18a.It represents a DC motor fed by a six-pulse rectifier.The electrical equivalent circuit of the DC motor is described by an inductance La in series with a resistance Ra in series with an induced voltage Va which characterizes the electromotive force, as illustrated in figure 18b.

Simulink model
The simulink model of the controlled rectifier with inductive load is presented in figure 19.It consists of four blocks: -Input Voltage block characterizes the mains supply, -teta_r block models the thyristor control, -Controlled rectifier block computes the different operating phases.

-
The load block represents the motor resistance Ra and the induced voltage Va.
The motor inductance La is regrouped with the output line inductance Lo to have a single output inductor Loeq.

Internal structure of the rectifier block
The structure of the rectifier block is presented on figure 20a.Four different blocks can be seen on this scheme: the first one called "Control T" is used for the control of the thyristor gate.The second one called MF1 is used to compute the inductances state and voltage.The third called Current computes inductances currents.Then, the Initial Phase block computes the initial state for next computing phase.
The computing algorithm has been created in accordance with figure 20b.For each computing step, the new operating phase is calculated.This phase is a function of the initial phase, the sign of the inductance currents and the diode voltages.For each operating phase, the value of each inductance di/dt is calculated and permits to know the diodes currents with the integrator function.
The current block is strictly identical to the current block shown in figure 16.

Thyristor control
The control device for thyristor T1 is presented in figure 21.The switch-on of T1 is delayed of r after urt has reached to zero (block "Delay 1").The control thus carried out is a pulse train (the width of a pulse is computed by block "Delay 2").
The same principle is applied to the other thyristor.We can see that simulation results are in good agreement with experimental waveforms.The overlap delays are equivalent for simulation and experimental results.

Conclusion
This chapter has shown that it is possible to simulate many electrical power converters only using Simulink toolbox of Matlab, thus avoiding the purchase of expensive and complex dedicated software.The simulation method is based on the variable topology approach where switching conditions of semiconductor are realized by switching functions.
The first part of this chapter is dedicated to the modelling of linear loads: RL series, RLC A simulation result on RL series load is presented and compared to experimental result.The similarity of the two results shows the validity of the proposed model.The fifth part extends the method to controlled rectifier.The structure studied here is a six-pulse thyristor rectifier feeding a DC motor.The difference with the diode rectifier is presented with the introduction of a thyristor control block in the simulation.Simulations results are showed in continuous condition mode and are in good agreement with experimental results.

Figure 2 .
Figure 2. Model of a RLC series dipole

Figure 3 .Figure 4 .
Figure 3. Model of a RC parallel dipole

Figure 6 .
Figure 6.Buck converter described in Simulink

Figure 7 .
Figure 7. Modeling a closed loop DC / DC converter

Figure 9 .
Figure 9. Boost converter described in Simulink a) Open-loop Boost block diagram c) Open-loop Boost simulation b) Boost block Terminator

Figure 10 .
Figure 10.Electrical circuitThere are many strategies for controlling the switches.The most common control strategy is the intersective PWM.Its principle is reminded in figure11.The switch control signals are generated by comparing three sinusoidal voltages (modulating) which are phase-shifted through 2/3 [rad] with a same triangular voltage waveform (carrier).

Figure 11 .
Figure 11.Three phase PWM control parameters used for of an open-loop simulation are : the open-loop three-phase inverter is illustrated in figure 13.The list of configuration parameters used is: relation between the amplitude of the sinusoidal voltage and the triangular voltage determines the maximum value of the fundamental line-line voltage of the inverter:

Figure 13 .
Figure 13.Simulation example of a three-phase inverter with PWM control

Figure 14 .
Figure 14.Basic model of a single-phase rectifier.

Figure 16 .
Figure 16.Diode rectifier model Simulations and experimental waveforms related to figure 15 are shown in figure 17.The simulation parameters are adjusted as follows: URMS = 230 V ; R = 58  ; Li =800 H ; Lo = 800 mH It can be seen that the simulated waveforms are very close to the experimental ones.The overlap interval 1 is equivalent for simulation and experimental results (1  0.7 ms).

Figure 17 .
Figure 17.Comparison of Simulation and Experimental Waveforms in a six-pulse diode rectifier The list of configuration parameters used for Matlab simulation is: Start time : 0 Stop time : 0.2s Type : Variable-step Solver : ode15s (stiff/NDF) Max step size : 1e-4 Relative tolerance : 1e-5 Min step size : auto absolute tolerance : autoUsing a PC with an Intel core 2 duo CPU running at 2.19 GHz with 1 Go de RAM, the simulation time was 4 s.

Figure 18 .
Figure 18.Controlled rectifier with inductive load The thyristor are modelled by an ideal model which traduces the state of the switch:  VT = 0 when the thyristor is state-on  IT = 0 when the thyristor is state-off Similar to the diode rectifier, there are 13 operating phases to describe: -1 phase of discontinuous conduction mode (P0) All the thyristor are state-off -6 phases of classical conduction P1 to P6 (figure 15c) P1 : T1 and T5 state-on P2 : T1 and T6 state-on P3 : T2 and T6 state-on P4 : T2 and T4 state-on P5 : T3 and T4 state-on P6 : T3 and T5 state-on -6 phases of overlap O1 to O6 (figure 15d) O1 : T1, T5 and T6 state-on O2 : T1, T2 and T6 state-on O3 : T2, T4 and T6 state-on O4 : T2, T3 and T4 state-on O5 : T3, T4 and T5 state-on O6 : T1, T3 and T5 state-onThe different operating phases are illustrated in figure15.The equations that governs an operating phase are the same whatever we work on a diode rectifier or a controlled rectifier.

Figure 19 .
Figure 19.Simulink model of the controlled rectifier with inductive load

Figure 20 .Figure 21 .Figure 22 .
Figure 20.Structure of the rectifier block series and L in series with RC parallel dipoles are considered.The second part deals with the simulation of DC-DC converters.The buck converter is first studied: after describing the operating phases, open-loop and closed-loop models are presented.A simulation is realised for closed-loop model showing good agreement with theoretical values.The third part shows how to model three-phases DC-AC converters.The electrical circuit and his complete Simulink model are presented and simulation results on RL series load with PWM control are shown.The fourth part presents the modelling of a six-pulse AC-DC converter which is frequently used in industrial applications.The complete model of this converter and his Simulink equivalent circuit are accurately described taking into account overlap phenomenon.
For an operating phase, we determinate the di/dt through each inductance (Li and Lo) and the voltage across each diode.In order to simplify results presentation, we consider that the line is balanced (same RMS voltages and line inductances Li) and have no resistive part.