AVG(V(control))
10V
SEL>>
0V
V(control)
20V
V(control)
AVG (V(control))
AVG (V(error))
0V
V(error)
-20V
V(error)
40V
AVG (V(error))
V(out)
20V
AVG (V(out))
0V
0s
1ms
2ms
V(out)
AVG (V(out))
3ms
4ms
5ms
Time
6ms
7ms
8ms
9ms
10ms
Chapter 9
Simulation
of
Switching Converters
Overview
PSpice
Matlab
Simulink
Power switchin
Simulation of switchi
R
5O
Power switchin
Simulation of switchi
-4.0
0s
V1(RL)
5ms
I(C0)
I(L0)
10ms
15ms
20ms
Time
Power switchin
Simulation of switchi
L = 50 mH
4.0
2.0
I(LO)
I(CO)
0
-2.0
0s
I(C0)
Power switchin
5ms
I(L0)
10ms
V(2)
15ms
20ms
25ms
30ms
35ms
40ms
45ms
50ms
Time
Simulation of switchi
L = 5 mH
V(C2)
4.0
2.0
I(LO)
0
I(CO)
-1.0
0s
5ms
V(2)
Power switchin
I(LO)
I(CO)
10ms
15ms
20ms
Time
Simulation of switchi
L = 1.25 mH
8
V(2)
6
4
I(LO)
2
-2
I(CO)
0s
5ms
V(2)
Power switchin
I(LO)
I(CO)
10ms
15ms
20ms
Time
Simulation of switchi
L = 10 mH
and
C = 500 uF
V(2)
6.0
4.0
2.0
I(LO)
I(CO)
-2.0
0s
5ms
V(2)
Power switchin
I(LO)
I(CO)
10ms
15ms
20ms
Time
Simulation of switchi
L = 1.25 mH
and
C = 500 uF
V(2)
I(LO)
0
I(CO)
-5
Power switchin
0s
V(2)
I(LO)
I(CO)
5ms
10ms
15ms
20ms
Time
Simulation of switchi
Voltage-controlled switch
Nc+
Ron
S
Nc-
N-
Power switchin
Simulation of switchi
10
Current-controlled switch
Ron
VN
N-
W<name> N+ N- VN WNAME
.MODEL WNAME ISWITCH (RON=0.01 ROFF=1E+7 ION=0.1 IOFF=0)
Power switchin
Simulation of switchi
11
S1
DFW 0 2 D1
RL 3 0 5
10mH
L0 2 3 10M
C0 3 0 100U
LO
VS
10V
DFW
RSX
CO
100uf
R
5ohms
VPWM
0
Power switchin
Simulation of switchi
12
2.0
I(LO)
I(CO)
0
-1.0
0s
5ms
V(3)
I(LO)
10ms
15ms
20ms
I(CO)
Time
Power switchin
Simulation of switchi
13
-3.0
15.0ms
V(3)
15.5ms
20* I(CO)
Power switchin
16.0ms
16.5ms
17.0ms
17.5ms
18.0ms
Time
Simulation of switchi
14
2.0
I(LO)
I(CO)
0
-1.0
L0 2 3 100U IC=1
C0 3 0 IC=5
.TRAN 2NS 200NS UIC
Power switchin
0s
5ms
V(3)
I(LO)
10ms
15ms
20ms
I(CO)
Time
Simulation of switchi
15
pwm
10mH
+
V1
10Vdc
V1 = 0
V2 = 1
TD = 0
TR = 1n
TF = 1n
PW = 0.5m
PER = 1m
V2
S1
++
- S
D1
out
Dbreak
VOFF = 0.0V
VON = 1.0V
ROFF = 1e6
RON = 1.0
C1
100F
R1
20O
Power switchin
Simulation of switchi
16
20V
15V
10V
5V
0s
5ms
V(out)
Power switchin
10ms
15ms
20ms
25ms
30ms
Time
Simulation of switchi
17
1.0A
0A
-1.0A
I(C1)
-2.0A
0s
I(L1)
Power switchin
5ms
I(C1)
10ms
15ms
20ms
25ms
30ms
Time
Simulation of switchi
18
part library
system parts
Power switchin
Simulation of switchi
19
Power switchin
Simulation of switchi
20
Power switchin
Simulation of switchi
21
Power switchin
Simulation of switchi
22
Power switchin
Simulation of switchi
23
Power switchin
Simulation of switchi
24
PSpice-equivalent parts
Power switchin
Simulation of switchi
25
PSpice-equivalent parts
Power switchin
Simulation of switchi
26
Power switchin
Simulation of switchi
27
Power switchin
Simulation of switchi
28
Functions in arithmetic
expressions
Power switchin
Simulation of switchi
29
Functions in arithmetic
expressions
Power switchin
Simulation of switchi
30
3*sin (2*PI*freq*TIME)
sine
Simulation of switchi
31
Power switchin
Simulation of switchi
32
rms
If (TIME<=0,0,SQRT(SDT(PWR(V(%IN),2))/TIME))
RMS meter
If(argument,then,else)
If (TIME<=0, 0, SQRT(SDT(PWR(V(%IN),2))/TIME))
Power switchin
Simulation of switchi
33
pwm
V4
PWM modulator
Power switchin
Simulation of switchi
34
VCO
Power switchin
Simulation of switchi
35
control
triangular
V1 = -10
V2 = 10
TD = 0
TR = 0.5m
TF = 0.5m
PW = 1n
PER = 1m
100k
10
pwm
V4
Simulation of switchi
36
In-
PARAMETERS:
R2
10Meg
0
In+
0
R1
10Meg
1Vac
0Vdc
V4
Vcc = +12
VEE = 0
{Vcc}
100k
50
IN
OpAmp
50 + s OUT
{VEE}
Simulation of switchi
37
50
0
SEL>>
-50
0d
DB(V(OPAMP))
-50d
-100d
1.0mHz 10mHz
P(V(OPAMP))
1.0Hz
100Hz
10KHz
1.0MHz
100MHz
Frequency
Simulation of switchi
38
InR4
1k
R2
10Meg
0
In+
0
R1
10Meg
1Vac
0Vdc
V4
PARAMETERS:
Vcc = +12
VEE = 0
{Vcc}
100k
IN
50
50 + s OUT
OpAmp
{VEE}
Simulation of switchi
39
-50
0d
DB(V(OPAMP))
-50d
SEL>>
-100d
1.0mHz 10mHz
P(V(OPAMP))
1.0Hz
100Hz
10KHz
1.0MHz
100MHz
Frequency
Simulation of switchi
40
L1
10mH
pwm
D1
S1
Dbreak
++
V1
- S
10Vdc
out
VOFF = 0.0V
VON = 1.0V
ROFF = 1e6
RON = 0.05
C1
100F
R1
20
E1
++
- E
Power switchin
GAIN = 0.25
sense
error
12
1Meg
-12
1Meg+s
5
Vref
Error amplifier
Simulation of switchi
41
10V
SEL>>
0V
V(control)
20V
V(control)
AVG (V(control))
AVG (V(error))
0V
V(error)
-20V
V(error)
40V
AVG (V(error))
V(out)
20V
AVG (V(out))
0V
0s
1ms
2ms
V(out)
AVG (V(out))
3ms
4ms
5ms
6ms
7ms
8ms
9ms
10ms
Time
Power switchin
Simulation of switchi
42
L1
10mH
IC = 0
100uF
100
V1
MTP15N05E/MC
ESR
10m
300k
R1
sense
20
R3
100k
R5
+15
0
control
G
0
-15
PWM modulator
3k
R4
V-
V+
LM311
pwm_out
V-
B/S
-15
R8
300
Power switchin
R2
C1
X2
V1 = 0
V2 = 10
TD = 0
TR = 999u
TF = 1n
PW = 1n
PER = 1m
1k
TL084
saw
V4
V+
10Vdc
out
MUR420
R6
+
D1
pwm
5
Vref
Error amplifier
+15
0
Simulation of switchi
43
0A
I(L1)
5.2V
5.0V
4.8V
V(control)
20V
10V
SEL>>
0V
0s
V(out)
5ms
10ms
15ms
20ms
25ms
30ms
Time
Power switchin
Simulation of switchi
44
Power switchin
Simulation of switchi
45
Power switchin
Simulation of switchi
46
Power switchin
Simulation of switchi
47
Power switchin
Simulation of switchi
48
10mH
IC = 0
10Vdc
V1
VMSSCCM
U7
VC
L1
Rs
2
D = 0.5
IC = -1.84
RMPHITE = 10
RD = 1e-6
RM = 1e-6
RE = 10m
0
1Vac
0Vdc
V4 RSW = 10m
VAP = -17.6
out
Cout
100uF
IC = 0
Resr
10m
R
20
Rs1
300k
sense
Rs2
100k
Small-signal AC analysis
Power switchin
Simulation of switchi
49
2.0A
1.0A
0A
20V
I(L1)
10V
SEL>>
0V
0s
V(OUT)
Power switchin
5ms
10ms
15ms
20ms
25ms
30ms
Time
Simulation of switchi
50
-40
SEL>>
-80
-0d
DB(V(OUT))
-100d
-200d
-300d
1.0Hz
P(V(OUT))
Power switchin
10Hz
100Hz
1.0KHz
10KHz
100KHz
1.0MHz
Frequency
Simulation of switchi
51
L1
10mH
IC = 0
1 A
Rs
3
VC C
1Vac
10Vdc
V4
U7
VMSSCCM
P 2
D = 0.5
IC = -1.84
RMPHITE = 10
RD = 1e-6
RM = 1e-6
RE = 10m
RSW = 10m
VAP = -17.6
out
Cout
100uF
IC = 0
Resr
10m
R
20
R s1
300k
sense
R s2
100k
Input impedance
Power switchin
Simulation of switchi
52
80
60
40
20
0
1.0Hz
10Hz
DB(V(V4:+)/I(V4))
100Hz
1.0KHz
10KHz
100KHz
1.0MHz
Frequency
Input
impedance
Power switchin
Simulation of switchi
53
10mH
IC = 0
10Vdc
V5
U7
VMSSCCM
C 3
VC
L1
Rs
out
2
D = 0.5
IC = -1.84
RMPHITE = 10
RD = 1e-6
RM = 1e-6
RE = 10m
RSW = 10m
VAP = -17.6
Cout
100uF
IC = 0
Resr
10m
R
20
Rs1
300k
sense
1Vac
10Vdc
V4
Rs2
100k
Output impedance
Power switchin
Simulation of switchi
54
20
-20
-40
1.0Hz
10Hz
DB(V(V4:+)/I(V4))
100Hz
1.0KHz
10KHz
100KHz
1.0MHz
Frequency
Output impedance
Power switchin
Simulation of switchi
55
10mH
IC = 0
U7
VMSSCCM
VC
L1
10Vdc
V1
V1 = 1.2
V2 = 1.5
TD = 20m
TR = 1n
TF = 1n
PW = 50m
PER = 50m
out
D = 0.5
IC = -1.84
RMPHITE = 10
Rs
RD = 1e-6
RM = 1e-6
RE = 10m
V4
RSW = 10m
VAP = -17.6
Rs1
Cout
100uF
IC = 0
Resr
10m
300k
sense
20
Rs2
100k
Power switchin
Simulation of switchi
56
10V
SEL>>
0V
3.0A
V(OUT)
2.0A
1.0A
0A
0s
5ms
I(L1)
10ms
15ms
20ms
25ms
30ms
Time
Power switchin
Simulation of switchi
57
R3
1
0.5
V1
out
OUT
IN
DON GND
Rs = 1
FS = 1k
L = 10m
R1
10m
R2
20
10
C1
100u
IC = 0
Power switchin
Simulation of switchi
58
25V
20V
15V
10V
5V
0V
0s
V(OUT)
Power switchin
5ms
10ms
15ms
20ms
25ms
30ms
Time
Simulation of switchi
59
Power switchin
Simulation of switchi
60
(100.000,-1.2488)
-40
-80
90
DB(V(VF))
0
(100.000,-163.029)
-90
-180
-270
SEL>>
-360
1.0mHz
10mHz
P(V(VF))
100mHz
Power switchin
1.0Hz
10Hz
100Hz
1.0KHz
10KHz
100KHz
1.0MHz 10MHz
Frequency
Simulation of switchi
61
Frequency compensation
choose f1 = 100 Hz for a switching frequency of 1 kHz
PID compensation
f1
f1
1
2
tan
f
z
f p
comp ( f1 ) 90 2 tan 1
f1z 1 tan
fz
f1
1
comp 90 2 tan
f p
Power switchin
f1
1 40 Log10
f z
1 f1z
40 Log
Simulation of switchi
10
f
1 1
f
p
f
1 1
f p
62
PID compensation
f p1 =
2 R 3C 3
( C1+ C 2 )
=
f p2
2 R 2C 1C 2
1
=
f z1
2 R 2C 1
1
=
f z2
2 ( R 1 + R 3 )C 3
Power switchin
R2
=
K1
R1
R 2( R 1 + R 3 )
=
K2
R1R 3
C 1C 2
R3
.
C3=
C1+ C2
R2
Simulation of switchi
Mag_comp_f1 = -7.0985
Ph_comp = 32
k1_db = -24.6094
k1 = 0.0588
k2_db = -5.0259
k2 = 0.5607
R2 = 588.2076
R3 = 269.7258
C1 = 5.0034e-005
C2 = 1.3496e-006
C3 = 2.8658e-006
63
V1
10Vdc
D1
pwm
10mH
IC = 4
R6
V MUR420
X2
100
MTP15N05E/MC
out
Cout
100uF
IC = 20
ESR
10m
R
20
Rs3
1k
V+
+15
0
V-
R8
B/S
+
300
LM311
pwm_out
G
0
-15
-15
PWM
V3 modulator
+15
`15
V2
-15
Rs2
3k
C2
control
saw
V1 = 0
V2 = 10
V4
TD = 0
TR = 999u
TF = 1n
0
PW = 1n
PER = 1m
R2
R4
10meg
173.0498 2.5483e-006
R3 C3
1.1461e-006
C1
518.3291 5.0014e-005
-15
Power switchin
sense
V-
L1
+15
Simulation of switchi
R1
10k
TL084
+
V+
Rs
5
Vref
Error amplifier
64
4.5A
4.0A
I(L1)
10.0V
7.5V
SEL>>
5.0V
V(control)
40V
20V
0V
0s
V(out)
5ms
10ms
15ms
20ms
25ms
30ms
Time
Power switchin
Simulation of switchi
65
PI compensation
L1
3
1
0
10Vdc
10mH
IC = 0
VC
U7
VMSSCCM
P
out
D = 0.5
IC = -1.84
RMPHITE = 10
Rs
Vg
Cout
200uF
IC = 0
RD = 1e-6
RM = 1e-6
RE = 10m
20
Resr
RSW = 10m
VAP = -17.6
1Vac
0Vdc
10m
GAIN = 0.25
E1
++
- E
V1
Vf
0
10k
R1
TF
s C1 R1 1
s C1R2
C1
10
-10
Vf
500n
1k
EAO
R2
10
error
10 + s
100k
Power switchin
Simulation of switchi
66
PI compensation
100
Compensated loop gain
Uncompensated loop gain
0
-100
SEL>>
-200
DB(V(VF))
DB(V(EAO))
180
Compensated loop gain
90
0
-90
-180
-270
-360
1.0mHz
10mHz
P(V(VF))
Power switchin
100mHz
P(V(EAO))
1.0Hz
10Hz
100Hz
1.0KHz
10KHz
100KHz 1.0MHz
Frequency
Simulation of switchi
67
10Vdc
V1
L1
2 pwm
D1
100k
10mH
Dbreak
IC = 1.8
S1
gate
++
- S
0 VOFF = 0.0V
VON = 1.0V
if( V(%IN1) < V(%IN2),1,0)
control
2
3
1 saw
V1 = 0
V2 = 10
TD = 0
TR = 99.9u
TF = 0.05u
PW = 0.05u
PER = 100u
Power switchin
out
Cout
R
100u
IC = 20 20
Resr
10m
0
C1
R1
1k
R2
10k
500n
10
V2
0.25
-10
1
1+s
100k
ref
Simulation of switchi
68
2.0A
0A
I(L1)
30V
20V
10V
SEL>>
0V
10V
V(OUT)
5V
0V
0s
V(CONTROL)
5ms
10ms
15ms
20ms
25ms
30ms
Time
Power switchin
Simulation of switchi
69
L1
2 pwm
10mH
R3
X1
1
IC = 1.8
gate
10
+15
R5
3k
20
R6
R4 B/S
300
-15
+15
-15
V3
0
-15Vdc
control
V4
R2
C1
-15
saw
V1 = 0
V2 = 10
TD = 0
TR = 99.9u
TF = 0.05u
PW = 0.05u
PER = 100u
10k
500n
V-
R1
1k
LM311
G
TL084
V2
V+
+15Vdc
MTP15N05E/MC
Cout
100u
IC = 20
Resr
10m
1k
V+
MUR420
out
V1
V-
10Vdc
D2
ref
+15
0
Power switchin
Simulation of switchi
70
2.0A
0A
40V
I(L1)
20V
0V
10V
V(OUT)
5V
SEL>>
0V
0s
2ms
V(CONTROL)
Power switchin
4ms
6ms
8ms
10ms
12ms
14ms
16ms
18ms
20ms
Time
Simulation of switchi
71
Power switchin
Simulation of switchi
72
Simulation of switchi
73
Power switchin
Simulation of switchi
74
Power switchin
Simulation of switchi
75
No convergence in DC analysis
PIVTOL Error
Singular Matrix
Power switchin
Simulation of switchi
76
Power switchin
Simulation of switchi
77
Solutions to convergence
problems
Power switchin
Simulation of switchi
78
Modeling
of circuit components
PSpice
Power switchin
Simulation of switchi
79
Make sure that the correct PSpice units (i.e. MEG for
1E6, not M, which means mili in simulations) are used
Power switchin
Simulation of switchi
80
Power switchin
Simulation of switchi
81
Power switchin
Simulation of switchi
82
Power switchin
Simulation of switchi
83
Power switchin
Simulation of switchi
84
Transient convergence
The
This
Power switchin
Simulation of switchi
85
Transient convergence
The
Followed
Power switchin
Simulation of switchi
86
Power switchin
Simulation of switchi
87
It
Look
Power switchin
Simulation of switchi
88
sources
Ensure that there is no unreasonably large
capacitor or inductor
Power switchin
Simulation of switchi
89
PSpice options
Set RELTOL=.01
Power switchin
Simulation of switchi
90
PSpice options
Skipping
Any
Power switchin
Simulation of switchi
91
s
s
1
sz1
s z 2
v$o ( s )
Kd
$
s
s2
d (s)
1
0 Q 0 2
Kd
s z1
Vs
(1 D) 2
1
RESR C
Rind re D (1 D )
RESR R
re RESR || R
Q
R
(1 D) 2
sz 2
( R RESR || R ) ind
L
L
Power switchin
1
LC
Simulation of switchi
0
Rind re (1 D )
1
L
C ( RESR R)
92
Power switchin
Simulation of switchi
93
sysTF
Power switchin
Simulation of switchi
94
20
0
-20
-40
0
-45
Phase (deg)
Magnitude (dB)
40
-90
-135
-180
-225
-270
1
10
10
10
10
10
10
10
Frequency (rad/sec)
Power switchin
Simulation of switchi
95
Amplitude
50
40
30
20
10
0
-10
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
Time (sec)
Power switchin
Simulation of switchi
96
Power switchin
Simulation of switchi
97
A=[
B1=[
0
1/cap
1/L
0];
1
L
1
RC
D ^ Vs ^
x
1
L u L d
^
x
0
2
0
-1/L
-1/(Rload*cap)]
%during Ton
B2=[
0
0];
%during Toff
B=B1*D+B2*(1-D)
C=[0 1];
Power switchin
Simulation of switchi
98
OLpoles = eig(A)
0.3
sysOL=ss(A,B,C,0)
step(sysOL)
To: Y (1)
Amplitude
0.25
0.2
0.15
0.1
0.05
0.5
1.5
2
Time (sec.)
Power switchin
Simulation of switchi
2.5
3.5
4.5
x 10 -3
99
Vs/L
closed-loop poles:
P=1e3*[-0.3298 + 0.10i -0.3298 - 0.10i]';
Bf= gamma*(D/Vref);
F=place(A,Bf ,P)
Power switchin
Simulation of switchi
100
90
80
70
60
[NUM,DEN] = TFDATA(sysTF,v)
Output
50
40
30
-5.317e-8s 2 -0.0565s+82.32
20
4.913e-6s +0.0134s+1.0
Step
Scope
Transfer Fcn
10
0
output
time
Clock
-10
To Workspace
0.005
0.01
To Workspace1
Power switchin
Simulation of switchi
0.015
0.02
0.025
0.03
0.035
0.04
0.045
Time (s)
101
0.05
Power switchin
Simulation of switchi
102
0
752
A
10638 2660
B 214.82 0 '
x' = Ax+Bu
y = Cx+Du
Step
Scope
State-Space
C 0 1 '
D0
Power switchin
output
time
Clock
To Workspace
To Workspace1
Simulation of switchi
103