<< return to Pixycam.com

User Tools

Site Tools


wiki:v2:my_pantilt_is_acting_sort_of_crazy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:v2:my_pantilt_is_acting_sort_of_crazy [2018/05/18 19:57]
pixycam [My pan/tilt is acting sort of crazy]
wiki:v2:my_pantilt_is_acting_sort_of_crazy [2018/12/26 20:40] (current)
jfrench added try unplugging one servo
Line 1: Line 1:
 +====== My pan-tilt is acting sort of crazy ======
  
 +The pan-tilt mechanism should track objects smoothly. If it doesn'​t,​ here are a few things to try/check.
  
  
 +===== 1. How are you powering Pixy? =====
  
-====== My pan/tilt is acting sort of crazy ======+If you are powering Pixy through the Arduino cable instead of through the USB cable, or the [[wiki:​v2:​Powering_Pixy|I/O connector]],​ the servos are likely not going to get enough power. This is because the Arduino typically can't source enough current for the servos, and the Arduino cable tends to drop significant voltage. There are more details [[wiki:​v2:​Powering_Pixy|here]] on different powering methods.
  
-The pan/tilt mechanism should track objects smoothly. If it doesn'​t,​ here are a few things ​to try/check.+One way to check if you have a power issue: if you connect only one servo - that is, try unplugging one - does the issue persist?
  
- +If unplugging a servo solves it, that would point to current draw beyond ​the capabilities ​of your USB port or cable.
- +
-===== 1. How are you powering Pixy? ===== +
- +
-If you are powering Pixy through ​the Arduino cable instead ​of through the USB cable, ​or the [[wiki:​v2:​Powering_Pixy|power connector]],​ 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 [[wiki:​v2:​Powering_Pixy|here]] on using the power connector, which is recommended in this case.+
  
  
 ===== 2. Are you using a USB hub? ===== ===== 2. Are you using a USB hub? =====
  
-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).+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).
  
  
-===== 3. Try a different USB cable ===== +===== 3. Check to make sure there is no mechanical binding =====
- +
-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. +
- +
- +
-===== 4. Check to make sure there is no mechanical binding =====+
  
 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. 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.
Line 31: Line 25:
  
  
-===== 5. Check the connections =====+===== 4. Check the connections =====
  
-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.)+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.) ​ 
  
 +It is easy to get the pan and tilt servo connections reversed. ​ When looking at the back of Pixy's PCB, the pan servo is on the left and the tilt is on the right of the servo connector (closer to the edge of the PCB).  Verify that the Pan servo is connected to the pan connector by unplugging the tilt servo and trying to move the pan axis (do this with Pixy powered-up.) ​ If the pan axis moves freely with the pan servo plugged in, you may have the tilt servo plugged into the pan connector (and vice-versa). ​  
  
-===== 6. Does the pan/tilt seem to avoid the object? ===== 
  
-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.+===== 5. Try a different USB cable =====
  
 +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. USB cables aren't all created equal -- some have flimsy-gauge wire that can cause problems. ​ The USB cable that came with your Pixy has good current-carrying ability, so use it if you can.  Otherwise, use a good quality cable that is 4-ft or shorter.  ​
  
-===== 7. Do you get a good solid rectangle in PixyMon when running the "pan/tilt demo"? =====+ 
 +===== 6. Do you get a good solid rectangle in PixyMon when running the "pan-tilt demo"? =====
  
 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 [[wiki:​v2:​Some_Tips_on_Generating_Color_Signatures_2|this guide]] to learn more. 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 [[wiki:​v2:​Some_Tips_on_Generating_Color_Signatures_2|this guide]] to learn more.
  
  
-===== 8. Test the servos =====+===== 7. Test the servos =====
  
-Run PixyMon ​and hit the stop button (upper left corner of PixyMon). In the command ​window type this, hitting <​return>​ after each line:+Bring up the console in PixyMon ​by selecting **View➜console**. ​ Then hit the stop button (upper left corner of PixyMon). In the console ​window type this, hitting <​return>​ after each line:
  
 <​code>​ <​code>​
Line 56: Line 52:
 rcs_setPos 1 0 rcs_setPos 1 0
 </​code>​ </​code>​
-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 (<​[email protected]>​). 
  
 +The first two commands should move pan servo back and forth. ​ The last two commands should move the tilt servo up and down.  Are the servos reversed? ​ If so, reverse the servo connectors. ​ Is the movement smooth and rapid? ​ If not, try removing one of the servos and measuring the voltage at the exposed servo connector with a voltmeter while exerting torque on the other servo. ​ Refer to the picture below for the servo connector pin-outs.
 +
 +{{wiki:​v2:​image_248_2.jpg?​500}}
 +
 +The measured voltage should be 4.9V or above with the other servo under load.  If the voltage is less than 4.9V, investigate your power source'​s voltage and its ability to deliver at least 500mA.  ​
 +
 +
 +Regardless, send us an email describing your experience (<​[email protected]>​).
  
-===== 9. Reduce the frequency ===== 
  
-From PixyMon, bring up the [[wiki:​v2:​Configure_Dialog|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 [[mailto:​[email protected]|send us a note]] if this helps! You can select **Action➜Restore default parameters** to get back if it doesn'​t help. 
  
  
wiki/v2/my_pantilt_is_acting_sort_of_crazy.1526673420.txt.gz · Last modified: 2018/05/18 19:57 by pixycam