LTspice Potentiometer

how to create a variable resistor whose resistance could be changed in an arbitrary way, say sine wave, square wave and etc. Thanks.

Here's an example. Let's say you want a resistor to vary its resistance sinusoidally between 500 ohms and 1500 ohms at a frequency of 1 Hz. All you do is add a resistor to the schematic as you would do normally but instead of specifying the resistor with a fixed value use this function instead:

R=1000+500*SIN(2*PI*TIME)

Look for .PARAM in the help topics for more functions you could try.

I tried
.param RN=10+sin(400k*pi*time)
and I defined the value of the R1 is RN
the simulation shows warning that
"can't solve .param RN=10+sin(400k*pi*time)"


also I tried to set the resistor value directly as

sin(400k*pi*time)
then it react as"can not find the definition of model sin"

------------------------------------------------------------------------

For a resistance value, use a variable name enclosed in
curly braces (to solve the variable before each run), e.g.
{RV}. Then add a parameter step command to the schematic,
e.g. .step param RV 1 10k 1k
using the Edit, Spice directive menus.

To make a potentiometer, define the values the two halves of
the pot (on each side of the wiper) with a position formula
in curly braces), e.g. {1+Rtotal*position} and
{1+Rtotal*(1-position)}.

Then add a parameter to define Rtotal,
..param Rtotal=10k
and a step command for the position,
..step param position 0 1 .1

The extra ohm in the formulas prevents the section
resistance from reaching zero ohms which blows the math up,
and sort of represents the wiper resistance.

If you want to run single position runs, add a position
parameter definition
..param position=.5
and comment out the step position by right clicking on the
command and clicking the comment button.

Later you can comment out the position parameter and
uncomment the position step command, if needed.

------------------------------------------------------------------------



Credit :
http://www.edaboard.com/ftopic265765.html
http://www.electronicspoint.com/ltspice-t102411.html
http://forum.allaboutcircuits.com/showthread.php?t=24018

Contact

Talk to us

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores iusto fugit esse soluta quae debitis quibusdam harum voluptatem, maxime, aliquam sequi. Tempora ipsum magni unde velit corporis fuga, necessitatibus blanditiis.

Address:

9983 City name, Street name, 232 Apartment C

Work Time:

Monday - Friday from 9am to 5pm

Phone:

595 12 34 567