Monday 10 October 2016

spice - Voltage dependent current source in LTSpice


I'm trying to simulate a voltage dependent current source in LTSpice and I need to have a limited output current. Here is the directive that I am using:


IOUT = LIMIT( K1 * V(1,0), 0.001, -0.001)

In my schematic, IOUT is a regular current source. In this case the current source has a transconductance equal to K1, and samples the voltage across nodes 1 and 0. (And limits the output current to 1mA.)



The weird thing is that my LTSpice directive works fine without the "V(1,0)"


IOUT = LIMIT( K1, 0.001, -0.001)

So does LTSpice not support the V() function or something? How am I supposed to simulate a voltage dependent current source with a limited output current?



Answer



Just use the G circuit element (voltage controlled current source) with a lookup table (LUT) specification:


enter image description here


Note: the capacitor C1 is there only to avoid an error because the simulator doesn't like node C to be floating.


This is the relevant section of the online help (emphasis mine):




G. Voltage Dependent Current Source Symbol Names: G, G2


There are three types of voltage dependent current-source circuit elements.


Syntax: Gxxx n+ n- nc+ nc-


This circuit element asserts an output current between the nodes n+ and n- that depends on the input voltage between nodes nc+ and nc-. This is a linearly dependent source specified solely by a constant gain.


Syntax: Gxxx n+ n- nc+ nc- table=(, , ...)


Here a lookup table is used to specify the transfer function. The table is a list of pairs of numbers. The second value of the pair is the output current when the control voltage is equal to the first value of that pair. The output is linearly interpolated when the control voltage is between specified points. If the control voltage is beyond the range of the look-up table, the output current is extrapolated as a constant current of the last point of the look-up table.



Here are the results of the simulation:


enter image description here


As you can see you only need to specify two points in the LUT if you just want a VCCS with an hard limiting characteristics, i.e. linear inside a given voltage range and fixed saturated limit out of that range.



No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...