Discussion in 'General Electronics Chat' started by Bassalisk, Mar 10, 2012.
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.
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.
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 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.
So in a nutshell I want to see how will my voltage across capacitor look like.
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.
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.
Thank you! I got something to work with now!
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).