servo works fine --> other servo --> shacking

Hey everybody,

I have an arduino and can control a servo with a Poti. The servo and arduino are connectet to a external power supply.
Problem:
Servo1: GWS IQ-910
Servo2: GWS IQ-910

Servo1 at PIN9 works fine! No shacking etc....
When i connect Servo 2 instead of Servo 1 at PIN9 it shackes around.. Its the same Type of Servo.

I connectet servo2, to my RC- Car to check if its brocken --> Works fine. I can control it without chacking with my remote control.

But why is it shacking at the arduino? Servo 1 works fine and is the same... Do you have some advice?

Best regards Phil

#include <Servo.h> 
 
Servo myservo;
 
int potpin = 5;  // analog pin used to connect the potentiometer
int val; 
 
void setup() 
{ 
  myservo.attach(9);
} 
 
void loop() 
{ 
  val = analogRead(potpin);    
  val = map(val, 0, 900, 0, 150);  
  myservo.write(val);  
  delay(10);                           // waits for the servo to get there 
}

Servos don't have their range carefully defined. It may be that the problem servo doesn't like being commanded to move to 0 degrees. Try raising the minimum to 20 deg and see what happens. If that solves the problem you can experiment to see what is the minimum angle it will accept.

...R

Servo test code you could use to find the rotation limits of your servo.

// zoomkat 12-25-13 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// Send an a to attach servo or d to detach servo
// for IDE 1.0.5 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

#include <Servo.h> 
String readString; //String captured from serial port
Servo myservo;  // create servo object to control a servo 
int n; //value to write to servo

void setup() {
  Serial.begin(9600);
  myservo.writeMicroseconds(1500); //set initial servo position if desired
  myservo.attach(7, 500, 2500);  //the pin for the servo control, and range if desired
  Serial.println("servo all-in-one test code 12-25-13"); // so I can keep track of what is loaded
  Serial.println();
}

void loop() {
  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string 

      // attach or detach servo if desired
    if (readString == "d") { 
      myservo.detach(); //detach servo
      Serial.println("servo detached");
      goto bailout; //jump over writing to servo
    }
    if (readString == "a") {
      myservo.attach(7); //reattach servo to pin 7
      Serial.println("servo attached");
      goto bailout;
    }    

    n = readString.toInt();  //convert readString into a number

    // auto select appropriate value
    if(n >= 500)
    {
      Serial.print("writing Microseconds: ");
      Serial.println(n);
      myservo.writeMicroseconds(n);
    }
    else
    {   
      Serial.print("writing Angle: ");
      Serial.println(n);
      myservo.write(n); 
    }

bailout: //reenter code loop
    Serial.print("Last servo command position: ");    
    Serial.println(myservo.read());
    Serial.println();
    readString=""; //empty for next input
  }
}

Hey,

thanks a lot for the tips.

I testet a lot this morning. The change to 20 or 40 degrees minimum has changed nothing.
I tested the servo.writeMicroseconds(uS) too. But it changes nothing.

I attachet a little video. - YouTube
Somethimes Servo1 is shacking too. But only a litle for a second or two...

I think the problem is in the PWM signal. It seems to me that the servo gets a noisy signal from the arduino.

Regards Phil

I have an arduino and can control a servo with a Poti. The servo and arduino are connectet to a external power supply.

Perhaps you could give more details on your 'external power', including voltage rating and maximum current capacity. Many 'strange' servo problems are solved only by insuring you have proper power for the servos.

Its an external power supply, 0-30V DC, 0-10 A

The current raises maximum to 2 A... At Servo 2 the current fluctuates with the shacking.

The Arduino and the Servos are both connected to the power supply at 6V. So the Servos are connectet to the power supply...

Regards

cola1988:
Its an external power supply, 0-30V DC, 0-10 A

The current raises maximum to 2 A... At Servo 2 the current fluctuates with the shacking.

The Arduino and the Servos are both connected to the power supply at 6V. So the Servos are connectet to the power supply...

Regards

How are you wiring the 6V to the arduino board? 6 volts is a little low for the arduino external DC power connector and a little too high for wiring to the 5V pin.

And please, the correct spelling is "shaking".

...R