0:00

SPICE is a program that was originally developed that you see Berkeley in

the 1960s, and since then, there have been many commercial implementations of it.

And one of them, LTspice, is freely available now and I think works very well.

Here is an example which we're going to talk about in this lecture.

One enters the schematic of a circuit, in this case a buck converter,

and then SPICE can numerically calculate things of interest in a converter,

such as the waveforms in a transient analysis,

as well as other things like frequency analysis plots.

So here's a turn-on transient of a buck converter where the output starts at zero.

The green wave form here is the output voltage that it computes.

It goes through some turn on transient and

eventually settles down to a DC voltage that is approximately, for

a buck converter, equal to the input voltage multiplied by the duty cycle.

1:04

Also in red here is a plot of the inductor current waveform during the same turn

on transient.

To get started, what you should do is follow this link to the LTspice website,

and from there you can download free copies of the software,

either for Windows operating system or for the Macintosh operating system.

1:28

From this Coursera website, you can also download a zip

file containing the buck converter circuit files for this example.

So when you've done that, then you can double-click on this file buck.asc,

which will open the file in LTspice, and that file contains the circuit schematic.

1:49

Then what you do is press the run button to start the simulation, and

the simulation will take maybe ten or 20 seconds to run.

When it's done, then to display a waveform, you can click on a node,

and it will give you the node voltage.

Or you can click on an element and it will plot the current through the element.

Okay, here I have opened LTspice and

opened to the buck converter schematic.

And we have here, this is the buck converter power stage

with the input voltage, Vg, at 24 volts and

output voltage that supplies a five ohm load resistor.

Here's the LC-filter and the switch in the buck converter is realized with this

power MOSFET and power diode.

The circuit has a driver and a pulse-width modulator.

These are called behavioral models, or mathematical models,

of these functions that we have developed for this Coursera course.

So the pulse width modulators takes a DC input voltage, here Vduty,

as a value of 0.4 volts DC.

And it produces an output logic signal, c, that switches on and

off with a duty cycle that is determined by the duty

near the duty cycle of c would be 0.4.

It has a switching frequency that is set by the pulse-width modulator, and you can

right-click on the pulse-width modulator and enter the switching frequency.

In this case, the switching frequency is set to 100 kilohertz.

This signal c goes into the driver,

the driver produces an output voltage to drive the gate of the MOSFET with respect

to its source at the proper voltage to turn the MOSFET on and

off according to the signal c.

3:48

So to run the simulation, we put the cursor on the run button,

the little running person there, and click it.

It will take maybe ten or 20 seconds for the simulation to run.

4:05

LTspice has opened a new window here for

applauding waveforms and we can move the cursor over the schematic

to different places to plot different waveforms.

So first let's look at what the pulse with modulator is doing.

I will move the cursor over the pulse width modulator input,

the cursor changes into a little voltage probe signal.

And if you click there, it will plot that voltage.

4:38

Okay, so the voltage is 400 millivolts, or 0.4 volts.

We can look at the output voltage that the pulse width modulator makes.

So I'll move the cursor over c.

Okay, this is the blue signal here is switching up and

down with a frequency of 100 kilohertz.

Let's get the magnifying glass and zoom in on part of this maybe over here.

5:06

So the blue wave form is c, the control signal.

It has a switching frequency of 100 kilohertz,

corresponding to a switching period of one over 100 kilohertz, or ten microseconds.

5:33

Which would be 0.4 times 10, is 4 microseconds.

Okay, I'm going to erase these waveforms, and

now we'll look at some converter waveforms.

So to erase a waveform, what you do is right-click

on the name of the waveform here on the plot.

So right-click on the PC or you tap the track pad with

two fingers on the Mac, and select Delete This Trace.

6:28

and get a plot of the switch node voltage in green.

So when the MOSFET is on for

the DTS period, the switch node is equal to Vg like this.

And we have 20 poor volts per Vg.

And then when the transistor's off, the diode comes on, and

the switch node voltage is equal to the ground, essentially.

And so we have zero volts or a low voltage.

7:13

So let's just click there, and the blue trace then is

applied to the inductor current, it goes up and down like this.

It's switching or varying between about 2.6 amps, and about 1.1 amp.

Okay, finally we can plot the output voltage.

8:05

And what we find is the output voltage is a little bit less than ten volts, but

it's close.

The SPICE simulation includes some of the loss mechanisms in the converter.

It includes the forward voltage drops of the transistor and diode.

Here I put a little resistor in series with the inductor to model the resistance

of the wire used to wind the inductor, and these things all cause voltage

drops that make the output voltage a little less than we would ideally expect.

9:20

Here's a plot of it.

When the transistor's on,

the current follows the inductor current, again, with a minus sign.

When the transistor is off, the transistor current is zero, and

so the Vg current is zero also.

9:36

We also have this current spike here, and this is caused from the reverse recovery

of the diode, and from the transistor and diode switching times.

This is another source of loss called switching loss,

which we're going to study in the next short course of this course.

We can measure voltages and currents using spikes.

9:59

What we do is we press the control button and

we click on the name of the waveform, and then a window comes up

that tells us average value and the RMS value at the waveform.

So the current drawn out of Vg, this I of Vg has an average value or

DC component of your 707 milliamps.

10:53

So what I do again is select the schematic window,

hover over the power supply for the gate driver, and click there,

and we'll get the current waveform of the gate driver, which looks like this.

The gate driver must draw current out of its power supply to turn the MOSFET on,

and so we see these current spikes happening.

11:16

So the gate driver requires some power to operate.

And we can measure the voltage and

current of the gate driver and calculate its power as well.

So I will Ctrl + Click on that waveform, and here we see that there's

an average current of 14.876 milliamps drawn out of the driver.

That's the average value of the waveform.

It's actually coming in spikes that are considerably higher.

But the average current is the DC component of current and

the average power drawn out of the gate driver supply then would be this

average current multiplied by the gate driver voltage of 12 volts.

11:56

Briefly, here are a few more details regarding models that we have provided for

the pulse width modulator block and the gate driver block.

The functionality of this block is that it produces

an output logic signal C having a duty cycle given by this formula.

So it's a function of VC, the input voltage.

12:18

It can have an offset and it can also has a gain, so

it's divided by some effective number of v sub m.

You can right-click on this block to set values for

those things, the offset voltage in VM.

Right now, VM is set to one volt.

The offset is set to zero.

So the output duty cycle is just equal numerically to the DC value VC.

The block also limits the duty cycle.

It has to be between minimum and maximum values, which can be set as well.

And you can set the switching frequency again by right-clicking on the block and

typing the number in the window.

The gate driver block similarly

is a behavioral model that represents key features of gate drivers.

So what you do is you apply the logic signal C

to this input terminal of the driver.

The driver actually measures its input

voltage with respect to this input reference, which here is tied to ground.

And then it produces an output voltage here with

respect to the driver VSS signal here.

And what we do is we apply these two terminals to the gate and

source of the MOSFET to turn the MOSFET on and off.

The output ground or

reference of the driver need not be the same as the input reference.

13:45

We also have to supply power to the driver to make the circuit work, and so

here we've connected a 12 volt power supply between the input power supply BDD

and its ground pin VSS.

One last point, let's look again at the complete simulation for

the output voltage and inductor current.

14:28

All the signals are starting at zero with the converter turned off, and then when we

turn on, the circuit goes through some transient where the output voltage rises

and there's some kind of error overshoot and ringing, both the current and

the voltage, and eventually the circuit settles down into steady state.

So here's a steady state output voltage and a steady state inductor current.

14:53

We can measure those values as well using SPICE.

So we zoom in at some point after the transient is done,

and then we can Ctrl + click to measure

the average voltage, 9.2855 it says.

So again, a little bit less than ten volts.

15:20

We can also Ctrl + click on the current to measure the average inductor current.

It says that is 1.8573 amps.

Okay, the homework assignment for

this week is to download a Boost converter file.

There's a zip file on the Coursera site for the homework assignment.

You should download SPICE and get it to run, and then run this Boost simulation

file on your computer, and then use LTspice to answer the questions.

And this homework assignment, which everything such as what is the steady

state DC output voltage or average output voltage, the inductor current,

calculate the system efficiency by measuring the input power and

the output power and dividing, and so on.