Hi yall! First time long time.
My current (and first) project is building an animatronic rig for a giant eyeball and I seem to be having a little trouble.
I gutted a PS2 controller for the single unit, dual potentiometer in order to control 2 servos that will move the eye left/right and up/down. Everything wired up fine and I'm getting the servos to respond to input from the thumbstick but the movement in one direction moves the servo much more than in the other direction (same axis).
I troubleshot the problem for a bit and found that the thumbstick returns a value of around 160 while at rest in the center, with a max/min of 900/50 respectively. If it's "at rest" position was returning a median value of around 425 or so I don't think we'd have any problems when mapping to the 0-180 on the servo, but like I said, the servo reacts much more to one side of the stick than the other.
I wrote a simple "if returning <160 map to the servo using these values, else map using these other values", but that doesn't seem to work.
Any suggestions oh Mavericks of the Microchip?
Is it possible to mechanically rotate (adjust) the body of the pot while it's in it's 'centered' position? That might put you into it's more linear part of it's tracking.
Lefty
I popped the thumb stick assembly off and took a look, but since everything is spring loaded, I don't see a way to manually adjust the pots. 
The behaviour you describe is strange for a joystick, so my first guess is that your hardware is ok and the problem lies in how you use it. Here's a few things to check that might shed some light on the matter.
-
Is the potentiometer linear? Measure the resistance between the middle contact and one end with an Ohm-meter. Best check this while the potentiometer isn't connected to anything. What kind of values do you get for the extreme positions, the middle rest position and the halfway positions in between. Having a non-linear potentiometer in a joystick would be surprising.
-
If your potentiometer is linear, connect the whole thing to an analogue input and check the input values for the same 5 positions. You should get values where the middle rest is in the middle the extreme positions and the halfway moves about in the middle of those again. If that's the case, the potentiometer isn't to be blamed.
-
Now that you know that your inputs are correct, time to check the output. I assume you use the Servo-library. If not, do it. If you want to use the write() function with degrees as parameter, check if parameter 2 and 3 of your attach() call (yes, those are the optional ones) match the specification of your servo. If not, the translation from degrees to servo position will be messed up. As an alternative, try to use writeMicroseconds() instead of write().
Perhaps that helps. If not, time to post the results of your test and your code.
Korman
Awesome. Thanks for the help Korman. I'll poke at this problem a bit more with your recommended troubleshooting and get back to yall.