0

Running my code with a normal 180 degree servo will move it to a user-specified angle and then hold it there. But when using a continuous rotation servo, it keeps rotating constantly for 500 <= angle <= 2500 and it stops only when set to 0 or 1500. How can I get it to hold its position like with a normal servo?

import pigpio
import time
pi = pigpio.pi()
gpio_num = 17
while True:
    print('input:')
    user_input = int(raw_input())
    pi.set_servo_pulsewidth(gpio_num, user_input)
1

You can't. That is the difference between a standard servo and a continuous rotation servo.

A standard servo moves to the commanded angle and stops. The angle is commanded by the width of the pulses being transmitted, typically 1000 to 2000 µs in length. Typically 1000 µs is 45 degrees counterclockwise, 1500 µs is centre, and 2000 µs is 45 degrees clockwise.

A continuous rotation servo moves at the commanded speed and doesn't stop until the commanded speed is zero. The speed is commanded by the width of the pulses being transmitted, typically 1000 to 2000 µs in length. Typically 1000 µs is fast counterclockwise, 1500 µs is stop, and 2000 µs is fast clockwise.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.