Documente Academic
Documente Profesional
Documente Cultură
PSpice
Simulation of Power
Electronics Circuits
A book published by Chapman & Hall, 1997
by R. Ramshaw
ECE Dept.
University of Waterloo.
Contents
Chapter 5
Sawtooth Generator and Worked
EXAMPLE
Comparator and Worked EXAMPLE
Section 5.3.2
Section 5.4.4
See Appendix E in the book.
1997
This material is provided strictly "as-is" for use with the book and is intended for exercises
and not for design. The authors and Chapman & Hall specifically disclaim all warranties,
express or implied including, but not limited to, implied warranties of merchantability and
fitness for a particular purpose. With respect to these extra materials associated with the book
and made available on the WEBsite, the authors and publisher shall have no liability with
respect to any loss or damage directly or indirectly arising from the use of these associated
materials provided on the WEBsite. Without limiting the foregoing, the authors and publisher
shall not be liable for any loss of profit, interruption of business, damage of equipment or data,
interruption of operations or any other commercial damage, including but not limited to,
direct, indirect, special, incidental, consequential or other damages.
Do not rent, lease, sell, or publish this material in whole or in part without the express
permission of the authors and Chapman & Hall.
EXAMPLE W5.2.1
Design a sawtooth generator with an output voltage of variable frequency and
adjustable amplitude. Implement this generator simulation with an amplitude
of 1V and a frequency of 100kHz. Write the circuit file with the sawtooth
generator described in a subcircuit.
Solution
There are four steps in this solution.
A PSpice independent-voltage source can produce an approxSTEP 1 imate sawtooth waveform if the source is represented by a
periodic pulse voltage. Figure W5.2.1 depicts a PSpice configuration and the waveform.
TF
TR
V2
st
VST
PULSE
0
(a)
PW
R1 1M
v(1)
V1
0
PERIOD
(b)
W5_2_1 .CIR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* V1 = 0.01V and V2={VM0.01} ensures the full range of the duty cycle.
R1
* Nodes 1, 0 of the main circuit file correspond to 101, 100 in the subcircuit.
* The X statement calls for the subcircuit VSAWTOOTH.
* Its parameter values override the default values in the subcircuit.
* Needs a global parameter PER in the circuit file.
. PARAM
. STEP
. TRAN
. PROBE
. END
FREQ=100kHz PER={1/FREQ}
PARAM
FREQ
LIST
50kHz
100kHz
60ns 60us
Sawtooth-generator voltage.
v(1) ;
+++++++++++++++++++++++++++++++++++++++++++++++++
STEP 3
STEP 4
f=50kHz
0.5V
0V
1.0V
v(1)@1
f=100kHz
0.5V
0V
0s
v(1)@2
10us
20us
30us
40us
50us
60us
Time
Fig. W5.2.1c
EXAMPLE W5.2.2
Design a comparator using an analogue behavioural model (E source) like that
in Section 1.4. Include a 1% hysteresis and let the output voltage swing from
ground level to the value of the positive op-amp source VCC = 15V. The input
is a sinusoidal voltage of amplitude 2V and a frequency of 0.5Hz, as shown
in Fig. W5.2.2a. Write the circuit file with the comparator described in a
subcircuit. Plot traces of the input and output voltages. Check the hysteresis.
2sin3.1416t V
R in
Subcircuit COMPARATOR
VCC
Comparator
15V
Rh
Rf
R
0
(a)
(b)
2 t (s)
STEP 1
STEP 2
Subcircuit COMPARATOR
101
103
Op-amp
VS 2sin3.146 t V
RIN
1M
E A in
Limit 0, VCC
RL 1M
102
202
RH 1k
RF 100k
100
W5_2_2 .CIR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
2
2
v(1),
v(3, 2)
+++++++++++++++++++++++++++++++++++++++++++++++++
STEP 3
The PSpice simulation is run with the circuit file W5_2_2 .CIR.
Input voltage
-2.0
20V
v(3,2)
0
Output voltage of comparator
10V
0V
0s
v(1)
0.5s
1.0s
1.5s
2.0s
2.5s
3.0s
3.5s
4.0s
Time
Fig. W5.2.2d.
5.3.2
Gate 1
driver
Gate 3
driver
TH 1 TH 3
Rail A
s
AC
source
DC
load
R
Rail B
Gate 4
driver
Gate 2
driver
TH 4
TH 2
(a)
gate 1
gate 2
gate 3
gate 4
All
OFF
(b)
TH 1
TH 2
ON
All
OFF
TH 3
TH 4
ON
All
OFF
TH 1
TH 2
ON
TH 3
TH 4
ON
Subcircuit FULLWAVE_DRV
Gate 3
driver
Gate 1
driver
VG1
VG3
( , )
PULSE
PULSE
111
101
133
11 TH1 gate
RG1 50
R1 10M
0
Gate 2
driver
Gate 4
driver
EG2 VG1
EG4 VG3
PULSE
103
122
33 TH3 gate
RG3 50
R3 10M
0
102
144
TH2 gate
3
RG2 50
0
0
SIN
240V 50Hz
104
TH4 gate
2
Vs
RS 10M
RG4 50
4
5
STEP 3
+++++
The PSpice simulation is run with circuit file W5_3_1 .CIR. The
gate voltages generated by the driver and the sinewave reference
voltage are recorded. The job time was about 17.3s.
W5_3_1 .CIR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VGATE=5V VSIN=240V
VMAX={1.414*VSIN}
FREQ=50Hz PERIOD={1/FREQ}
In degrees.
ALFA=90 ;
* SOURCE.
Sinewave reference.
VS 5
RS 5
0
0
* CIRCUIT ELEMENTS
RG1
1
11 50 ;
RG2
RG3
RG4
R1
2
3
4
11
0
33
0
0
50
50
50
1E7ohms ;
0
11
1E7ohms
2 0
3
33 4
0 FULLWAVE_DRV
0.2ms 60ms
v(1, 11), v(2), v(3, 33), v(4),
v(5) ;
+++++++++++++++++++++++++++++++++++++++++++++++++
From PROBE, the traces of the gate voltage to each thyristor for
= */2 radians are plotted together with the reference sinewave.
This is shown in Fig. W5.3.1b.
STEP 4
-400
5.0V
v(5)
0
Vgate3
Vgate1
0V
5.0V
v(1,11)
Vgate3
Vgate1
Vgate1
v(3,33)
Vgate4
Vgate2
0V
0s
v(2)
v(4)
10ms
Vgate4
Vgate2
20ms
Vgate2
30ms
40ms
50ms
60ms
Time
Fig. W5.3.1b
5.4.4
Many driver switching schemes have been devised in the quest to obtain an
inverter ac waveform that closely resembles a sinewave. One technique is to
extend the method of equal multiple pulses described in Section 5.4.3 in the text.
The extension is to modulate the width of the pulses over the half cycle of the gate
signal. This can be called a modulating PWM driver. We will consider the
single-phase bridge inverter whose schematic diagram is shown in Fig. 5.4.1 in
the text. The switches are driven in pairs Sw 1, Sw 2 and Sw 3, Sw 4. Our aim in
this section is not to design switching strategies for a PWM driver, it is to
exemplify a technique that can be simulated using PSpice.
EXAMPLE W5.4.1
Design an SPWM modulator using the 555 timer IC. The driver circuit is to
provide modulating 12-V gate signals for an output frequency of 60Hz. The
carrier frequency is to be 2kHz. Do a PSpice simulation and plot traces of the
carrier signals, the reference signal for modulation and the PWM gate signal over
one modulating cycle.
Solution
In EXAMPLE 5.2.3 the 555 timer was used in the astable mode as a driver for a
chopper. In this example we will use the 555 timer in the monostable mode (one
shot) as a driver for an inverter. Further, the pulse widths of the gate signals will
be modulated over each period of the output cycle. This is done to improve the
performance of the inverter output.
Figure W5.4.1a shows the external connections of the 555 timer for the monostable mode of operation. The 555 timer generates one output pulse every time
a short pulse (going negative) is applied to the trigger input (pin 2). The width of
the input pulse must be less than the width of the output pulse. The width of the
output pulse is set by the RC timing network. When the trigger input goes low,
the output (pin5) goes high and the timing capacitor C begins charging at an
exponential rate set by the RC time constant. When the capacitor voltage exceeds
the control voltage on pin 5, the 555 timer resets. This reset action causes the
discharge of the timing capacitor. Thus, the output (pin5) goes low until another
trigger pulse occurs. The 0.01F capacitor, that is connected to pin 5, decouples
and filters internal circuitry. Once a trigger pulse is applied, the output pin goes
high and the timer capacitor charges at the rate
v6 (t ) VCC 1 e t /RC .
(5.4.4)
t p /RC
VCC
VCC v5
(5.4.5)
.
(5.4.6)
There is the special case where no external reference control voltage is applied
to pin 5. In this case v5 = 2VCC /3 internally, so tp . 1.1RC .
This was used in EXAMPLE W5.3.2 in Section 5.3.3 on the WEBsite.
Pulse width-modulation is the practice of generating a continuous stream of pulses
whose width can be modulated. For chopper drivers, PWM (pulse-widthmodulation) meant that the stream of gate pulses had a constant width
(m = tON /T = constant), but the pulse width could be changed (adjustable duty
cycle m). For inverters we want a modulating PWM signal. That is, the many
gate pulses per cycle have the pulse width varied from a small value, to a large
value and back to a small value over the cycle.
12V
Input
8
VC C
2
Trigger
4
Reset
555
timer
Fig. W5.4.1a
Monostable mode.
5
Control
voltage
Gnd
1
R
7
6
Discharge
Threshold
Output
This modulating PWM action can be achieved by the 555 timer. An external
sinusoidal voltage at pin 5 can create the modulation by changing the point at
which the capacitor voltage resets the timer. This voltage at pin 5 is the SPWM
reference voltage for modulation. Clock pulses at pin2 can continuously retrigger
the timer for one-shot pulses at the desired frequency (2kHz). These clock pulses
constitute the carrier signal for modulation.
The solution of this example is done in five steps.
STEP 2
From the circuit diagram in Fig. W5.4.1a and from the design data
above a PSpice configuration of the PWM driver can be drawn.
This is shown in Fig. W5.4.1b.
STEP 3
R 2.8k
4
7
2
VCC
DC
source
V2
PULSE
Clock
carrier
Subcircuit
named 555D
5
V5
C 0.1 F
3
1
RL 10k
Output
SIN reference
0
W5_4_1 .CIR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
. PARAM
. PARAM
. PARAM
. PARAM
VC=12V ;
TON=10us ;
PWMFREQ=2kHz
* SOURCES
VCC
V2
V5
8
2
5
0
0
0
DC
{VC} ;
This source voltage is for the 555 timer.
PULSE({VC} 0 0 1ns 1ns {TON} {PER}) ; Carrier voltage.
SIN({VDC} {VMAX} {FREQ}) ;
Reference sinewave.
EVAL .LIB
100us
v(3),
17ms
v(2), v(5) ;
+++++++++++++++++++++++++++++++++++++++++++++++++
STEP 4
The PSpice simulation can be run with the circuit file W5_4_1.CIR.
The results are stored in a data file named W5_4_1 .DAT.
Using PROBE we can plot traces of v(2), the carrier wave (clock),
STEP 5 v(5), the modulating wave (reference), and v(3), the PWM output
gate voltage. Figure W5.4.1c shows these waveforms. They
illustrate the effectiveness of the simple 555-timer pulse-width modulator that may
serve well for a number of applications.
SPWM INVERTER DRIVER (555 TIMER)
20V
Clock pulses at a carrier frequency PWMFREQ=2kHz
0V
10V
v(2)
v(5)
Gate signal:- a modulating cycle of PWM pulses
-1V
0s
v(3)
2ms
4ms
6ms
8ms
10ms
12ms
14ms
16ms
18ms
Time
Fig. W5.4.1c