|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Potentiometer Help!
Hi,
We have a potentiometer wired to p3_x (port 3, x value) on the OI. It is a 100K Ohms, 3/4 turn POt; Used mostly in audio systems. We have wires connected to the middle and one of the outside terminals on the POT. We were getting a range of 231-254 at first, however after our programmers did some bitshifting on the values we had a range of 112-228, however we noticed that the numbers are jumping by 4. Meaning the values go 112,116,120 e.t.c. Is there a way to obtain more resolution from these POTS. My second question is how do i wire the POT to the RC and if it will be able to work with the GYRO and Navigation Code ( I heard that the Nav code only allows analog input from the gyro). Any help will be much appreciated. Last edited by thoughtful : 18-02-2005 at 00:08. |
|
#2
|
||||
|
||||
|
Re: Potentiometer Help!
Audio systems selom use a linear taper pot...
|
|
#3
|
||||
|
||||
|
Re: Potentiometer Help!
One thing that you should be aware of is that the Operator Interface analog inputs give you 8 bits while the Robot Controllers give you 10 bits of data.
This difference is extremely important when you deal with things like potentiometers. If you were using a joystick to make an arm go to a specific pot angle, then you should multiply the OI's value by 4 to get 10 bits. This made our arm go haywire last year at regionals and set us back a lot as my team members debugged the problem, and eventually it was just completely disabled. I'm not sure why they would have such a small range. Perhaps they are not rotating their full range. I have no clue what could be wrong. To wire the pot to the RC, I would assume that you take input power from the 5V center pin, ground from the black pin closest to the edge, and the output data to the pin closest to the middle labeled white/yellow. You could probably just use a PWM cable and soldier the pots to the leads at the end to get a nice connector. |
|
#4
|
||||
|
||||
|
[quote=thoughtful]Hi,
We have a potentiometer wired to p3_x (port 3, x value) on the OI. It is a 100K Ohms, 3/4 turn POt; Used mostly in audio systems. We have wires connected to the middle and one of the outside terminals on the POT. We were getting a range of 231-254 at first, however after our programmers did some bitshifting on the values we had a range of 112-228, however we noticed that the numbers are jumping by 4. Meaning the values go 112,116,120 e.t.c. Is there a way to obtain more resolution from these POTS. QUOTE] Bit shifting is causing your pot to jump by fours. A single Bit shift results in either a multiply or divide by 2 of the original value. In your case the programmers bit shifted twice to give you a factor of four. The 112 was originally 112/4 or 112*4. The 116 was originally 116/4 or 116*4, etc. It is my understanding that audio systems potentiometers are typically non-linear (tapered) and you will have much more success by purchasing a single-turn, linear pot from Digikey or mouser.com. |
|
#5
|
|||||
|
|||||
|
Re: Potentiometer Help!
Quote:
pot= (unsigned char) (Get_Analog_Value(rc_ana_01) >> 2); Something like that. The >>2 reduces it to a 8-bit. It is even there in last years programming manual. -Bharat |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| coding a potentiometer | incognito_NICK | Programming | 5 | 14-02-2005 15:56 |
| Potentiometer Trouble ?? | VideoMan053 | Programming | 18 | 28-01-2005 14:10 |
| Potentiometer | Joshua May | Technical Discussion | 8 | 22-05-2004 19:51 |
| Potentiometer with BS2 | sanddrag | Programming | 7 | 13-05-2004 19:21 |
| Potentiometer Problem | Greg | General Forum | 1 | 15-02-2003 18:10 |