Servo Moving on its own and trembles

So i got 4 Miuzei 20KG Servos they are Powered externaly by a 5v20A Power supply
Programm I tried to move them to Position 0

#include <Servo.h> //include servo library

Servo servo; //create servo object

void setup() {
  servo.attach(9); //attach servo to pin 9
}

void loop() {
  servo.write(0); //set servo position to 0 degrees
  delay(1000); //wait for 1 second
}

But every time they move a bit forth and back and then they start to jitter
Hardware setup





added a video https://youtu.be/4UnZ1CFEY2Y

Your servo probably cannot move as far as 0 degrees and is therefore continually trying to do so. What happens if instead of 0 degrees you try say 10 degrees ?

tried this code

#include <Servo.h> //include servo library

Servo servo; //create servo object

void setup() {
  servo.attach(9); //attach servo to pin 9
}

void loop() {
  servo.write(110); //set servo position to 0 degrees
  delay(1000); //wait for 1 second
  servo.write(90);
}

now the servo rotates first clockwise and then counterclockwise but jittering is still there
but i dont have any control its just rotating back and forth the delay between rotations is not 1 sec(ca 3-5min)

Post a picture of your hardware setup.

Posted

Please confirm you have a common GND between the Arduino and the servo power supply.

This:


void loop() {
  servo.write(110); //set servo position to 0 degrees
  delay(1000); //wait for 1 second
  servo.write(90);
}

Should be:


void loop() {
  servo.write(110); //set servo position to 0 degrees
  delay(1000); //wait for 1 second
  servo.write(90);
  delay(1000);

}

ok i corrected to code didnt change much what do you mean with having common GND between the Arduino and Servo power supply the arduino is only sending the signals to the servos

i did not even connect it, why does it need to be ?

now its working :grinning:

1 Like
  • Signal current goes thru the yellow wire to the servo input.

  • This current needs to return to the Arduino.
    We connect a common ground wire between the servo GND (i.e. servo power supply GND) and the Arduino GND to facilitate this returning signal current.

Ok that makes sense thank you for helping me.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.