Go Down

Topic: Servo broken? help a newbie (Read 632 times) previous topic - next topic

demer8008

setup is the simplest possible http://imgur.com/wLezu

The code is servo example from Arduino.cc


Im getting only sound from my servo. In intervalls according to what i set in my code.


Could it be a voltage problem? if i mesaure voltage on the servo its between 3.8-4 v. How would i set up if i want it to run on 6v from 4 1.5v AA batterys? (guessing red-black to battery and leave only pin wire from the arduino board) tnx!

AWOL

Connect the black wire to your Arduino's ground (gnd) and to the battery's -
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

demer8008

Same thing with extra power. Now pins on servo shows 5v

How could i change the code to try different update rates? like 50hz

AWOL

Quote
How could i change the code to try different update rates? like 50hz

Servo update is 50Hz, IIRC.

Quote
Same thing with extra power. Now pins on servo shows 5v

I don't understand that

Can you confirm that the servo, the battery, and the Arduino share a common ground, and that you have your Arduino's signal pin connected to the servo's signal wire.

Please post your code and your schematic.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

demer8008

Yes i think so.

http://imgur.com/RIeaG

is this ok? battery ground (black) and servo ground (black)  -> arduino ground (black)

demer8008

Just the standar examle code

#include <Servo.h>
Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created

int pos = 0;    // variable to store the servo position

void setup()
{
  myservo.attach(8);  // attaches the servo on pin 9 to the servo object
}


void loop()
{
 
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(25);                       // waits 15ms for the servo to reach the position
  }
 
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(25);                       // waits 15ms for the servo to reach the position
  }


}

DuaneB

Hi,

Can't see your wires to well in the picture, but just to confirm, servo ground, battery ground and Arduino ground all need to be connected together - can't tell from the pic.

Also do the batteries have a good charge ?

Duane B

rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

zoomkat

Basic servo/arduino wiring setup and servo test code.



Code: [Select]

// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h>
Servo myservo;  // create servo object to control a servo

void setup() {
  Serial.begin(9600);
  myservo.writeMicroseconds(1500); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control
  Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}

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
    int n = readString.toInt();  //convert readString into a number

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

    readString=""; //empty for next input
  }
}
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

demer8008

#8
Aug 03, 2012, 06:31 pm Last Edit: Aug 03, 2012, 06:34 pm by demer8008 Reason: 1
Yes the batteries are new. They measure up to 6v

as far as i can see i have connected like you draw zoomkat.

"common ground" as in: my 3 black ground wires wires are all connected together:

-from battery -
-from servo ground


and

-to arduino ground


Trying that code i get nothing, only sound from servo when i plug power in.

demer8008

#9
Aug 03, 2012, 06:40 pm Last Edit: Aug 03, 2012, 07:27 pm by demer8008 Reason: 1
How is a servo supposed to feel, not plugged in? should yu be able to turn it around manually with light force?


mine wont budge unconnected
nothing happends at startup of arduino
when code starts running i have faint sounds in the interval, but no movement

dxw00d

If you can't turn it by hand, when it has no power going to it, then there is something wrong with it.

zoomkat

What type of servo do you have? Note that hand turning smaller servos might damage the gears if not careful. Also the small servos like the 9g ones may strip gears if run against the internal hard stop when at near max voltage.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

demer8008

its called "HS-55" micro servo

DuaneB

Hi,
   I seem to be the only person on the planet that this happens to, but I often need to connect a 1K or 10K resistor in the signal line to the Servo or my projects hang.

Like I say no one else seems to have this problem but maybe I just use a wider variety of servos.

Duane B

Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

demer8008

Now i have tried 9v in to the arduino dc.
And 6v into the servo.

Also 10k resistor on signal line.

Must be something broken with the servo

Go Up