My pantilt is acting sort of crazy

Version 16 (Jesse French, 07/19/2017 02:04 pm)

1 1 Rich LeGrand
h1. My pan/tilt is acting sort of crazy
2 1 Rich LeGrand
3 5 Rich LeGrand
The pan/tilt mechanism should track objects smoothly.  If it doesn't, here are a few things to try/check. 
4 1 Rich LeGrand
5 16 Jesse French
*UPDATE: we are experiencing major quality control issues with our servo supplier as of July 2017. Please try the below steps first, and if you are still having trouble with jerky servo movement, contact us at Thanks for your patience!*
6 16 Jesse French
7 12 Rich LeGrand
h2. 1. How are you powering Pixy?  
8 1 Rich LeGrand
9 13 Rich LeGrand
If you are powering Pixy through the Arduino cable instead of through the USB cable, or the "power connector":/projects/cmucam5/wiki/Powering_Pixy, the servos are not going to get enough power.  This is because the Arduino typically can't source enough current for the servos (1 Amp), and the Arduino cable tends to drop significant voltage.  There are more details "here":/projects/cmucam5/wiki/Powering_Pixy on using the power connector, which is recommended in this case. 
10 12 Rich LeGrand
11 12 Rich LeGrand
h2. 2. Are you using a USB hub?
12 12 Rich LeGrand
13 14 Rich LeGrand
Assuming you're using a USB cable to power Pixy (and the pan/tilt), the pan/tilt servos need more power than most USB devices.  Using a hub is likely to result in not enough power getting to the servos.  Plug Pixy into your computer directly (no USB hub).  
14 10 Rich LeGrand
15 12 Rich LeGrand
h2. 3. Try a different USB cable
16 1 Rich LeGrand
17 1 Rich LeGrand
Powering servos over USB is great because you don't need to worry about batteries, but there can be problems with not enough voltage reaching the servos.  Always use a USB cable that's 3 feet or shorter, and if it's still having problems try another cable if you can.  USB cables aren't all created equal -- some have flimsy-gauge wire that can cause problems.   
18 10 Rich LeGrand
19 12 Rich LeGrand
h2. 4. Check to make sure there is no mechanical binding
20 1 Rich LeGrand
21 1 Rich LeGrand
Unplug Pixy from power/USB and gently check the pan axis by moving it back and forth over its entire travel.  It should move fairly easily and smoothly.  Then test the tilt axis by moving the *servo horn* back and forth (not Pixy!).  It too should move fairly easily and smoothly and not bind on any cables.
22 1 Rich LeGrand
23 5 Rich LeGrand
When Pixy is plugged into the USB cable, make sure there is plenty of cable for Pixy to look up and down, left and right.  
24 1 Rich LeGrand
25 12 Rich LeGrand
h2. 5. Check the connections
26 1 Rich LeGrand
27 1 Rich LeGrand
This is an obvious one, but make sure the connectors that plug into Pixy are secure and fully engaged (you shouldn't see any of the terminal posts on Pixy -- each servo connector should completely cover the terminal posts on Pixys servo connector.)  
28 10 Rich LeGrand
29 12 Rich LeGrand
h2. 6. Does the pan/tilt seem to avoid the object?
30 1 Rich LeGrand
31 1 Rich LeGrand
That's not good!  But it's usually caused by the pan and tilt servos being swapped where they plug into Pixy.  Try swapping the servo connectors where they plug into Pixy so they are correct.
32 1 Rich LeGrand
33 12 Rich LeGrand
h2. 7. Do you get a good solid rectangle in PixyMon when running the "pan/tilt demo"?
34 1 Rich LeGrand
35 15 Jesse French
If the rectangle changes shape rapidly or you see lots of rectangles (detected objects), Pixy will have a hard time tracking.  You should probably re-teach.  Or you may need to adjust some parameters -- consult "this guide":/projects/cmucam5/wiki/Some_Tips_on_Generating_Color_Signatures_2 to learn more.
36 1 Rich LeGrand
37 12 Rich LeGrand
h2. 8. Test the servos
38 1 Rich LeGrand
39 2 Rich LeGrand
Run PixyMon and hit the stop button (upper left corner of PixyMon).  In the command window type this, hitting <return> after each line:
40 2 Rich LeGrand
41 2 Rich LeGrand
42 1 Rich LeGrand
rcs_setPos 0 1000
43 2 Rich LeGrand
rcs_setPos 0 0 
44 1 Rich LeGrand
rcs_setPos 1 1000 
45 1 Rich LeGrand
rcs_setPos 1 0 
46 1 Rich LeGrand
47 10 Rich LeGrand
48 8 Rich LeGrand
This should exercise the pan servo first then the tilt servo.  The movement should be smooth and rapid.  If not, make a note of which servo is acting strange. and send us an email describing your experience (
49 9 Rich LeGrand
50 12 Rich LeGrand
h2. 9. Reduce the frequency
51 1 Rich LeGrand
52 15 Jesse French
From PixyMon, bring up the "Configure Dialog":/projects/cmucam5/wiki/Configure_Dialog (the gear icon).  In the "Servo" tab change the "Servo Frequency" to a lower value, from 100 to 75 or 60 and see if that improves the behavior of your pan/tilt servos.  This suggestion is somewhat experimental, so please "send us a note" if this helps!  You can select *Action&#10140;Restore default parameters* to get back if it doesn't help.