Professional Documents
Culture Documents
Simulation of PWM DC DC Converters Using
Simulation of PWM DC DC Converters Using
Simulation of PWM DC DC Converters Using
In this paper, a time-domain simulation of the DC-DC converters’ dynamic behavior is described. Corresponding to the
state-space model for each possible operation mode of the circuit, an analytic solution is provided. Converter’s regulator is
discretized using the pole-zero placement technique based on its Laplace transfer function. An algorithm results in a very
accurate simulation due to the exact solution of the circuit’s equations.
K e y w o r d s: simulation, DC-DC converters, PWM, eigenvalues
DOI: 10.1515/jee-2017-0002, Print (till 2015) ISSN 1335-3632, On-line ISSN 1339-309X c 2017 FEI STU
14 A. Lekić: SIMULATION OF PWM DC-DC CONVERTERS USING EIGENVALUES AND EIGENVECTORS
vC1 X X
L2 ±vCi + ±vGj = 0. (7)
iL1 L1 2 3 iL2 4
1 i j
C1
C2
vIN S2 R Thus, DCVM and DICM provide one extra equation
S1 by including dependence of capacitor voltages or induc-
vC2 tor currents. On the other hand one of the unknown
0
state variables is symbolically changed to the combina-
tion of sums of inductor currents and current sources cur-
rents/capacitor voltages and voltage sources voltages.
Fig. 3. Ćuk converter
A common case for DICM is when inductor current be-
comes zero which means that DICM cutset contains only
currents and derivatives of capacitor voltages. Vector z
consists of independent sources’ values, inductor currents one inductor and switches and possibly current sources.
and capacitor voltages, while matrix H contains quanti- Then the equation is modified by setting inductor voltage
ties. In order to solve the converter’s circuit containing to zero. In Fig. 2, DICM cutset is depicted as red dashed
switches, an extra equation for each state of the switch, circle and as it can be seen this cutset contains one in-
on and off state, must be added as ductor and two switches. Other, more complicate case,
is when the number of inductors in the DICM cutset is
iS = 0 for S off, greater than one. From Fig. 3 it can be seen that this kind
(4)
vS = 0 for S on. of DICM occurs in the Ćuk converter where DICM cutset
is depicted as red dashed circle and crosses two inductors
The equations for reactive elements in the circuit, induc- and two switches. The equation for DICM cutset for the
tor and capacitor, are similar to the equations for inde- Ćuk converter in DICM is given by
pendent current and voltage source, respectively. There-
fore, an extra equation for the inductor in the example of
Buck converter shown in Fig. 2, is given as iL1 − iL2 = 0 (8)
2.2 Solving State-Space Equations Using Eigenvalues where xp is the particular and xh is the homogeneous
solution. Homogeneous solution is found by calculating
A system consisting of ordinary differential equations eigenvalues of the system matrix A from equation (10).
can be presented in the standard state-space form as Matrix A has (m + n) rows and columns, so there are
follows: m+n eigenvalues, λj ∈ C where j ∈ {1, 2, . . . , m+n} . In
the case of DC-DC converters, eigenvalues are either zero
ẋ = Ax + Bu , (10) or distinct real or complex numbers. In the case when
y = Cx + Du , (11) there are complex eigenvalues, they are in conjugate-
complex pairs because their characteristic polynomial has
where x is the vector which consists of state variables, real coefficients. The homogeneous solution in the case of
i.e., inductor currents and capacitor voltages, u is the distinct eigenvalues is given by
vector of independent sources and y is the vector of out- m+n
X m+n
X
put variables [18]. In this work only DC-DC PWM con- xh (t) = x i e λi (t−t0 ) = Xi e λi t , (15)
verters with one input and one output, as described in i=1 i=1
[6, 5], will be considered. Let us denote the number of where t = t0 denotes the beginning of the interval. Thus,
inductors in the converter as m and the number of ca- for each interval during one switching period, the homo-
pacitors as n. Generally, the number of inductors and the geneous solution can be analytically solved by calculating
number of capacitors doesn’t have to be equal. However, system eigenvalues.
in order to obtain independent output voltage of the load The particular solution is obtained by solving the fol-
resistance, it is shown that the total number of inductors lowing equation
should be equal to the total number of capacitors, m = n
[19]. The switching cell is considered as a three-port ele- Axp (t) + Bu(t) = 0. (16)
ment between input and output of the converter and it is If matrix A is invertible, particular solution is equal to
made of switches, inductors and capacitors. xp (t) = −A−1 Bu(t). (17)
Depending on the switch realization and the switching
However, the system matrix can have zero eigenvalue,
cell network during one switching interval, a number of
meaning being singular. If matrix A has zero eigenvalues,
subintervals may occur. However, that number is equal to
then the particular solution can be determined as
2 + k , where 2 subintervals are usual CCM intervals and ⊤
k represents different number of discontinuous modes, as P−1 Qu(t) (18)
in [14]. During one switching period consisting of 2 + k where matrix P is obtained from matrix A by the elimi-
subintervals, the state-space models are nation of rows and columns which are containing only ze-
A1 x(t) + B1 u(t), nTS ≤ t < (n + d1 )TS ros or that are linear combination of other rows/columns.
This occurs in the case of discontinuous modes and in
A2 x(t) + B2 u(t), some continuous conduction modes as well. Vector Q is
(n + d1 )TS ≤ t < (n + d1 + d2 )TS obtained from vector B by elimination the same rows
ẋ(t) = (12) that are eliminated in matrix A. The particular solution
...
for the state variables whose equations are eliminated in
Ak+2 x(t) + Bk+2 u(t),
Pk+1 equation (18) are their values from the end of the previous
n + j=1 dj TS ≤ t < (n + 1)TS time interval.
Assuming that t = t0 denotes the end of the previous
and and the beginning of the next time interval, the value
C1 x(t) + D1 u(t), nTS ≤ t < (n + d1 )TS of the state variables at the beginning of the interval is
known and denoted as x(t0 ). Using previously formulated
C2 x(t) + D2 u(t),
equations (10), the system of m + n equations can be
(n + d1 )TS ≤ t < (n + d1 + d2 )TS written as
y(t) = (13)
. . . m+n
X
Xi e λi t0 ,
Ck+2 x(t) + Dk+2 u(t),
x(t0 ) = xp (t0 ) +
i=1
n + k+1
P
j=1 dj TS ≤ t < (n + 1)TS
m+n
X
ẋ(t0 ) = ẋp (t0 ) + λi Xi e λi t0 = Ax(t0 ) + Bu(t0 ),
In this work all of the discontinuous modes are considered i=1
[15]. Again, m is the number of inductors in the circuit, ..
n is the number of capacitors, p is the number of inde- . (19)
pendent sources and q is the number of output variables. m+n
Earlier defined vectors and matrices are of dimensions
X
x (m+n−1) (t0 ) = xp(m+n−1) (t0 ) + λim+n−1 Xi e λi t0
A(m+n)×(m+n) , B(m+n)×p , Cq×(m+n) and Dq×p . i=1
State-space differential equations have the solution of m+n−1
X
the form = Am+n−1 x(t0 ) + Am+n−1−j Bu(j−1) (t0 ),
x(t) = xp (t) + xh (t) (14) j=1
Journal of ELECTRICAL ENGINEERING 68 (2017), NO1 17
where Xi are spectral components of all state variables linear combinations of the remaining m+n−r equations.
corresponding to eigenvalue λi . In DC-DC converters, Equation (21) shows that even for those elements m+n−
the vector of independent sources u is constant or slowly r coefficients are calculated. Other elements operating
changing during one switching period. Thus, all deriva- continuously have m + n − r coefficients of which at least
tives u(j−1) (t0 ), j ≥ 1 will be considered as zero and one is different than zero.
omitted in what follows. Derivatives of the partial solu- Described algorithm is easy to be realized in some
tion are zero, because they are linear combinations of in- programming languages. For the given matrices A, B,
dependent sources values. The solution of equations (19) C and D, eigenvalues can be calculated and eliminated
provides quantities for further calculation which can be ones with value zero. Afterwards, the particular solution
found using the reduced row echelon form [11] of the sys- can be found as reduced row echelon form of the equa-
tem as tion (17). In this paper we used Python 2.7 to compute
matrix obtained via reduced row echelon form with the
x(t0 ) − xp
X1 vector consisting of indices of leading 1. Of course in dis-
X2 A x(t0 ) + B u continuous mode or in marginally stable continuous con-
M . = (20)
.. .
.. duction mode there would be r rows completely equal
Xm+n A (m+n−1)
x(t0 ) + A (m+n−2)
Bu to zero, but for other state variables particular solution
is provided as the value in the last column pointed by
where matrix M(m+n)2 ×(m+n)2 consists of (m + n)2 ma- corresponding index. Zero rows are at the end of the ma-
trices indexed as Mi, j as follows: trix. In the programs for elements corresponding to the
“skipped” indices are assigned values from the end of the
M0,1 M0,2 ... M0,m+n
previous time interval.
M1,1 M1,2 ... M1,m+n After determining coefficients of the homogeneous so-
M= . lution (21) and particular solution (17), the overall solu-
.. .. ..
. . .
tion can be determined as
Mm+n−1,1 Mm+n−1,2 . . . Mm+n−1,m+n
X1
Matrices Mi,j have (m + n) rows and columns and X2
ẋ(t) = N .. + xp (22)
.
Mi,j = diag λij e λj t0 .
Xm+n−q
Equations (19) and (20) can be rewritten for the case of
with matrix N(m+n)×(m+n)(m+n−q) , where q = 0 if ma-
singular system matrix A. System matrix is singular in all
trix A is nonsingular and q = r if matrix A has r zero
discontinuous conduction modes and in some continuous
eigenvalues, equal to
conduction modes, eg, continuous conduction modes of
the Ćuk converter (see Appendix 2). Let us assume that N = [ N1 N2 . . . Nm+n−q ] (23)
the number of zero eigenvalues is r . That means that the
column connected matrices A and B have r zero rows and
or rows that are some linear combination of other rows. Ni = diag e λi t .
(24)
Therefore, r equations can be eliminated and degener-
ated system of equations is then of dimension r (m + n). 2.3 Regulator Design
The solution for the described problem is to eliminate
eigenvalues equal to zero while calculating spectral com- The regulator generates a PWM signal which controls
ponents Xi and to reduce the order of the system. In the controllable switch. Duty-ratio of the PWM signal is
the case of r zero eigenvalues, the number of nonzero calculated inside regulator and provides exact moment
eigenvalues is m + n − r , and the originally system (20) of the transition between on-state and off-state of the
becomes controlled switch or switches. The exact time of the state
transition is determined by the use of cutset algorithm
X1
with given absolute and relative errors.
X2
M = Since the simulation program is a natural environment
..
. for the implementation of digital and/or discrete regu-
Xm+n−r lators, the regulator is completely designed in discrete
x(t0 ) − xp (t0 )
manner. With a given Laplace transfer function which de-
scribes the dynamic behavior of an analog regulator, the
Ax(t0 ) + Bu(t0 )
. (21)
discretization is done using pole-zero matching method.
..
General form of the regulator transfer function in analog
(m+n−r−1) (m+n−r−2) domain is given by
A x(t0 ) + A Bu(t0 )
State-space
Determination
Determination model generation
Netlist of possible List of states
of possible states and eigenvalues
transitions
calculation
Start
Initialization
Yes End of
End simulation?
No
Update time
calculate vectors
x and y
No
where d(s) represents duty-ratio and e(s) is the output with the nominator of degree i and the denominator of
error in the Laplace domain. Equation (25) can be rewrit- degree j .
ten as Qn s
d(s) i=1 1 + szi j−1
bd,k
i
ad,l
Gc (s) = = Gc0 Qm
X X
e(s) s
d[n] = − d[n + k − j] + e[n + l − j] . (26)
j=1 1 + spj bd,j bd,j
k=0 l=0
where, n is the order of nominator and m is the or-
der of denominator. Pole-zero matching transformation, For the desired regulator, values of errors and duty-ratio
Gc (s) → Gd (z), is done as follows [12] are updated once during switching period. Converter out-
• Finite poles and zeros of continuous transfer func- put values, which are same as regulator input values, at
tion Gc (s), sp/z,i = sreal,i + jsimag,i , are trans- the end of the switching period t = n TS are sufficient for
formed into their discrete equivalent by using zp/z,i = that purpose. Those values are already known, calculated,
e(sreal,i +jsimag,i )Ts , where Ts represents sampling pe- and thus new value for duty-ratio is easily obtained.
riod.
2.4 Switching time determination
• Zeros at sz,i → ∞ are mapped into zz,i = −1 .
• DC gain of discrete transfer function is set to be equal
DC-DC converters allow two switching types: inter-
to the DC gain of continuous transfer function |Gc (s =
nal, which occurs in case when condition for entering dis-
j · 0)| = |Gd (z = 1 + j · 0)|.
continuous mode is satisfied, and external triggered by
Hence, using the obtained discrete transfer function, dif- the regulator, for which exact time of the transition and
ference equation (or recurrent equation) for the duty-ratio state variables’ and output variables’ values have to be
determination is derived in a simple manner as known. An algorithm used for internal switching time de-
Pi Pi ad,l l−j termination relies on second-order Newton’s interpolation
l=0 bd,j z
l
d(z) l=0 ad,l z method. External switching is closely related to the reg-
Gd (z) = = Pj = Pj−1 bd,k k−j
e(z) k=0 bd,k z
k 1 + k=0 bd,j z ulator design.
Journal of ELECTRICAL ENGINEERING 68 (2017), NO1 19
iL1 (mA) iL1 (A)
128.3 1.4
74.5 1.1
20.8 0.7
-32.9 0.4
-86.6 0.0
iL2 (mA) iL2 (mA)
8.7 0.0
-36.5 -172.7
-81.6 -345.4
-126.8 -518.1
-171.9 -690.9
vC1 (V) vC1 (V)
12 42.4
9 31.8
6 21.2
3 10.6
0 0.0
vC2 (V) vC2 (V)
0.0 0.0
-0.5 -3.6
-1.1 -7.2
-1.6 -10.8
-2.1 -14.4
0 160 320 480 640 800 0 160 320 480 640 800
t (ms) t (ms)
Fig. 6. Transient diagrams of state variables of the Ćuk converter Fig. 7. Transient diagrams of state variables of the Ćuk converter
shown in Fig. 3 for the first 800 µs and d = 0.2 shown in Fig. 3 for the first 800 µs and d = 0.8
vIN S2 C
According to the regulator design, duty-ratio and error
vC R
are calculated once during the switching period. On the
0 other hand, the condition for state change caused by
the regulator has to be checked after every time interval
(switching period is divided into smaller time intervals).
Checking is done based on whether the controlled switch
Fig. 8. Synchronous buck converter
or switches turns on or off. In both cases if the switching
occurs a new point with exact switching time in which the
Internal switching
state change occurs must be added and all state variable
Function that describes internal switching has the fol- values must be calculated.
lowing form
f (x) = αx + βu,
where α and β are vectors consisting of values 0 , 1 and 3 Program implementation
−1 . Those values are coefficients that contain information
for state variables and independent sources in equation Using the constraints explained in Section 2, a pro-
(6) or (7) and depend on the determined discontinuous gram is implemented in Python 2.7 programming lan-
mode. guage. Program reads input netlist whose form is pro-
According to the second-order Newton’s interpolation vided in Appendix 1. At the beginning of the simulation,
method, time is determined as the state-space model for each possible mode of operation
is created and stored. After that the calculation of the
1
tn+1 = tn + . (27) transient begins during which the simulation results are
f (2) (xn ) f˙(xn )
2f˙(xn )
− f (xn ) stored. In Fig. 4, the simulation initialization is described.
As can be seen from Fig. 4, the state-space matrices are
Matrix form of state-space model is very useful in this calculated for every possible combination of the conduct-
case, because ing switches. Then, the no valid states are eliminated. If
f˙(xn ) = αAxn + αBu in the circuit exists a DICM cutset or a DCVM loop then
a discontinuous mode (DICM or DCVM) is possible and
and that state is saved. Afterwards for each possible state,
f (2) (xn ) = αA2 xn + αABu . eigenvalues are calculated and stored.
20 A. Lekić: SIMULATION OF PWM DC-DC CONVERTERS USING EIGENVALUES AND EIGENVECTORS
With determined possible states and transitions and whose results are shown in Figs. 6 and 7 are verified using
also calculated matrices and eigenvalues, simulation pro- PLECS [20] and GeckoCIRCUITS [21]. Originally simu-
ceeds starting at time t = 0 with given initial values for lations were done with 100 points per period, but the
the state variables. The simulation starts with the ini- number of points can be decreased to 30 points per pe-
tial state and continues with the same procedure until it riod with the same simulation results.
reaches the stop time. The second example is the Buck converter. The first
Step interval is 1000 points per period by default, but simulation is done for the synchronous Buck converter
precision can be given as an input to the program. After (realized using four-quadrant switches) depicted in Fig. 8
each step interval, it is checked if there can be changes with parameters vIN = 20 V, L = 200 µH, C = 1 mF,
of state either by the regulator (limited duty-ratio) or by R = 5 Ω and fS = 100 kHz, whose input netlist is in
some of discontinuities inside the converter. In the case Appendix 1 and system’s matrices in Appendix 3, with
when a change occurs, by intersect algorithm, accurately the regulator defined using the following transfer function
a moment when the transition occurs is determined. This
procedure is presented in Fig. 5 by the flowchart. 1.05 · 106 s2 + 3.193 · 109 s + 3.161 · 1011
H(s) = (28)
3.011 · 105 s2 + 1.076 · 1010 s
vC (V) vC (V)
5.7 5.1
4.3 3.8
2.9 2.5
1.4 1.3
0.0 0.0
0.0 2.6 5.3 7.9 10.5 13.2 0.0 1.5 3.0 4.5 6.0 7.5
t (ms) t (ms)
Fig. 9. Transient diagrams of state variables of the synchronous Fig. 10. Transient diagrams of state variables for buck converter
buck converter shown in Fig. 8 for the first 13.2 ms shown in Fig. 2 for the first 7.5 ms
Journal of ELECTRICAL ENGINEERING 68 (2017), NO1 21
1
0 0 0 0
equations by calculating their homogeneous and partic- L1
0 0 0 −L 1
ular solutions. For the converter, a discrete regulator is , B(1,1) = 0
A(1,1) =
0 0 0
2
designed which controls the switches. 0 0
1 1
The proposed algorithm is implemented in Python 0 C2 0 − C2 R 0
2.7 programming language which is a free software. It
is shown to have high accuracy by decreasing the number C = [0 0 0 1], D = [0],
of calculation points. The simulation results for the two
State variables’ vector, independent source’s vector and
DC-DC converters of practical importance are provided.
Furthermore, these simulation results verify the perfor- output variable’s vector are given in the following forms
mance of the algorithm for each operating mode of the
converter. iL1
i
x = L2 , u = [ vIN ] , y = [ vC2 ] .
Appendix A: Input netlist example vC1
vC2
Here, the input netlist for the synchronous Buck con-
verter with parameters vIN = 20 V, L = 200 µH, C =
Appendix C: Buck converter
1 mF, R = 5 Ω and fS = 100 kHz is provided.
For the Ćuk converter depicted in Fig. 3, the calculated C(0,1) = [ 0 1 ] , D(0,1) = [ 0 ]
state-space matrices (matrices’ index is switches’ state in
order (S2, S1)) are given below. Matrices C and D are when switch S1 is on and diode/switch S2 is off and
the same for all of the states and therefore they are given
just once.
0 − L1
0
A(1,0) = 1 , B (1,0) = ,
1 1 C − C1R 0
0 0 − L1 +L − L1 +L
1
2 2 L1 +L2
0 0 − 1 − 1 1
L1 +L2 L1 +L2
A(0,0) = , B(0,0) = L1 +L2
0 C11 0 0 0 C(1,0) = [ 0 1 ] , D(1,0) = [ 0 ]
1
0 C2 0 − C21 R 0
when switch S1 is off and diode/switch S2 is on. It can be
seen that when both switches are not conducting inductor
0 0 0 0 1
current falls to zero and thus discontinuous inductor cur-
0 0 − 1 − 1 L1
L2 L2
0 rent mode occurs. State when both semiconductors are
A(0,1) = , B(0,1) =
1
0 C1 0 0 0 on is not valid.
0 C12 0 − C21 R 0 State variables’ vector, independent source’s vector
and output variable’s vector are given in the following
0 0 − L11 0
1
forms
L1
0 0 0 − L12 0
A(1,0) = 1 , B(1,0) =
C1 0 0 0 0 iL
x= , u = [ vIN ] , y = [ vC ] .
1
0 C2 0 − C21 R 0 vC
22 A. Lekić: SIMULATION OF PWM DC-DC CONVERTERS USING EIGENVALUES AND EIGENVECTORS