Servo Motors are vibrating

Hi, I'm new to arduino and I'm having some hardware problems.

I was working normally with my robot and I raised my last setting and out of nowhere the servos started vibrating too crazy, any opinion is welcome...

Here is the code:
`#include <Servo.h>

int ServoPin1 = 9;
int ServoPin2 = 5;
int ServoPin3 = 6;
int ServoPin4 = 10;
int Correr4_A = 63;
int Correr3_A = 117;
int Correr4_B = 60;
int Correr3_B = 120;
int CaminarDE_A = 130; // Caminar derecho
int CaminarIZ_A = 40; // Caminar izquierdo
int CaminarDE_B = 40; // Caminar derecho
int CaminarIZ_B = 130; // Caminar izquierdo
int Central = 90;
int Gateo_24 = 60;
int Gateo_13 = 110;
int PataDD = 100;
int PataDI = 80;
int Tiempo_Co = 800;
int Tiempo_Ca = 1000;
int PinSensor = 2;
int EstadoSen = 0;
Servo Servo1; // Delantero Derecho
Servo Servo2; // Delantero Izquierdo
Servo Servo3; // Trasero Derecho
Servo Servo4; // Trasero Izquierdo

unsigned long tiempoInicio = 0; // Variable para guardar el tiempo cuando se toca el sensor
unsigned long tiempoDuracion = 0; // Variable para calcular el tiempo transcurrido

void setup() {
// Configuración de los servos
Servo1.attach(ServoPin1);
Servo2.attach(ServoPin2);
Servo3.attach(ServoPin3);
Servo4.attach(ServoPin4);

// Posición inicial de los servos
Servo1.write(PataDD);
Servo2.write(PataDI);
Servo3.write(90);
Servo4.write(90);
delay(10000);

pinMode(PinSensor, INPUT); // Configurar el pin del sensor como entrada
}

void loop() {
// Función para caminar

/*Servo1.write(CaminarDE_A);
Servo2.write(CaminarIZ_A);
Servo3.write(CaminarDE_A);
Servo4.write(CaminarIZ_A);
delay(Tiempo_Ca); // Pausa de 1 segundo

Servo1.write(CaminarDE_B);
Servo2.write(CaminarIZ_B);
Servo3.write(CaminarDE_B);
Servo4.write(CaminarIZ_B);
delay(Tiempo_Ca); // Pausa de 1 segundo
*/

// Función para correr

Servo1.write(90);
Servo2.write(90);
Servo3.write(Correr3_A);
Servo4.write(Correr4_A);
delay(Tiempo_Co);
Servo1.write(120);
Servo2.write(60);
Servo3.write(Correr3_B);
Servo4.write(Correr4_B);
delay(Tiempo_Co);

// Función para gatear

/*Servo1.write(Central);
Servo2.write(Gateo_24);
Servo3.write(Gateo_13-10);
Servo4.write(Central);
delay(Tiempo_Ca);

// Gateo
Servo1.write(Gateo_13);
Servo2.write(Central);
Servo3.write(Central);
Servo4.write(Gateo_24+10);
delay(Tiempo_Ca);*/
}
` Very thank you.

Vibrating servos is almost always due to a power problem.

So which servos, and how are you powering the servos.
Leo..

  • Always show us a good schematic of your proposed circuit.
    Show us good images of your ‘actual’ wiring.
    Give links to components.
1 Like

I´m using MG90s servo motor and I am using a power card for protoboard it I giv power with an adapter of 9V.

  • These servos require an operating voltage: 4.8 V - 6.0 V.
    9 volts is too high.

  • What are the specifications of the power supply are you using ?

No, my power card out is of 5 volts

The adapter must be rated for 2.5Amp or more for those four MG90 servos.

Do you also power the Arduino from that adapter?
Leo..

The servo power supply is inadequate. Use a separate supply capable of providing at least 3 Amperes at 4.8 to 6V, and don't forget to connect the grounds.

Very thank you!!! I think that was the amper of my input.

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