Society of Robots - Robot Forum

Software => Software => Topic started by: Carter05 on May 31, 2009, 10:55:51 PM

Title: servo twitch
Post by: Carter05 on May 31, 2009, 10:55:51 PM
Is it normal for a servo to twitch a lot when it's supposed to be holding a position? I'm using the Axon and using the regular servo code that comes with it. This is the code I'm using. Funny thing is when I set it to 280 it's fine and doesn't move at all and holds its position steady. But if I set it to 700 for center it twitches pretty badly. Using a Hitech HS-475HB servo unmodified.

Code: [Select]
while(1)
{

go1=280;

wheel_left(go1);
rprintf("L_wheel=%d\r\n " , go1);
delay_ms(30);
}

Title: Re: servo twitch
Post by: Razor Concepts on May 31, 2009, 11:08:22 PM
adjust the value you are delaying. Certain servos like certain values of delay.
Title: Re: servo twitch
Post by: Carter05 on June 01, 2009, 08:27:05 AM
I've only tried 20ms and 30ms delay so far. I'm at work now and won't get a chance to test more delays til after then. Any other ideas as to what it might be? Seems odd that it would be ok at one position and not others. I did try another servo I had that was modified but it did the same thing. I'm not running any other code, just trying to figure out how to use a simple servo!
Title: Re: servo twitch
Post by: Carter05 on June 01, 2009, 03:41:44 PM
Ok I give up, I tried a boat load of different delays and they all make the stupid thing twitch like an old lady. So, would setting up PWM be a better solution to run the servo? I know this is super simple, I'm just to dumb to figure it out. Anybody have any suggestions?
Title: Re: servo twitch
Post by: Admin on June 04, 2009, 06:45:44 PM
How many servos are you running, and is anything else attached to the Axon?

Do you have any interrupts enabled?

Are you using servo extenders?
Title: Re: servo twitch
Post by: Samuel on June 13, 2009, 10:21:18 AM
This usually happens if you are powering the Servo from the same power as the Axon.
The EMF and so noise on the line can cause the Axon to reset.

YOur problems will be resolved if you power the Servos from a different power supply.
Of course you need a common Ground.....but use a different +5 for your Axon
than the one for your servo.

Also a low battery can do the same thing.

Samuel
Title: Re: servo twitch
Post by: SmAsH on June 13, 2009, 04:48:30 PM
This usually happens if you are powering the Servo from the same power as the Axon.
The EMF and so noise on the line can cause the Axon to reset.
YOur problems will be resolved if you power the Servos from a different power supply.
Of course you need a common Ground.....but use a different +5 for your Axon
than the one for your servo
this shouldn't happen unless he is running like 15+ servos as the axon has a giant cap on it meant to take this sort of stuff. but you are right on the low battery part of things.
Title: Re: servo twitch
Post by: zuazons on June 23, 2009, 06:16:39 AM
I have the same problem and I am using 3 servos only, inclusive with 1 servo occurrs the same.
Title: Re: servo twitch
Post by: SmAsH on June 23, 2009, 02:34:53 PM
have you checked your battery levels?
made sure you are running on a digital port?