Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: D1g1talDragon on January 04, 2009, 12:26:04 AM

Title: Crazy servos
Post by: D1g1talDragon on January 04, 2009, 12:26:04 AM
Hiya everyone.

I've got a setup right now consisting mainly of an Arduino Decimilla and a pair of HiTec HS-311 servos.  Power to each servo is provided by a dedicated battery pack.  The signal lines for each servo are connected to pins 9 and 10 on the board, set to outputs, and are providing PWM through the Arduino servo.h library everybody seems to use.  Should be pretty simple.

However, I'm experiencing very strange and unpredictable twitches and movement from either servo both randomly and when I send commands to the other one. For example, I tell the left servo to head for 120 degrees, and the right servo will twitch to a seemingly random position as well.  This even seems to occur when the signal line for one servo is totally disconnected from the board.  I'm just using the standard servo test code provided on the Arduino playground at this point, figuring it's not worth trying to code anything if the simple parts are unpredictable

Is this an example of noise being interpreted by the servos?  Should my leads be shortened?  They came from the factory pretty long.  Do I need an engineer, or an exorcist :P?  Thanks guys.

EDIT: Read the servo guide on site here, and there's a section on this very issue due to noise.  I'm going to chop down my signal cables and try again. 
Title: Re: Crazy servos
Post by: frodo on January 04, 2009, 03:02:01 AM
if the servos are connected right next to each other it could cause some interference or if there is a slight solder bridge on the pins it could cause a bottleneck on power causing slight movement.
Title: Re: Crazy servos
Post by: Ro-Bot-X on January 04, 2009, 07:39:08 AM
Make sure the ground line of the servos is connected to the Arduino ground. Also install a big capacitor (1000uF) in paralel with the servo battery.
Title: Re: Crazy servos
Post by: D1g1talDragon on January 04, 2009, 12:32:57 PM
Yep, the ground line fixed it last night.  Thanks guys!