07-18-2013 11:54 AM
hello,
I'm trying to build this customized block. it has a bunch of fixed value elements (2 resistors and 2 capacitors) and a current source. the current source needs to have a value that's based on a conditional expression expression:
Id = something; for Vgs < something, Vds < something
something else; for Vgs < something, Vds > something
something else; for Vgs > something
I have the equations and I have all of the parameters, but I have no idea how to implement the conditional statements for the current source. I'm not even sure where to start. thank you very much for any help.
r.
07-18-2013 12:29 PM
rob_xx17,
These are Analog Behavioral Model sources, for current, ABM_Current, and also ABM_Voltage for voltage. They are very useful to set up a series of conditions (relative to other values within the circuit) to generate appropriate controlled current and voltages.
The ABM sources can be found in Master Database -> Sources -> CONTROLLED_CURRENT_SOURCES (or CONTROLLED_VOLTAGE_SOURCES).
Here is an example of using them with a nested if/then conditional.
In this example I1 is depended on the voltage at net(1) - which is simply V1.
So in this example, for I1 you have 3 states (dependent on V1):
a) V1 > 4V, I1 = 1 (Amp)
b) V1 <= 2.5V, I1 = 0 (Amp)
c) V1 greater than 2.5V and 4V or less (inclusive), I1 = 0.1 * V1 (Amp)
Here is a look at the behavior of I1 as V1 varies from 0 - 5V and back from 5 to 0....
To specify a single ended voltage referenced to ground net(0), you just specify V(netname).
To specify a differential voltage, you would state V(net, net2)...
Regards,
Pat Noonan
National Instruments