Created by
Created October 30, 2012
Last modified November 02, 2012
Tags behavioural-resistor  

Summary

A behavioural resistor where the resistance is programmable by the voltage on the 'resistance' net.

A 1.5k resistor is shown for reference.

Same as behavioural resistor 01 but using a signle behavioural current source.


Description

A behavioural resistor where the resistance is programmable by the voltage on the 'resistance' net. A 1.5k resistor is shown for reference.

The function is implemented using the rearrangement of Ohms Law from: R = V/I to I = V/R to set the current in the behavioural current source, I_Resistor1.

The basic expression is: (V(x)-V(y))/V(resistance) but a limit() function is used to prevent the resistor value ever reaching zero, which may cause problems in some simulations.

Changing the expression to (V(x)-V(y))/limit(I(R2.nA), 1u, 1T) would allow the resistance to be programmed by the current in R2.

The expression can be scaled. For example:

(V(x)-V(y))/limit(1k*V(resistance), 1u, 1T)

would produce a 1k resistor with a V(resistance) of 1V rather than 1kV.

V3 and V4 are only there to isolate the x and y net labels from other net names.

BEWARE! A negative value of control parameter will produce a negative resistance. Adding an ABS() function will prevent this:

(V(x)-V(y))/limit(ABS(V(resistance)), 1u, 1T)

For more see: SPICE Analog Behavioral Modeling of Variable Passives by Christophe Basso http://powerelectronics.com/mag/power_spice_analog_behavioral/

SImulate > DC Sweep > Run DC Sweep


Comments

No comments yet. Be the first!

Leave a Comment

Please sign in or create an account to comment.

Revision History

Only the circuit's creator can access stored revision history.