Software > Software

How to stop a continuous rotation servo?

(1/5) > >>

Eithman1:
I have modified a continuous rotation servo but even after I exit where it is being sent a pulse, it continues to go in that direction. Other than transistors or something physical, is there any way I can just stop the servo after a set amount of time in the code? Any help would  be really appreciated. Thanks!

newInRobotics:
To stop it You have to set its speed to 0.

Eithman1:
Ive read that sending a Pulse Width of 1.5 ms will stop it. But it did not give any example code on how to achieve this. I can not find any on google either. Could anyone please give me an example code of how to do this or a link to one. I would really appreciate it. Thank you!

jkerns:
You modified a "standard" servo for continuous rotation?

You are sending a pulse now, right? So you should already have the code you need to send the pulse, right?

Large pulse widths cause it to rotate one direction, small pulse widths cause it to rotate in the other direction and somewhere in between it will (nearly) stop. Exactly what pulse width will make it stop will depend on where you set the potentiometer in your servo. A simple experiment with different pulse values would be in order.

Duane Degn:

--- Quote from: Eithman1 on April 22, 2013, 10:56:04 AM ---I can not find any on google either. Could anyone please give me an example code of how to do this or a link to one.
--- End quote ---

It would help to know what microcontroller you're using.

As jkerns suggests, sometimes the pulse length needed to stop a CR servo isn't exactly 1.5ms. Depending on how you modified the servo (it might be a good idea to tell us) you can use the potentiometer to set the zero point while the uC is sending its 1.5ms pulse. If you used the two resistor technique the pulse length needed to stop the servo may not be exactly 1.5ms. In this case, you'd need to find the right pulse length by trial and error.

Servo need a pulse every 20ms whether or not they are moving. Depending on the uC and servo library you're using, these refresh pulses may be taken care of for you in the background.