User Tools

Site Tools


ltspice:variable_resistor

Variable resistor

Stan Zurek, Variable resistor, Encyclopedia Magnetica, E-Magnetica.pl
Go to: LTspice.

The Arbitrary Behavioral Current Source in LTspice can be used to simulate time-variable resistor in transient simulations.

Method 1 (proportional resistance)

The steps are:

1. Connect a voltage source to ground and label its other end for example as “var”. Set the voltage waveform/pulse such that its value in volts corresponds directly to the desired variable resistance in ohms (e.g. “50 V” will correspond to “50 Ω”).

2. In value of the variable resistor enter:

R = V(var)

such that the name “var” represents the node name from step 1.

Variable resistance: green curve shows an example of sinusoidal supply voltage, blue is the resultant current, red is the function by which the load current is scaled, namely V(var). Resistance is directly proportional to the variable voltage.
→ → →
Helpful page? Support us!
→ → →
PayPal
← ← ←
Help us with just $0.10 per month? Come on… ;-)
← ← ←

Method 2 (proportional current)

The steps are:

1. Label the node(s) the variable resistor is going to be connected between.

2. Use “Arbitrary Behavioral Current Source (bi)” and put it between the labelled nodes. If the resistor is connected to ground then only one node needs to be labelled (e.g. “test”).

3. Create a new voltage source connected somewhere to ground, and label its voltage output (e.g. “VAR”). The shape of this voltage source will determine how the resistance changes - this can be set to be a pulse, sine with offset, piece-wise linear (PWL) etc. Set the shape of this voltage source to vary between zero (infinite resistance, zero current) to unity (resistance equal to the value “LOAD”, see next point).

4. Add directive “.param LOAD 100” where “LOAD” represents a variable and “100” is the minimum value of resistance.

5. Edit the function of the Behavioral Current Source to be:

I=V(VAR)*V(test)/LOAD

This will set the current to vary anywhere between zero (if V(VAR)=0 then resistance = infinity), scaled to the real voltage “V(test)” and the value of LOAD (if V(VAR)=1 then resistance = LOAD). If the variable resistor is placed between two labelled nodes then a voltage difference between these nodes needs to be calculated in the equation.

Variable resistance: green curve shows an example of sinusoidal supply voltage, blue is the resultant current, red is the function by which the load current is scaled, namely V(VAR). Resistance is proportional to the inverse of the current.

Method 3 (proportional resistance)

The steps are:

1. Label the node(s) the variable resistor is going to be connected between.

2. Use “Arbitrary Behavioral Current Source (bi)” and put it between the labelled nodes. If the resistor is connected to ground then only one node needs to be labelled (e.g. “test”).

3. Create a new voltage source connected somewhere to ground, and label its voltage output (e.g. “VAR”). The shape of this voltage source will determine how the resistance changes - this can be set to be a pulse, sine with offset, piece-wise linear (PWL) etc. Set the shape of this voltage source to vary between any positive values (zero and negative values are not allowed). For “infinitely high” resistance use very high value, for example “1G” (1 giga) as the amplitude. For “infinitely low” resistance use a very low value, for example “1f” (1 femto).

4. Edit the function of the Behavioral Current Source to be:

I=V(test)/V(VAR)

This will set the resistance to be directly proportional to the V(VAR) voltage. If the variable resistor is placed between two labelled nodes then a voltage difference between these nodes needs to be calculated in the equation.

Variable resistance: green curve shows an example of sinusoidal supply voltage, blue is the resultant current, red is the function by which the load resistance is scaled, namely V(VAR).

Method 4 (operating point)

This method is applicable only in the operating point simulation (.op) not transient (.tran).

The steps are:

1. Add a directive:

.step param Rvar list 1 2 3 4 5 10

where “Rvar” denotes a variable resistance.

2. In the given resistor enter the value of resistance as “{Rvar}” (with curly brackets).

3. Run the simulation in the .op mode (operating point). When plotting currents and voltages, they will be plotted with the Rvar in the horizontal axis of the graphs.

Variable resistance in “.op” mode: green curve shows the supply voltage, blue is the resultant current.
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
ltspice/variable_resistor.txt · Last modified: 2023/06/17 22:22 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki
Legal disclaimer: Information provided here is only for educational purposes. Accuracy is not guaranteed or implied. In no event the providers can be held liable to any party for direct, indirect, special, incidental, or consequential damages arising out of the use of this data.

For information on the cookies used on this site refer to Privacy policy and Cookies.