DSS-m15S is not working

I am trying to control my DSS-m15S servo motor, but all my attempts failed, even though I edited the Pulse range: - 500-2500 us - as datasheet said and put it in the code:

myservo.attach(9,500,2500);

it needs to be mentioned that I could control it (partially) throw using For loop like this:

  for (angle = 0; angle <= 180; angle++) {
    myservo.write(angle);
    delay(10);
  }
  // And back from 180 to 0 degrees:
  for (angle = 180; angle >= 0;  angle--) {
    myservo.write(angle);
    delay(10);
  }

partially: means the motor starts moving After a stop and giving a ticking sound with no movement, it only starts moving from 0 to 270 even it's not configured to do that.

I tried to increase the angle from {angle++} to {angles = angle +10} but it stopped moving, with the ticking sounds only.
full code:



#include <Servo.h>
// Create a new servo object:
Servo myservo;
// Define the servo pin:
#define servoPin 9

// Create a variable to store the servo position:
int angle = 0;
 uint16_t val;
void setup() {
  // Attach the Servo variable to a pin:
  myservo.attach(9,500,2500); 
  Serial.begin(9600);//Set Baud Rate to 9600 bps
}
void feedback( )
{
 val=analogRead(A0);//Connect Analog pin to A0
 dat = (double) val * 0.47-33.4;
 
 Serial.print("Position:"); //Display the position on Serial monitor
 Serial.print(dat);
 Serial.println("Degree");
 delay(10);
}
void loop() {
  // Tell the servo to go to a particular angle:

  // Sweep from 0 to 180 degrees:
  for (angle = 0; angle <= 180; angle++) {
    myservo.write(angle);
    delay(20);
  }
  // And back from 180 to 0 degrees:
  for (angle = 180; angle >= 0;  angle--) {
    myservo.write(angle);
    delay(20);
  }

}

Please Help!

Hi, @maxmark
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

Can you post your code in code tags and post a circuit diagram?

How are you powering the servo?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

should I repost the question?

I am powering it with an external power supply!
I tried 6v and 7.2 v

Hi,
Just post your code and schematic in a new post.
Leave your first post as it is.

Do you have the gnd of the servo power supply connected the Arduino gnd?
What model Arduino are you using?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

yes, the power supply GND connected to the motor and Arduino GND at the same time
I am using Arduino UNO