## 1. 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.

## 2. 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

### 2.1. 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.

### 2.2. 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.

### 2.3. 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.

### 2.4. 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.

## 3. 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)

### 3.1. Buck converter

#### 3.1.1. 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 v_{m} is compared to a triangular voltage v_{t}. The triangular voltage v_{t} determines the switching frequency f_{t}. The switch T is controlled according to the difference v_{m} – v_{t} (figure 5b). Three operating phases are counted (figure 5c):

T state-on and D state-off

T state-off and D state-on

T and D state-off

The variation of the current through the capacitor C is governed by equation (10). The variation of the voltage across the capacity is governed by equation (11). Equation (12) describes the variation of the voltage across the inductance which depends on the operating phase. F is a logical variable equal to one if v_{m} is greater than or equal to v_{t}, F equal to zero if v_{m} is less than v_{t}. Sign(i_{L}) is also a logical variable which is equal to one if i_{L} is positive, sign (i_{L}) equal to zero if i_{L} is zero.

#### 3.1.2. Open-loop buck converter

Simulink model of the open-loop buck converter is shown in figure 6 a. The Buck block is illustrated in figure 6 c. Equation (12) is modelled by blocks addition, multiplication and logic. The structure of the converter requires a current i_{L} necessarily positive or zero. Also, the inductance current is modelled by an integrator block that limits the minimum value of i_{L} to zero.

The PWM control block is illustrated in figure 6 b.

In the case of a resistive load, the load block is constituted by a gain block (value 1/R).

#### 3.1.3. Closed-loop buck converter

A closed-loop buck converter circuit is illustrated in figure 7 a. The measurement of the output voltage is realized by 2 resistances R_{1} and R_{2}. The regulation is achieved by a PID controller. Simulink model of the closed loop converter is shown in figure 7 b. Simulink PID control block is illustrated in figure 7 c.

The parameters used for the closed-loop simulation are :

V_{i} = 12 V | L = 300 H | C = 5 F | R = 3 | f_{t} = 50 kHz | ||

Output voltage measurement: | R_{1} = 10 k | R_{2} = 10 k | ||||

PID block : | K_{p} = 10 | T_{i} = 0.2 ms |

The voltage reference was fixed to 2.5 V. The simulation of the closed-loop buck converter is illustrated in figure 7 d. The list of configuration parameters used for is:

In steady-state, V_{ref} = V_{mes} = 2.5 V. From figure 7a, we deduce the theoretical value of V_{o}:

Simulation is in good agreement with theoretical value. From figure 7d, we deduce that the transient state last roughly 0.2 ms.

### 3.2. Boost converter

#### 3.2.1. Operating phases

The boost converter circuit is illustrated in figure 8 a. 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.

#### 3.2.2. 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 i_{L} necessarily positive or zero. Also, the inductance current is modeled by an integrator block that limits the minimum value of i_{L} to zero.

The PWM control block is illustrated in figure 6 b.

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 :

V_{i} = 12 V | L = 200 H | C = 50 F | R = 5 | f_{t} = 50 kHz | |||

Control blok: | V_{m} = 0 |

The simulation of the open-loop boost converter is illustrated in figure 9 c. The list of configuration parameters used is:

Knowing that v_{t} varies from – 1 V to + 1 V and v_{m} = 0, we deduce that the duty cycle is equal to 0.5. In steady-state, we deduce theoretical value of V_{o} :

Simulation is in good agreement with theoretical value. From figure 9c, we deduce that the transient state last roughly 2.5 ms.

## 4. 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.

### 4.1. 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 L_{M} in series with a resistance R_{M}. The motor runs with delta connection of the stator.

There are many strategies for controlling the switches. The most common control strategy is the intersective PWM. Its principle is reminded in figure 11. 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).

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 v_{10}, v_{20} et v_{30} are dependent on the state of the switches. Examples:

The phase-phase voltage can be deduce from the line to neutral voltage:

u_{12} = v_{10} – v_{20}

u_{23} = v_{20} – v_{30}

u_{31} = v_{30} – v_{10}

The input current i_{i} is deduced from the current of switches K_{1}, K_{3} and K_{5}:

### 4.2. Simulink model

Simulink model of the three-phase inverter is shown in figure 12 a. The control block is illustrated in figure 12 b. It models a three phases PWM control. The inverter block is illustrated in figure 12 c.

In the case of a resistive load, the load block is constituted by a gain block (value 1/R).

### 4.3. Simulation example

The parameters used for of an open-loop simulation are :

Power Circuit : | V_{DC} = 400 V | L_{M} = 10 mH | R_{M} = 5 |

Control blok: | f_{t} = 20 kHz | V_{t max} = 1 V | V_{t min} = - 1 V |

f_{m} = 50 Hz | V_{m max} = 0.5 |

The simulation of the open-loop three-phase inverter is illustrated in figure 13. The list of configuration parameters used is:

The 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:

Neglecting the current harmonics, the maximum value of the line current is deduced from equation (22) :

Simulations are in good agreement with theoretical values.

## 5. 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 (v_{d} = 0 when the diode is state-on, i_{d} = 0 when the diode is state-off)

If the electrical network is considered as ideal (no line inductance) and the conduction is maintained continuous, (i_{d}>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).

### 5.1. Electrical model

The six-pulse AC-DC converter is illustrated in figure 15a. Inductances L_{i} characterize the line inductances and L_{o} 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:

v

_{D}= 0 when the diode is state-on;i

_{D}= 0 when the diode is state-off.

There are 13 operating phases:

1 phase of discontinuous conduction mode (P

_{0})

All the diodes are state-off (figure 15b)

6 phases of classical conduction P

_{1}to P_{6}(figure 15c)

6 phases of overlap O

_{1}to O_{6}(figure 15d)

_{i}and L

_{o}) 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 L

_{i}) and have no resistive part.

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: P_{0}, P_{1}, O_{1}, P_{2}, O_{2}, P_{3}…:

To shift from phase P_{0} (diodes state-off) to phase P_{1} (D_{1} D_{5} state-on), the voltage across diodes D_{1} and D_{5} have to be equal to zero.

To shift from phase P_{1} (D_{1} D_{5} state-on) to overlap phase O_{1} (D_{1} D_{5} D_{6} state-on), the voltage across the diode D_{6} has to be equal to zero.

To shift from overlap phase O_{1} (D_{1} D_{5} D_{6} state-on) to phase P_{2} (D_{1} D_{6} state-on), the current through the diode D_{5} has to be equal to zero.

And so forth …

#### 5.1.1. Discontinuous conduction mode

This mode corresponds to the case where i_{o} = 0 (figure 15b). In this case, all diodes are opened. Equation (24) describes this mode.

#### 5.1.2. Continuous conduction mode

Let’s take example of the continuous conduction mode P_{1}. 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 P_{2}: D_{1} and D_{6} are state-on. The indexes s and t are permuted as presented below:

#### 5.1.3. Overlap phases

Let’s take example of the overlap phase O_{1}. 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 O_{2}: D_{1}, D_{2} and D_{6} are state-on. The indexes r and t are permuted and the sign of v_{s} and di_{o}/dt are changed:

### 5.2. Simulink model

The simulink model of the six-pulse diode rectifier is illustrated in figure 16 a. The resistive load is modelled as a gain. The internal structure of the diodes rectifier block is presented in figure 16 b. 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 16 d. 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 16 c. The originality of our approach is the calculation of the values of each diode current with the values of di/dt of inductances L_{i} and L_{o}. 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 (i_{o} = i_{D1} + i_{D2} + i_{D3}) and the input line currents (i_{r} = i_{D1} – i_{D4}, i_{s} = i_{D2} – i_{D5}, i_{t} = i_{D3} – i_{D6}).

### 5.3. Experimental validation

Simulations and experimental waveforms related to figure 15 are shown in figure 17. The simulation parameters are adjusted as follows:

U_{RMS} = 230 V ; R = 58 ; L_{i} =800 H ; L_{o} = 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).

The list of configuration parameters used for Matlab simulation is:

Using 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.

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.

## 6. 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.

### 6.1. Electrical model

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

The thyristor are modelled by an ideal model which traduces the state of the switch:

V

_{T}= 0 when the thyristor is state-onI

_{T}= 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 (P

_{0})

All the thyristor are state-off

6 phases of classical conduction P

_{1}to P_{6}(figure 15c)

6 phases of overlap O

_{1}to O_{6}(figure 15d)

The different operating phases are illustrated in figure 15. The equations that governs an operating phase are the same whatever we work on a diode rectifier or a controlled rectifier.

### 6.2. 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 R

_{a}and the induced voltage V_{a}.

The motor inductance L_{a} is regrouped with the output line inductance L_{o} to have a single output inductor L_{oeq}.

#### 6.2.1. Internal structure of the rectifier block

The structure of the rectifier block is presented on figure 20 a. 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 20 b. 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.

#### 6.2.2. Thyristor control

The control device for thyristor T_{1} is presented in figure 21. The switch-on of T_{1} is delayed of _{r} after u_{rt} 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.

### 6.3. Experimental validation in continuous conduction mode

Simulations and experimental waveforms related to the electrical circuit presented in figure 18 are shown in figure 22. The simulation parameters are adjusted as follows:

U_{RMS} = 230 V ; R_{a} = 4 ; V_{a} = 145 V; L_{i} = 800 H ; L_{oeq} = 800 mH

The list of configuration parameters used for Matlab simulation is:

We can see that simulation results are in good agreement with experimental waveforms. The overlap delays are equivalent for simulation and experimental results.

## 7. 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 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. 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.

Many of the results presented in this chapter are computed with short simulation times (few seconds). This can be achieved thanks to the simplicity of the proposed method. The power electronics converters presented are used alone but the method can be easily extended to cascaded devices allowing the simulation of complex power electronic structures such as, for example, active filters with non-linear loads.