LTSpice intro - potentiometer, voltage divider and resistance sweeps
-
0:00 - 0:08All right, I'm gonna do a quick LTspice
crash course for Mac and Windows users. -
0:08 - 0:15Go to and it'll be this link.
-
0:19 - 0:20Right here on the main page.
-
0:20 - 0:21Choose your download.
-
0:25 - 0:28Once it downloads,
you're gonna double-click on it. -
0:28 - 0:33It's gonna show here,
you're gonna go into here. -
0:33 - 0:36This is a little different than what
you're expecting on Macs normally. -
0:36 - 0:40You're gonna put that in there and,
actually, I've already got it in here, so -
0:44 - 0:48LTspice, open it up.
-
0:51 - 0:56This will pop up consistently,
it's actually a bug. -
0:56 - 1:00Just ignore it,
you don't need to update anything. -
1:00 - 1:02So here you go.
You can start a new schematic. -
1:06 - 1:10You can add grid dots so
it's easier to see the scaling. -
1:10 - 1:15And this is the difference
with Windows and Mac, is Mac, -
1:15 - 1:20you actually have to access things
through your right-click or -
1:20 - 1:23Cmd, whatever, Cmd + left-click.
-
1:23 - 1:25I just do double tap.
-
1:25 - 1:29So let's just draw a simple circuit.
-
1:29 - 1:36It's easier to start with the wires and
the shape of the circuit that you want. -
1:36 - 1:39And then you can just drop in,
-
1:39 - 1:45hit Esc to go back to normal view,
normal tool tip. -
1:45 - 1:48So Wires is F3,
I'll probably end up using that more. -
1:48 - 1:49Component is F2.
-
1:51 - 1:55So let's say we want to
do a voltage source, -
1:55 - 2:00then you can just drop this right in,
and it clicks it in for you. -
2:04 - 2:10Function F2 for part, resistor,
that's just showing right here anyways. -
2:10 - 2:16So by the way, notice the folder
that these are all in up here. -
2:16 - 2:18If you had access to other folders,
it would show here. -
2:18 - 2:23In fact, I'll show it is going to
autogenerate another folder for -
2:23 - 2:24your own circuits.
-
2:24 - 2:27It'll auto generate for
this particular circuit, in fact. -
2:27 - 2:32[COUGH] So we also need a ground,
which another -
2:32 - 2:37quirk of this is you don't
actually get to ground -
2:37 - 2:42through component,
you go Net Name > Ground. -
2:42 - 2:45All circuits apparently have
to have a global ground. -
2:45 - 2:49I tried to use COM, this is a common.
-
2:49 - 2:54And you'll learn about this,
but for some reason, -
2:54 - 2:57these circuits need a global ground.
-
2:57 - 2:58Okay, click there.
-
3:00 - 3:02So this circuit is ready.
-
3:02 - 3:05Well, we have to give it some values here.
-
3:05 - 3:10Just right-click on that to
give it a value here in this. -
3:10 - 3:11Probably another number.
-
3:11 - 3:16When you see the hand here,
you right-click on it, -
3:16 - 3:20it gives you sorta the same option here.
-
3:20 - 3:24You can also include a resistance and
series just so -
3:24 - 3:27that it's no longer an ideal source.
-
3:29 - 3:34We're gonna use ideal
everything essentially. -
3:34 - 3:36Resister here, let's just say 1k.
-
3:41 - 3:42Resistor 1k.
-
3:46 - 3:50Okay so
let's try to simulate this thing, and -
3:50 - 3:54you'll see what happens,
no one else is command found. -
3:54 - 3:56So this is a Spice program,
-
3:56 - 4:00which means you actually have
to give it a Spice directive. -
4:00 - 4:05And the way that you do that
is draft a Spice directive. -
4:08 - 4:09And it'll give you this.
-
4:09 - 4:11You just type in the directive.
-
4:11 - 4:14If you don't know Spice directives,
which you shouldn't know, -
4:14 - 4:16unless you've used Spice before.
-
4:16 - 4:19Then you can actually go like this.
-
4:19 - 4:24Help me, and
you can do step which is to step -
4:24 - 4:29through values, or just do an analyse.
-
4:32 - 4:37So Transient is if you want to run
over a certain amount of time. -
4:37 - 4:40For this analysis we're doing,
-
4:40 - 4:44we just wanna find what's
called an operating point. -
4:44 - 4:47And it's over here, DC bias point.
-
4:47 - 4:53And it tells you how the syntax for
that, all it requires is this .op. -
4:53 - 4:57So if you wanted to do transient for
example, the syntax for that is .tran, and -
4:57 - 5:01then you have to enter all these options,
whatever options you want. -
5:01 - 5:02So time to stop.
-
5:02 - 5:06So how much time do you
want it to run for? -
5:06 - 5:09Let's say we want it to run for
one second. -
5:09 - 5:12And that's really all,
all the rest of these are options. -
5:12 - 5:16You can add all these extra
things in here as options. -
5:16 - 5:18So I can run this for one second.
-
5:18 - 5:22But I don't need a transient on this
because it's just going to be boring, -
5:22 - 5:23nothing going on.
-
5:23 - 5:27But I do want to find the point at
which I'm trying to find the value, -
5:27 - 5:29the operating point it's called.
-
5:29 - 5:32For this particular, I'll show you
another option when we get to it. -
5:32 - 5:36So this is called the spice directive,
-
5:36 - 5:41just place that in there and
this will run [COUGH]. -
5:41 - 5:47And Mac, for some reason
maximizes these when I run them. -
5:47 - 5:53It does the same thing with MatLab for
some reason, on figures. -
5:53 - 5:55So there's nothing going on, right?
-
5:55 - 5:56Doesn't look like it.
-
5:56 - 6:00So when you go over, hover over
your circuit, you can put a probe. -
6:00 - 6:05And notice up here on the top it
tells you where that location is. -
6:05 - 6:10So you're measuring voltage at node 002.
-
6:10 - 6:16N is not node, in fact, it's net,
so these are all called nets. -
6:16 - 6:19So this is net 001.
-
6:19 - 6:21So this is a voltage probe,
-
6:21 - 6:26which means you're measuring the voltage
at this location with respect to ground. -
6:26 - 6:27Any time you see one probe,
-
6:27 - 6:31it's always with respect to
the common of your entire circuit. -
6:32 - 6:34So also, you see this?
-
6:34 - 6:38This is an ammeter and
it gives you the arrow here. -
6:38 - 6:42It's telling you that it's measuring the
current going through the resistor down -
6:42 - 6:44towards the ground.
-
6:44 - 6:45And we can see this.
-
6:45 - 6:49That's also the same direction,
same direction, same direction, and -
6:49 - 6:53sometimes you'll notice that when
it doesn't give you the arrow, -
6:53 - 6:56it's actually measuring into the device.
-
6:56 - 6:58So if it didn't give you the arrow here,
-
6:58 - 7:03then it would actually be measuring
the current into the resistor. -
7:03 - 7:07So it would be opposite of this
arrow as it sees right here. -
7:07 - 7:08So let's measure the voltage right here.
-
7:10 - 7:12Here you go.
-
7:12 - 7:17So it's five volts and we didn't give
it any directive for the x axis so -
7:17 - 7:23it's just arbitrarily showing it
going on for the whole, whatever. -
7:25 - 7:29So that's it for
how you do an analysis for -
7:29 - 7:33just a DC operating point, it's called.
-
7:33 - 7:38Now what if we wanted to sweep through
different values of resistances here? -
7:38 - 7:44So make sure you're hovered
over this one to get rid of it. -
7:44 - 7:47So I wanna get rid of this, actually I
can just delete that in a minute here. -
7:47 - 7:50I just right-click on
this to change this guy. -
7:50 - 7:53So now I wanna sweep through this, so
-
7:53 - 7:56I'll have to create a variable
which is in curly braces. -
7:56 - 7:59You give that value in curly braces, and
-
7:59 - 8:02then you can call it later
in your Spice directive. -
8:02 - 8:04So I think I can just right-click on this,
yeah. -
8:04 - 8:10So I can actually, Let's see.
-
8:10 - 8:14Ctrl + Return gets me to a new line.
-
8:14 - 8:16So let's say I wanna do this.
-
8:16 - 8:19This line here I want to do a sweep.
-
8:19 - 8:20And it's not in the analysis.
-
8:20 - 8:24It's up here in this step.
-
8:24 - 8:26Step, sweep same thing.
-
8:26 - 8:31So name of parameter to
sweep is gonna be R. -
8:31 - 8:35[COUGH] Nature of sweep let's just do,
-
8:39 - 8:43Decade is every multiple of 10.
-
8:43 - 8:50Start value let's start at .1 And
let's stop at 100K. -
8:50 - 8:54Number of points per decade,
10 sounds reasonable. -
8:54 - 8:59And it's showing you how you would
type this directive here if you didn't -
8:59 - 9:00use this tool.
-
9:00 - 9:03So I could have just typed this out.
-
9:03 - 9:11Okay, and
it got rid of my other directive. -
9:11 - 9:12So let's see if I can.
-
9:15 - 9:20[COUGH] Actually, I'm not even
sure if I need that .LP anymore. -
9:20 - 9:22Let's try this.
-
9:22 - 9:23No analysis command, right?
-
9:23 - 9:24So you have to do an operate.
-
9:24 - 9:26You have to do some sort of analysis.
-
9:26 - 9:31This is just telling you what
sort of parameterization do do. -
9:31 - 9:36But it doesn't give you
the analysis direction. -
9:36 - 9:40So you have to do this dot op for
this particular type. -
9:40 - 9:40There is no need.
-
9:40 - 9:45I don't think there is
any need in doing a time. -
9:45 - 9:46Let's see if it works.
-
9:50 - 9:54So you can actually add traces here.
-
9:54 - 9:57It tells you what all
the possible values are. -
9:57 - 10:04And if I remember right,
it was Vn002, right? -
10:04 - 10:08So you look at the the x-axis here,
-
10:08 - 10:14it's sweeping between 0.1
kiloohm to 100 kiloohm. -
10:14 - 10:18And then you can see that the voltage at
that node is gradually increasing as we -
10:18 - 10:20swoop through that resistor.
-
10:23 - 10:28So what if we wanted to adjust both
these resistors at the same time, -
10:28 - 10:31complementarity to each other?
-
10:31 - 10:35So in other words,
as this one sweeps through values -
10:35 - 10:40going from almost 0,
which I didn't do 0 here, -
10:40 - 10:45because, Spice complains for
doing zero resistances. -
10:45 - 10:48You have to just choose
something really small. -
10:48 - 10:52So if we want to sweep this one
the same as it's sweeping now, but -
10:52 - 10:54we want to sweep this
one complementing that. -
10:54 - 10:56So this one increases.
-
10:56 - 10:58R2 increases, while R1 decreases.
-
10:58 - 11:02But so that the sum of
the two is always the same. -
11:02 - 11:04That's called a potentiometer.
-
11:04 - 11:12So, I've got a potentiometer made,
-
11:12 - 11:18unfortunately it's not
included in the Spice library, -
11:18 - 11:25so before I can use it I have to
know where to put those models. -
11:25 - 11:29But you guys just go to Canvas and
download the model for the plot. -
11:29 - 11:33And you have to know where to put
the model for Spice to find it. -
11:33 - 11:38And it's not straightforward,
cuz you don't want to put it in Spice's -
11:38 - 11:42library cuz otherwise when you
go update Spice's library, -
11:42 - 11:46then it doesn't know that the plot exists,
it just erases it. -
11:46 - 11:51So the easiest way to do
this is just to save. -
11:51 - 11:54And then,
just keep track of where it saves to. -
11:54 - 11:59See, this saves to Documents,
-
11:59 - 12:04this is My Documents folder, LTspice.
-
12:04 - 12:09So LTspice actually creates
this extra folder for you. -
12:09 - 12:13And notice down here I already had the
part here cuz I already knew where it went -
12:13 - 12:15but you wouldn't have known this.
-
12:15 - 12:22So test circ, so you just need to
keep track of where that is so -
12:22 - 12:26you can go place those items in there.
-
12:26 - 12:31And if we can look at that again,
I'll show you what those items mean. -
12:31 - 12:38So this plot.asy, that a symbol that
just describes what it looks like. -
12:38 - 12:40And then this asc, that's a circuit.
-
12:43 - 12:46So I'll show you what they
look like in a second here. -
12:46 - 12:49So if we want to place that component now,
-
12:49 - 12:53now we have those
components available here. -
12:53 - 12:56So place the pot.
-
12:59 - 13:02Escape wire is F3,
-
13:07 - 13:12And in order to be able to probe this
center off, I have to put a wire. -
13:12 - 13:15It doesn't probe directly to that pin.
-
13:15 - 13:18So now I can go up here.
-
13:18 - 13:19I right-click on this and
-
13:19 - 13:24it gives me the default values
that I have programmed into this. -
13:24 - 13:28This particular model, I've programmed
the default values into it. -
13:28 - 13:35But in order to sweep, we're gonna
want to sweep these values, and -
13:35 - 13:42this val parameter changes the percentage
of the bottom relative to the top. -
13:42 - 13:46So you can call this anything,
but I'm calling it slider. -
13:46 - 13:50And then you can change this as
well to whatever value you need. -
13:50 - 13:54And let's open the schematic.
-
13:54 - 13:57So this is what I drew
just using two resistors. -
13:57 - 14:03And then I set these R23 and
R13 as parameters that are, -
14:03 - 14:11these are just Spice directives that
determine how this model functions. -
14:11 - 14:16And you can see that R13 is equal to
some minimal value, so I never hit 0. -
14:16 - 14:21Plus, these values that are variables.
-
14:21 - 14:25And it gets kinda confusing because
these ones have to be in braces, but -
14:25 - 14:29these ones can't be in braces because
this is a mathematical operation here. -
14:29 - 14:35So this directive on the bottom is saying
some percentage of the total R, right? -
14:35 - 14:41So this val has to be 0 to 100, so
that it gives you some percentage. -
14:41 - 14:44And then this is one minus that.
-
14:44 - 14:47So you're always getting something
between 0 to 1 multiplied by this R. -
14:50 - 14:55So that's the circuit schematic.
-
14:55 - 14:56And that's what gives it.
-
14:56 - 14:59And there's also the symbol.
-
14:59 - 15:03And the symbol is just a drawing.
-
15:03 - 15:07[COUGH] And there's no directives,
-
15:07 - 15:12I created this instance name so you knew
what the name was when you created it. -
15:12 - 15:14See, this name is X1.
-
15:18 - 15:22Okay, so I've created the step perimeter,
-
15:22 - 15:28I've called it slider, so
let's change this to the slider. -
15:30 - 15:36And we're gonna step slider,
-
15:38 - 15:43Through 0 to 100 in
-
15:43 - 15:47increments of 10.
-
15:50 - 15:54And then Ctrl +
-
15:54 - 15:59Enter .OP..
-
15:59 - 16:00Okay let's see if that works.
-
16:02 - 16:08And we wanna see that
center voltage again. -
16:08 - 16:13Let's go,
somehow it didn't actually save this. -
16:16 - 16:19Okay, let's do that again.
-
16:19 - 16:22Okay now it's working.
-
16:22 - 16:28Okay let's step through 10 increments
from 0 and went 0, 10, 20, 30, 40, so on. -
16:28 - 16:32And it's measuring the voltage here so you
can see that that voltage is increasing as -
16:32 - 16:35we're increasing the bottom
resistor relative to the top. -
16:35 - 16:39And it goes all the way from 0
to 10 volts now instead of 5. -
16:39 - 16:43So there's numerous different directives
that you can use but don't get buried and -
16:43 - 16:44doing the directives.
-
16:44 - 16:51This first semester is not for spending
too much time on directives, just minimal. -
16:51 - 16:54There's just gonna be a minimal subset.
-
16:54 - 17:01But you can,
you can see what those directors mean, -
17:01 - 17:05that view Spice net list, so
-
17:05 - 17:10this is the description of that circuit,
-
17:10 - 17:14in code, this is spice code.
-
17:14 - 17:21So its saying that there was a sub-circuit
within this guy, that is this R1, R2. -
17:21 - 17:26That's the circuit within here,
-
17:26 - 17:29you have, okay.
-
17:29 - 17:35So this is the value of using this
particular software is that you're gonna -
17:35 - 17:41be introduced to doing these types
of things which is what you really -
17:41 - 17:47need to learn going on with your education
if you're gonna do anything in circuits. -
17:47 - 17:50This has taken plenty of time though.
- Title:
- LTSpice intro - potentiometer, voltage divider and resistance sweeps
- Description:
-
Introduction to LTSpice for absolute beginners.
DC voltage division with resistor sweep.
Very simple potentiometer sweep through complementary resistances.
Applicable for Mac and Windows, but shown on OSX to demonstrate LTSpice quirks on a Mac.
Contents:
1- Download and install (0:08)
2- Add grid dots (1:02)
3- New circuit schematic, draw wires [F3] (1:25)
4- Insert component [F2] (1:48)
5- How to GND (2:35)
6- Enter values (3:03)
7- Include internal source resistance (3:11)
8- How to simulate circuit (3:45)
9- Using voltmeter and ammeter probes (5:56)
10- Variable sweep analysis, v-divider (7:32)
11- Viewing output by adding trace (9:51)
12- Inserting and sweeping a potentiometer (10:25)
13- Sweep resistor values in pot (13:15)
14- Looking inside the pot (13:52) - Video Language:
- English
- Duration:
- 17:51