Understanding servos

Well, I'm trying to learn servos so I'm toying around a micro servo 9G.

I'm using an arduino one board and the following code:

 

#include <Servo.h>

Servo neckServo;            // Define the Servo object

void setup()

{  

  neckServo.attach(10);     // attach the servo on pin 10 to the servo object 

  neckServo.write(90);       // "favorite" default position

}  

 

void loop()

{

neckServo.write(0);

//neckServo.write(90); 

//neckServo.write(180);  

delay(3000);   

}

 

 

whereas in the loop() I vary among those positions (one at a time). My problems/questions are:

1) at angle 0 or very small angles I hear a sort of buzzing, which make me think that the servo motor is in stress or something, in other words does not seem to be healthy for the servo.

2) aditionally the 180º position does seem to be quite a few degrees short of what I think it should be (when compared with the 0 or 90º positions)

 

So any ideas on these issues above?

 

~thanks 

Yes, don’t let it go that far.

It sounds like you are hitting the internal stops. These are physical stops inside the servo preventing over-travel. Don’t go that far. Maybe a range of 10 to 170 would be better.

In terms of 180 not being precise in comparison to other angles. Yeah, dude, you are using a $3 servo --It ain’t gunna be perfect.

Ok roger that, thanks :slight_smile:

Ok roger that, thanks :slight_smile:

Lucky for me for the time being a  range of 45 - 135 degrees should be enough (I hope :P).