# LTspice: plot of basic L circuit

Discussion in 'Homework Help' started by mikewax, Nov 6, 2016.

1. ### mikewaxMember

Joined:
Nov 6, 2016
Messages:
49
Likes:
2
Location:
los angeles
hi i'm tracing the current through a 1uH inductor but it looks like the trace of a 1mOhm resistor. can someone tell me what i'm doing wrong?
thanx, mike

2. ### alec_tWell-Known MemberMost Helpful Member

Joined:
Jul 10, 2011
Messages:
9,291
Likes:
1,223
Location:
Cardiff, Wales
Welcome to ETO!
Add some resistance in series with the inductor. 1000A is a tad unrealistic!

• Like x 1
3. ### mikewaxMember

Joined:
Nov 6, 2016
Messages:
49
Likes:
2
Location:
los angeles
but even an ideal inductor is supposed to have inductance, right? like VL = di/dt there's supposed to be some opposition so i don't get how it arrives at the 1kA number. <edit>and it STARTS at 1kA. i backed up the time scale to ns, to ps. it's starting at that value</edit>

Last edited: Nov 6, 2016

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### mikewaxMember

Joined:
Nov 6, 2016
Messages:
49
Likes:
2
Location:
los angeles

here's another one, it's awesome.

File size:
422 bytes
Views:
73
6. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,314
Likes:
970
Location:
Loveland, CO USA
ONLINE
Changed 1F cap to 1uF.
Changed your voltage source from a battery to a pulse source.

"Initial condition" is one of the problems. The program saw the voltage on C1 was going to charge to 5V so it started out with the voltage at 5V.
By using a pulse source, I started out with 0V, at time zero moved to 5V, then at time 10mS moved back to 0V.

File size:
449 bytes
Views:
50
7. ### mikewaxMember

Joined:
Nov 6, 2016
Messages:
49
Likes:
2
Location:
los angeles
i don't understand. voltage V1 is supposed to start at 5 and the voltage at Vcap is supposed to start at 0. so spice is just not plotting what i'm telling it to plot. but when you change the voltage source to Pulse, then it interprets the circuit at face value and plots it correctly. WTF?

8. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,314
Likes:
970
Location:
Loveland, CO USA
ONLINE
No.

If this was true then a simple amplifier circuit will need time to "stabilize" before you can look at it. (example the capacitors on the power supply) What spice does is try to determine a steady state for your circuit. In your case it will start out with 5V on the cap.

What I did was to make a voltage source that goes 0,5,0 volts. (note the first 0 is for time before "o")

9. ### mikewaxMember

Joined:
Nov 6, 2016
Messages:
49
Likes:
2
Location:
los angeles
ok Ron thanx. so it's making an assumption about what i want to see. but with a 1F cap, that's QUITE an assumption.
the first zero is the initial voltage?
is there a more direct way to specify initial condition?

10. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,314
Likes:
970
Location:
Loveland, CO USA
ONLINE
.
I have not used this in a while but I think if you have this on the schematic somewhere:
.ic V(C1)=0 the voltage on C1 will start out at 0 volts.
.ic I(L1)=300m the current on L1 will start out with 0.3A. (watch out you might need -0.3 not +0.3 depending on how you connected to L1)

• Like x 1
11. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,314
Likes:
970
Location:
Loveland, CO USA
ONLINE
Welcome Mike,
Please fill in you location. It helps up know more. If some one is helpful push their like button.
thanks.

• Like x 1
12. ### mikewaxMember

Joined:
Nov 6, 2016
Messages:
49
Likes:
2
Location:
los angeles
OK that's just what i need. THANX and will do.
mike

• Like x 1
13. ### RatchitWell-Known Member

Joined:
Mar 12, 2008
Messages:
1,948
Likes:
83
No resistance, no problem with calculating the current. The current for no resistance is Vo*t/L , where Vo is a step function. The curve a straight line starting from zero and goes as high as you can name if the voltage source can supply it, and you wait long enough. Notice that as L becomes smaller and smaller, the given formula produces output current values that are similiar to a dead short.

Ratch

• Thanks x 1
14. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,314
Likes:
970
Location:
Loveland, CO USA
ONLINE
In LT Spice the voltage source has a place to add a resistance. Right click on voltage source, "series resistance". If not filled in there is a default value.
Same thing for inductors. "series resistance" For real parts, there is a resistance of the wire.

In the real world, a car battery and wire might have 0.01 ohms. (don't really know) and a inductor might have 0.5 ohms. In the real world, when the current hits 24 amps the wire burns out. You don't really reach 1000 amps.

• Like x 1
15. ### RatchitWell-Known Member

Joined:
Mar 12, 2008
Messages:
1,948
Likes:
83
Perhaps so, but I was calculating the current equation for a nonexistent inductor with no resistance, and energized with a step voltage. That appears to be what was wanted in post #1.

Ratch

• Like x 1
16. ### mikewaxMember

Joined:
Nov 6, 2016
Messages:
49
Likes:
2
Location:
los angeles
yes it was, just to see how long to saturate an L of 4.7uH so i could make a buck circuit. but why would i need a step voltage function i don't get it.

17. ### crutschowWell-Known MemberMost Helpful Member

Joined:
Mar 14, 2008
Messages:
10,613
Likes:
478
Location:
L.A., USA Zulu -8
You need a step function because Spice normally calculates the steady-state DC bias conditions before it does the transient response.
To prevent that you can start the simulation without that calculation by using the uic, , in the Simulation Command.
The results then are:

• Informative x 1
18. ### RatchitWell-Known Member

Joined:
Mar 12, 2008
Messages:
1,948
Likes:
83
Well, you have to have some kind of voltage curve don't you? A common step function is what you get when you switch on DC. If you want me to calculate a pulse, square, triangle, or whatever, then specify what you need.

Ratch

• Like x 1
19. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,314
Likes:
970
Location:
Loveland, CO USA
ONLINE
A 4.7hH "spice" coil will never saturate. It is not a real world coil.
A 4.7hH "spice" coil could have 0 ohms. Spice tries not to allow that because we get into infinity. (1/0, and other numbers)

Back in post #1 you connected a 1V source to a 0 ohm coil. (the voltage source has a default 0.001 ohm internal resistance) so the current went to 1000A. Then two minutes later you want to measure the current and are unhappy about the 1000A. If you did this in the real world; solder a coil across a car battery and it burns out long before you can get to the current meter. The battery probably mostly discharged.

1) When you hit "run" time has gone by. Before you hit run all the caps have charged up and the coils reached some current level.
2) Hitting run puts a meter into your circuit. (scope probe) The circuit was alive before and has come to a steady-state DC bias conditions.
3) Saturation is a function of the coil's core material, size, etc. You have not put any of that into spice.
4) Spice is not like the real world much like video games are not real. (shocking thought) To get close to real; you need to enter more information and understand limitations.

I hope you are not unhappy with me, but you just started with this program and it is hard at first. I know you want to make a buck PWM. I can help with that. (most of us will help) Please tell us what you want made. If you have a circuit up and working, then you can make changes and see what happens. I think we need to get past this "getting started" problem and jump into seeing something working.

• Thanks x 1
20. ### MikeMlWell-Known MemberMost Helpful Member

Joined:
Mar 17, 2009
Messages:
11,104
Likes:
563
Location:
AZ 86334
Further expanding on Zappers posting: Here are four different ways to do this. 31a and 3b are the preferred ways. 3 and 3a frequently have undesired consequences...

• Informative x 1
21. ### mikewaxMember

Joined:
Nov 6, 2016
Messages:
49
Likes:
2
Location:
los angeles
THANK YOU i didn't know what the initial operating point solution was