LTSpice IV help with variable resistor

Thread Starter

Bassalisk

Joined Jul 12, 2011
8
So I am newbie with LTspice and I need some help.

I am trying to simulate variable resistor, like photoresistor.

The key here is that the flux is changing with some law.

That law is a sine wave.

So we have a light source that changes it flux with the following law:

\( \Phi (t)=\Phi _0 (1+sin(\omega t+\phi ))\)

And the resistor value is determined by:
\( R=R_0 e^{-A\Phi } \)

I want to make such resistor in LTSpice, that is changing resistance in given law, with given flux. But I am unfamiliar with the functions in LTSpice and their parameters.

So I want to write function
\( R=R_0 e^{-A\Phi _0 (1+sin(\omega t+\phi )) } \)

And I want to see voltage across it in time. Say like 10 sec.(I will adjust the frequency of the sine later)
 

SgtWookie

Joined Jul 17, 2007
22,230
Instead of trying to create a variable resistor, use a voltage source. It's easy to vary a voltage during a simulation. I don't know a good, straightforward method to change a resistance during a run.
 

Thread Starter

Bassalisk

Joined Jul 12, 2011
8
Instead of trying to create a variable resistor, use a voltage source. It's easy to vary a voltage during a simulation. I don't know a good, straightforward method to change a resistance during a run.
Hmm but will I get the same results?

I attached my circuit.

I am trying to see what form of voltage across capacitor will I get, if my resistance changes with the law I described.

I cannot solve this analytically because, you get some unsolvable integrals and you need to transform them into infinite series etc.

And by all means I am not doing that :D

So in a nutshell I want to see how will my voltage across capacitor look like.

Input voltage is constant and equals some value E
 

Attachments

ifixit

Joined Nov 20, 2008
652
Hi Bassalisk,

Here is an LT spice example of how you can have a circuit resistance vary with time during a transient analysis. IE a voltage dependent resistor. LTspice has no knowlwedge of light flux so you have to arbitrarily assign a voltage to represent a light flux level.

When you assign a value to a resistance use this form:
R=V(node reference)* (a formula of your choice).

The voltage you reference will be your light flux value represented as a voltage.

The formula of your choice can contain functions referenced in the LTspice Help for the; Arbitrary behavioral voltage (BV) circuit element. Be careful that R2 doesn't ever equal zero because a zero ohm resistor is not allowed in LTspice. Apparently, negative resistances are allowed so to keep photocell resistances realistic & positive you can add an offset to your formula.

Math sometimes makes my head hurt, so you'll have to put your own formula in place of my simple sin function.:)

Good Luck & have fun with it,
Ifixit
 

Attachments

Thread Starter

Bassalisk

Joined Jul 12, 2011
8
Hi Bassalisk,

Here is an LT spice example of how you can have a circuit resistance vary with time during a transient analysis. IE a voltage dependent resistor. LTspice has no knowlwedge of light flux so you have to arbitrarily assign a voltage to represent a light flux level.

When you assign a value to a resistance use this form:
R=V(node reference)* (a formula of your choice).

The voltage you reference will be your light flux value represented as a voltage.

The formula of your choice can contain functions referenced in the LTspice Help for the; Arbitrary behavioral voltage (BV) circuit element. Be careful that R2 doesn't ever equal zero because a zero ohm resistor is not allowed in LTspice. Apparently, negative resistances are allowed so to keep photocell resistances realistic & positive you can add an offset to your formula.

Math sometimes makes my head hurt, so you'll have to put your own formula in place of my simple sin function.:)

Good Luck & have fun with it,
Ifixit
Thank you! I got something to work with now!
 

crutschow

Joined Mar 14, 2008
34,280
Here is an LT spice example of how you can have a circuit resistance vary with time during a transient analysis. IE a voltage dependent resistor. LTspice has no knowlwedge of light flux so you have to arbitrarily assign a voltage to represent a light flux level.

When you assign a value to a resistance use this form:
R=V(node reference)* (a formula of your choice).

The voltage you reference will be your light flux value represented as a voltage.

The formula of your choice can contain functions referenced in the LTspice Help for the; Arbitrary behavioral voltage (BV) circuit element. Be careful that R2 doesn't ever equal zero because a zero ohm resistor is not allowed in LTspice. Apparently, negative resistances are allowed so to keep photocell resistances realistic & positive you can add an offset to your formula.

Math sometimes makes my head hurt, so you'll have to put your own formula in place of my simple sin function.:)

Good Luck & have fun with it,
Ifixit
That's really cool. :) I often wondered how to model a variable resistor. I didn't realize you could use arbitrary variables for the resistor value, the same as the arbitrary behavioral voltage and current sources. Learned something really useful. Thanks.

Edit: A thought -- If you use two of these resistors in series and fed them both the same control signal but with one inverted, you could simulate a pot with the wiper moving up and down (one resistor value increases by the same amount the other is decreasing).
 
Last edited:
Top