Simple current limiter for LTSpice

  • Thread starter Thread starter tfr000
  • Start date Start date
  • Tags Tags
    Current Ltspice
AI Thread Summary
The discussion focuses on creating a simple current limiter in LTSpice that allows a voltage source to supply a maximum current, X, to a connected circuit. Users suggest using a voltage-dependent voltage source combined with a current-dependent voltage source to achieve this behavior, involving control amplifiers and clamping techniques. One proposed solution involves adding an ideal diode to the voltage source to limit current, while another suggests using an arbitrary behavioral voltage source to mathematically define the desired behavior. Participants share circuit designs and troubleshooting tips, highlighting the importance of proper configuration for successful simulations. Overall, the conversation emphasizes the need for effective methods to limit current in LTSpice simulations.
tfr000
Messages
205
Reaction score
21
Looking for a simple way to limit the current from a voltage source in LTSpice. Not a realistic or practical circuit, just something that will give me the behavior that I want. Hitting a total mental block with this, for some reason.

What I want is for the source to act normally until the connected circuit draws more than X current - at which point it supplies X current and no more. Like a lab power supply.
 
Engineering news on Phys.org
I am not an LTSpice user, so my help is only high level. I don't know of a simple way to do it.

1. Use a voltage dependent voltage source as the main source.
2. Monitor the current with a current dependent voltage source.
3. Reduce the source voltage (in 1 above) when the current sensed by 2 goes above a certain level. (requires a control amplifier with a reference reference and some sort of output clamping)
(note than an opamp is basically a voltage dependent voltage source with high gain)
Perhaps an Arbitrary behavioral voltage source could provide clamping in the control amp.

http://ltwiki.org/?title=B_sources_(complete_reference)

There is probably some neat trick to do this, but I don't know it. Spice has a table driven source that can supposedly do it, but I don't see it in LTSpice
 
Last edited:
Can you just use a simple transistor current limit circuit like this?

http://forums.parallax.com/uploads/attachments/58478/86715.gif
86715.gif
 
Good simple circuit.
Seems like there should be a cool way to build a simple version of that with ideal sources. Q1 as a VDVS and R/ Q2 as a CDVS.
 
Ok, so here's what I dreamed up...
In the first, a current-controlled voltage source (an "H" source) is tied to a typical small-resistance current sensor. This one can be adjusted in various ways by messing around with the various parameters, for instance, to get a "soft" current limit.
spice1.png


In the second, you get a hard current limit from an ideal current source, and a hard voltage limit from an ideal zener
spice2.png
 
The trick is very simple and effective, adding an ideal diode to any voltage source with the Ilimit parameter set (along with Ron=0 for perfect ideal behavior) will limit the current sourced to the specified value.
To also limit the current sink add another diode in parallel but reversed.
The diode model takes care of smoothing the discontinuity when switching between regions so that the simulation converges properly.
Capture.PNG
Capture1.PNG
 
  • Like
Likes the_emi_guy and meBigGuy
I have added a symbol and corresponding sub-circuit so that the current limiter device ilim can be selected from the components list and configured through the right click menu.

Schematic.PNG


Rename file ilim_asy.txt to ilim.asy and ilim_cir.txt to ilim.cir and drop in the directory where you store your local components (or the LTspice library dir) and make sure that directory can be selected from within the component window.
After adding the component, in the right click configuration pane along with the current limit, optional series resistance and fixed voltage drop can be also specified (just added some random V and R numbers here, R and V are zero for the plot showed below).

Attribute.PNG


I use these for instance to model AVR microntroller pins which are current limited at 40mA and with approximately 30Ω of (MOSFET) Ron.
The plot below shows the current limit in both directions in explicit action ...

Plot.PNG
 

Attachments

  • Like
Likes berkeman, Jony130, the_emi_guy and 1 other person
  • #10
Pasqo, that worked great for me. Thank you Sir!
 
  • #11
The way to do this in LTSpice is with an "arbitrary behavioral voltage source" (type in "behavioral" in LTSpice help/search).

This save you from having to design an actual circuit that creates this behavior (which may not be ideal). Instead, simply describe the behavior you want mathematically.

http://www.linear.com/solutions/6106
 
  • #12
the_emi_guy,

how do you do it then? i was playing around with bi and bv sources, but don't see any options to limit current.

Unless you know of some trick with one of ltspice's math functions, i think Pasqo's solution is quite elegant and the best.

Regards
 
  • #13
Thanks Pasqo!
 
  • #14
Erik Haverkamp said:
Thanks Pasqo!
Agreed! Great solution. My initial impression was that this could be done with bi, bv but I think I was wrong.
 
  • #15
How do I actually use this component?

I've just connected a capacitor to it and added the GND port.
However, all simulations show a flat line when I plot them.

Cheers Timur
 
  • #16
Welcome to PF.
timuryigit said:
I've just connected a capacitor to it and added the GND port.
Attach to a post your circuit.asc but add a .txt suffix to make circuit.asc.txt
We can then run your design and work out what is missing.
 
  • #18
Sorry guys beginner mistake the post from pasko from the Feb 17, 2016.
Has actually a circuit which I didn't not pay attention to. Anyway in the circuit I uploaded I did not have V source. Because I thought this is done by the Imilit source
 
  • #19
Hi,
I have developed a one-line current limited voltage source. It works in the NI Multisim SPICE environment which uses the SPICE 3:
Bx 1 2 V= { G * V(3, 4) * (Abs(I(Bx)) < Imax ? 1 : 1 - (Abs(I(Bx))/Imax - 1)/k) }
where

  • Bx the name of the new B-type component
  • 1, 2 the output pins
  • 3, 4 the input pins (it controls the voltage between 1 and 2)
  • G is the gain from V(3, 4) to V(1, 2)
  • Imax is the maximal output current (in Ampere)
  • k is a <1 factor which controls the degradation speed of output voltage over the Imax limit (e.g. k=0.2 means that between Imax and 1.2 * Imax the output voltage will linearly goes to zero)

I hope it will be useful for you.
 
  • Like
Likes berkeman
  • #20
I present you a Multsim simulation result of running a test circuit for the component above (the input and output signals are shifted down and up):
upload_2017-1-2_21-47-34.png
 
  • Like
Likes berkeman

Similar threads

Back
Top