1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

LTspice: plot of basic L circuit

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

  1. mikewax

    mikewax Member

    Joined:
    Nov 6, 2016
    Messages:
    49
    Likes:
    2
    Location:
    los angeles
    :sorry: 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
    test.png
     
  2. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    8,978
    Likes:
    1,189
    Location:
    Cardiff, Wales
    Welcome to ETO!
    Add some resistance in series with the inductor. 1000A is a tad unrealistic!
     
    • Like Like x 1
  3. mikewax

    mikewax Member

    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>
    n thanx for answering
     
    Last edited: Nov 6, 2016
  4. dave

    Dave New Member

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


     
  5. mikewax

    mikewax Member

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

    here's another one, it's awesome.
    test2.png
     

    Attached Files:

  6. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    6,837
    Likes:
    901
    Location:
    Loveland, CO USA
    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.
    upload_2016-11-6_17-34-31.png
     

    Attached Files:

  7. mikewax

    mikewax Member

    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. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    6,837
    Likes:
    901
    Location:
    Loveland, CO USA
    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. mikewax

    mikewax Member

    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. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    6,837
    Likes:
    901
    Location:
    Loveland, CO USA
    .
    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 Like x 1
  11. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    6,837
    Likes:
    901
    Location:
    Loveland, CO USA
    Welcome Mike,
    Please fill in you location. It helps up know more. If some one is helpful push their like button.
    thanks.
     
    • Like Like x 1
  12. mikewax

    mikewax Member

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

    Ratchit Well-Known Member

    Joined:
    Mar 12, 2008
    Messages:
    1,895
    Likes:
    70
    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 Thanks x 1
  14. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    6,837
    Likes:
    901
    Location:
    Loveland, CO USA
    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 Like x 1
  15. Ratchit

    Ratchit Well-Known Member

    Joined:
    Mar 12, 2008
    Messages:
    1,895
    Likes:
    70
    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 Like x 1
  16. mikewax

    mikewax Member

    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. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,311
    Likes:
    432
    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, upload_2016-11-7_0-4-27.png , in the Simulation Command.
    The results then are:

    upload_2016-11-7_0-10-56.png
     
    • Informative Informative x 1
  18. Ratchit

    Ratchit Well-Known Member

    Joined:
    Mar 12, 2008
    Messages:
    1,895
    Likes:
    70
    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 Like x 1
  19. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    6,837
    Likes:
    901
    Location:
    Loveland, CO USA
    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.

    Points to think about:
    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 Thanks x 1
  20. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    10,796
    Likes:
    516
    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...

    InitialIndCur.jpg
     
    • Informative Informative x 1
  21. mikewax

    mikewax Member

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

Share This Page