# Servo motor programming

Hello, could someone explain to me how using microsecond commands work? From my understanding, beyond a certain number of ms it will turn clockwise and below that number it will turn counterclockwise. Is there a way to make a servo do only a few degrees? for example, if the threshold is 1.5ms or 0 degrees could I make it go counter clockwise 30 degrees by using a 1ms command?

You’re talking about two different types of servo. A continuous rotation servo will do like you describe, one way for less than 1500us and the other for greater than that.

For a normal servo the microseconds determines a position between normally 0 and 180 degrees though some servos cover more or less angle.

What one does is impossible for the other.

Which type of servo do you have?

I am actually currently using a sail winch servo that does approx. 3.5 rotations both directions and allows me to use microseconds to control location. However, I am wanting to condense it down to a smaller size by using the standard servo. I wish to accomplish using microseconds to tell the servo a location to turn to and once another if statement threshold is reached it moves back to start. I was also considering using the limit switch to tell the servo when to stop.

Writing to a normal servo (using the Servo library) tells it to go to a specific location. Generally 1ms or less is full in one direction, 1.5ms is centred and 2ms+ is fully the other way. But which direction it moves in depends on where it is when you send the command.

Steve

Is there anyway to have a continuous servo rotate beyond 180 degrees and stop on a point then rotate back to the start position?

acdavis1999: Is there anyway to have a continuous servo rotate beyond 180 degrees and stop on a point then rotate back to the start position?

No, continuous rotation servos don’t have any positional control. You can only tell them go this way or that way but not where to stop.

Do you know of any way to control where a servo stops then?

acdavis1999: Do you know of any way to control where a servo stops then?

Get the type of servo that has positional control.

What part of you can’t do that with a continuous rotation servo are you not underatanding?

I guess you could use a limit switch and have your code watch for that to stop moving the servo like you would if it was just a motor. But that’s a bit more complex than what I think you’re asking.

If you want something that rotates more than 360 degrees but still can be accurately stopped at a specific position then you've already got it. The reason they make sail winch servos is because they do a job that nothing else does.

Steve