|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Potentiometer Theory
I just want to make sure I get the basic theory correct. Inside a linear taper potentiomter, the circuit looks like this:
|--------------------- <- 5 V, I Amps | / \ Unknown length X / Wiper \---------------------- -> Analog Input V, I1 / Total length Xt \ Resistor / Total resistance Rt \ | |---------------------- -> Ground, Voltage Vg, I2 Effective Resistance R = (X/Xt) * Rt Analog Input V = I * R Vg = 5 - V (???) Do I have it right so far? And if I do, does anyone know the currents I1 and I2? |
|
#2
|
||||||
|
||||||
|
The current out the wiper is essentially zero.
The current through the pot is 5V/100,000Ohms = 0.00005 amps = 50 microAmps = 0.05 milliAmps The voltage Vg is zero because that is what the "g" is supposed to stand for "ground." The wiper lead is going to a high impedance input to an ADC (Analog to Digital Converter). This is what turns the 0-5V to the 0-255 number that you use in your Pbasic code. Hope this helps. Joe J. |
|
#3
|
|||
|
|||
|
Ok, I understand now how Vg = 0(I have a sophomoric understanding of circuits). But... what is I1 and I2? It's Kirchoff's loop rule or something. I'm just curious.
|
|
#4
|
|||||
|
|||||
|
Quote:
You get the different voltages because of Ohm's Law. Look at the resistance in the upper part (X) as R1 and the resistance in the lower part (1/( (1/(R-X)) + (1/R_controller) )) as R2 (because R_controller is pretty high, 1/R_controller is about 0 and thus, R2 is about R-X). Because the same current flows through both resistors (no knots), you can calculate the voltages over the top and the bottom part via Ohm's Law, U = R * I. This way you get U1 = R1 * I, U2 = R2 * I. Now, solving for I you get U1 / R1 = I = U2 / R2. Multiplying by R1 / U2 you get U1 / U2 = R1 / R2. Because R1 equals X and R2 equals approximately (R - X), you get (approximately): Code:
U2 R2 U2 X X
-- = -- <=> ---- = --- <=> U2 = (U-U2)*---- <=>
U1 R1 U-U2 R-X R-X
X X / X \ X
U2 = U*--- - U2*--- <=> U2*( 1 + --- ) = U*--- <=>
R-X R-X \ R-X / R-X
/ R-X X \ X R X
U2*( --- + --- ) = U*--- <=> U2*--- = U*--- <=>
\ R-X R-X / R-X R-X R-X
X
U2 = U*-
R
|
|
#5
|
|||||
|
|||||
|
Addendum
I completely forgot two things:
1.) Unlike you, I refer with "X" to the resistance of the upper part of the poti, not the length and to the total resistance not as Rt but as R 2.) Because R=s*l/A where s is the specific resistant (constant for same material), l the length of the piece and A its area, ad because A and s are constant within the poti, you get R ~ l. Let's define a constant c so that R = c*l. Now R_total=c*l_total and X=c*l_X, so that Code:
X c * l_X l_X
U2 = U * ------- = U * ----------- = U * -------
R_total c * l_total l_total
P.S.: poti should mean potentiometer |
|
#6
|
|||
|
|||
|
Ok, I get it pretty much now. Basically, the Robot Controller is a fancy voltmeter hooked up in a parallel to the post-wiper section of the resistor. Just one more question... which end produces a 0 V value and which end produces a 5 V one? I believe the analog input voltage tapers off as I move the wiper from the positive end to the ground... am I correct?
|
|
#7
|
||||||
|
||||||
|
You decide...
If you want your numbers to go from 0-255 put 5V one way. If you want your numbers to go the other way 255-0 put your 5V the other way.
You get to pick. I try to make my pots run a way that makes sense for me. If I am wiring a motor that turns that pot (through a drive train of course), then I try to have 254 (full forward on the motor) tend to move the pot in the direction of 255 on the pot. This makes sense to me, higher motor outputs makes for higher pot values -- it is very nice for feedback loops as well. Joe J. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| my theory on IA | robot180 | Website Design/Showcase | 7 | 21-10-2003 18:05 |
| Potentiometer Problem | Greg | General Forum | 1 | 15-02-2003 18:10 |
| Chaos theory does not work!!!!! | S9ar7acu3 | General Forum | 3 | 09-02-2003 11:46 |
| Code for use of a potentiometer | wonderdog5 | OCCRA | 2 | 06-11-2002 23:15 |
| Makin' a home-brewn dashboard program, and I need theory help! | DanL | Programming | 33 | 05-07-2002 01:26 |