Search This Blog

Saturday, September 25, 2010


Worked on SPICE simulation today/tonight. I found a symbol and simulation model for a log potentiometer (audio taper) online, and attempted to teach myself to implement it in LTSPICE.

Why?

Well, the project I'm putting together uses log-taper pots, as do many audio-related electronic devices. They do so because the human ear hears changes in sound levels as a logarithmic function of voltage.

Because this is an electronic project for a college level course, I figure I may try to do some college level work. Hence the simulation.

LTSPICE was not taking my ".inc" SPICE directive and pointing to the model, so I copied the .SUBCKT (sub circuit) model data into a new file of its own and pointed the schematic symbol to that data instead. It worked!

I have a 100k-ohm audio taper stepped attenuator that I measured for a reference of resistance values. The model is practical enough for simulation use.

For use as a volume control, the simulation model does not give any valuable data, however, used with equalizer circuits, which this project contains, it would be interesting to plot values of the frequency changes as a result of resistance change.

LTSPICE has a function that allows a parameter of a device to be tested at varying values. I have drawn up a simple voltage-divider network using a logarithmic potentiometer model and ploted the DC voltage levels as a function of rotation. Note that I haven't figured out how to define a time step sequence of value change events. All the DC values are displayed on the same graph, but you can see that the levels are indeed plotted in a non-linear pattern. Had a linear pot been used, the DC voltage variations between one another would have been exactly the same.






Here's the model data for the log pot that I found. Credit shown to the originator.

* A Collection of Potentiometers
* ==============================
* Helmut Sennewald,                          12/23/2003         V1.1
*
*       pot_plog         exp(k*(1-x))
*
*       1 ____    1.0=wiper  
*             | 
*            | |  3
*            | |<---- wiper 0..1
*            | |
*       Rtap | |  Tap
*            | |
*       2 ____|   0.0=wiper
*
*
*     RTOT = total resistance
*     WIPER = ratio of travel of the wiper
*     RTAP = reference resistance at wiper=Tap
*            It is needed only for pot_plog, pot_nlog and pot_pow.
*            RTAP is measured between pin-2 and wiper.
*     TAP = ratio of travel when Rtap is reached


*---------- The Ideal Positive Logarithm Potentiometer --------------
*
* 1.0 <----- 0.0
*        |3
*      __V__
*  1--|_____|--2
*       
*  o--R1-o-R2--o
*
*  RTAP is resistance at travel TAP
*  Example: Rtot=10k, R=1 @ 0.001 
*           RTAP=1, TAP=0.001
*  RTAP and TAP define a point of the curve resistance versus ratio.
*
.SUBCKT pot_plog 1 2 3
* Parameters: Rtot, wiper, Rtap, tap
.param w=limit(0.01m,wiper,0.99999)
*
.param pwrexp=ln(Rtap/Rtot)/(1-tap)
.param ratio=exp(pwrexp*(1-w))
*
R1 1 3 {Rtot*(1-ratio)}
R2 3 2 {Rtot*(ratio)}
.ENDS


3:30-5:30; 11:00-1:30 (4.5HRS)

No comments:

Post a Comment