I recently bought 4 Goteck micro metal gear servos with the intention of using them to move some joints in my 3d printed robot. I decided to test them onviously and ran some simple code on my Arduino (basicly cantering the servo, moving it to the left and then right). I had run this code before with some other servos which worked fine but these ones seemed to act weirdly. Instead of jumping straight to the right position they flapped around a bit before stopping at the right place. Sometimes they would “flap” over the right spot up to 4 times before coming to a stop and sometimes worked properly. These servos are advertised as “perfect for model aeroplanes and helicopters” but I think if I was to use them the model would be unflyable.
Is it something to do with the PWM of my Arduino UNO or am I using the servos wrong and is there a way to fix it?
The code I am using is:
#include <Servo.h>
Servo servo1;
void setup()
{
servo1.attach(9);
}
void loop()
{
int position;
servo1.write(90);
delay(2000);
servo1.write(180);
delay(1000);
servo1.write(0);
for(position = 0; position < 180; position += 2)
{
servo1.write(position);
delay(20);
}
}
Thanks for the help