📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Please place all UPS 3 Day orders by 11am ET Friday December 13 📬❄️📦
0

Run a continuous rotation servo with a PWM extension board
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Run a continuous rotation servo with a PWM extension board

by rojithag on Fri Oct 20, 2017 5:50 pm

Hi, I purchased a few PWM extension boards (breakout version) - PCA9685

I want to run 2 continuous rotation servos - https://www.amazon.com/20-86oz-Continuo ... 01MSVCVVN/

The example code on the website doesn't explain how to control continuous rotation servos.

Could someone show me how to change it up so that I could tell the servos to rotate 3-4 times forward (360 degrees)
And to rotate it backwards the same amount of times


Any help would be much appreciated!

rojithag
 
Posts: 86
Joined: Thu Aug 31, 2017 2:39 pm

Re: Run a continuous rotation servo with a PWM extension boa

by franklin97355 on Fri Oct 20, 2017 8:02 pm

Continuous rotation servos have no way of telling how far they have traveled. We do have this servo with a feedback wire that might do what you want. As to control you need to find the idle position of the servo and then giving it shorter pulses will move it in one direction and longer pulses will move it in the other.

franklin97355
 
Posts: 21362
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Run a continuous rotation servo with a PWM extension boa

by rojithag on Fri Oct 20, 2017 8:06 pm

Actually I don’t need to know where to stop exactly. I could just put a timer on it and make it stop after a specific time.

I just need to know how to make it turn continuously using the PWM extension.

How would I change the code?

Thanks!

rojithag
 
Posts: 86
Joined: Thu Aug 31, 2017 2:39 pm

Re: Run a continuous rotation servo with a PWM extension boa

by rojithag on Sat Oct 21, 2017 6:55 pm

Hi, I just wanted to update the thread. I tried using the PWM extension with absolutely no luck.

I then tried using the piggpio library with no luck either.

How are these controlled? I'm very confused, why do these exist with no documentation to run them.

Any help would be greatly appreciated.

rojithag
 
Posts: 86
Joined: Thu Aug 31, 2017 2:39 pm

Re: Run a continuous rotation servo with a PWM extension boa

by franklin97355 on Sat Oct 21, 2017 7:14 pm

Did you happen to see the tutorial on the board?

franklin97355
 
Posts: 21362
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Run a continuous rotation servo with a PWM extension boa

by rojithag on Sat Oct 21, 2017 8:30 pm

I did.

I tried it with a normal Servo and it works fine.

When I connect the continuous rotation Servo, nothing happens.

How would I change this up so that it works?

rojithag
 
Posts: 86
Joined: Thu Aug 31, 2017 2:39 pm

Re: Run a continuous rotation servo with a PWM extension boa

by rojithag on Sun Oct 22, 2017 12:58 am

Code: Select all | TOGGLE FULL SIZE
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
p = GPIO.PWM(17, 50)
p.start(7.5)
try:
        while True:
                p.ChangeDutyCycle(7.5)
                time.sleep(1)
                p.ChangeDutyCycle(12.5)
                time.sleep(1)
                p.ChangeDutyCycle(2.5)
                time.sleep(1)

except KeyboardInterrupt:
        GPIO.cleanup()


I tried this, but my servo just jitters and continuously rotates sometimes.

How would I make it rotate continuously for 5 secs forwards and backwards.

Also how would I use this with the PWM breakout if that's possible.

Thanks!

rojithag
 
Posts: 86
Joined: Thu Aug 31, 2017 2:39 pm

Please be positive and constructive with your questions and comments.