Micro Servo Position

Hello!

I`m facing a problem with micro servo motor, which I got from China from EBAY.

Problem is in its precision and I`m not sure if it is a mechanic or electric issue.

I used this program to check its range using serial monitor:

#include <Servo.h>

Servo servo1;  
long num;     

void setup()
{
 servo1.attach(9);
Serial.begin(9600); 
Serial.print("Enter Position = ");
}

void loop() 
{ 
  while(Serial.available()>0)
  { 
  num= Serial.parseInt();   
  Serial.print(num);  
  Serial.println(" degree");
  Serial.print("Enter Position = ");
  }
  servo1.write(num);
  delay(15);
}

I set his start position to 90deg, and when i typed 0 deg. It went to 0deg but vibrating and heating, it was behaving same for every angle untill 30deg, 30 deg was fine!

Then i typed 180deg and it was fine too!

So is it possible my servo motor range is 30deg-180deg, but it should be 0deg-180deg?

but it should be 0deg-180deg?

Why do you assume that?

But, aren`t servo motors suppose to having rotation to 180 degree?

Hi,

For most servos the position angle of the servo is controlled by the length of the pulse in milliseconds (usually between about 1.00-2.00ms). 1.50ms is usually Center, or Stopped (For Robot Servo).

REALITY: They all vary from that, especially $3 servos. I have bought over 5000 of THIS: servo, and there is quite a lot of variability in the "limits" of the control signal VS position.

See more information (and links to even more) HERE:

The code I supply with kits I make that include these servos is HERE: and you'll see I limit the control signal to not get too close to the limits:

/*-----( Declare Constants and Pin Numbers )-----*/
#define ServoPIN  9  // Can be changed 3,5,6,9,10,11 (NOW can be any pin including A0..A5)
#define ServoMIN  30 // Don't go to end of servo travel
#define ServoMAX  150 // which may be 0 to 180.

Once that is working you can explore the actual limits of your actual servo.

DISCLAIMER: Mentioned stuff from my own shop...

Thank you for explanation how servos works! :slight_smile:
I learned more about servos from links you provided!
Also special thanks for code, it will help me a lot in future!

Best regards!!