servo motor is not rotating properly

Hi,
I am using servo motor which contains 5 pins.
The problem is the servo motor is not rotating properly means it is not rotating in constant speed if i set speed the motor is rotating slowly and fastly. i had attached the code here pls tell me to resolve the issue.

int i = 0;
int val=0;
int count=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(10, OUTPUT); //PWM PIN 10 with white line
pinMode(11, OUTPUT);//direction control PIN 11 with blue line
pinMode(6, INPUT);
//pinMode(A0, INPUT_PULLUP);
//analogWrite(11, 255);
}

void loop()
{
digitalWrite(10,HIGH);
//if(Serial.available()>0)
//{
analogWrite(11, 230); //input speed (must be int)
//}
// count++;
for(int j = 0;j<8;j++) {
i += pulseIn(6, HIGH, 500000);
}
i = i >> 3;
Serial.print(111111 / i); //speed r/min (601000000/(4562i))
Serial.println(" r/min");
i = 0;

}

Pictures, datasheet ... ?

I don’t have datasheet .I am here by attaching the pic of servo motor .
here the problem is motor is running and speed also changing according to the program.But if i reduce the speed the motor is not running constantly

IMG20190606151532.jpg

Try tre servo library to control speed (values 0…180)

That is not a servo. Post a link to whatever it is (most likely a brushed DC motor with tachometer or encoder).

Also, please post a wiring diagram and a link to the motor driver.

What are you using for a motor power supply?

Full information on all your hardware please, otherwise we’ll be back and forth for ages…