Servo complaining

Working with servo that should have a range from 0-179 but when I get up to the 179 number the servo complains about being out there. It starts hissing and buzzing around on the desk.

It will cycle back to 0 without a problem but at 179, it just does not like it.

I also tried 0 -165 but when it gets to the top end it just complains about having to work. What's up with it?

    myServo.write(map(angle,0,180,0,179));

What's up with it?

Servos have internal mechanical rotation stops that may not be exactly aligned wit the 0-180 position commands. You should not operate a servo against its internal mechanical stops as it may be damaged. Below is some servo test code you might use to determine the servo mechanical command limits.

// zoomkat 3-28-14 serial servo incremental test code
// using serial monitor type a character (s to increase or a 
// to decrease) and enter to change servo position 
// (two hands required, one for letter entry and one for enter key)
// use strings like 90x or 1500x for new servo position 
// for IDE 1.0.5 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

#include<Servo.h>
String readString;
Servo myservo;
int pos=1500; //~neutral value for continuous rotation servo
//int pos=90;

void setup()
{
  myservo.attach(7, 400, 2600); //servo control pin, and range if desired
  Serial.begin(9600);
  Serial.println("serial servo incremental test code");
  Serial.println("type a character (s to increase or a to decrease)");
  Serial.println("and enter to change servo position");
  Serial.println("use strings like 90x or 1500x for new servo position");
  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) {
    if(readString.indexOf('x') >0) { 
      pos = readString.toInt();
    }

    if(readString =="a"){
      (pos=pos-1); //use larger numbers for larger increments
      if(pos<0) (pos=0); //prevent negative number
    }
    if (readString =="s"){
      (pos=pos+1);
    }

    if(pos >= 400) //determine servo write method
    {
      Serial.println(pos);
      myservo.writeMicroseconds(pos);
    }
    else
    {   
      Serial.println(pos);
      myservo.write(pos); 
    }
  }
  readString=""; //empty for next input
}

The problem described in this thread ended up being caused by using servo positions outside the range of the servo being used.

I think it would be a good idea if Arduino didn't use such extreme endpoints as the default in the servo library.

The library is designed to work with all servos, but most servos do not have a 180 degree range. 120 degrees
is more usual but every manufacturer does things slightly differently.

You have to be sure not to push the servo beyond its endstops or it will overheat and cook.