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 ... BANNED/
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!
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.
- rojithag
- Posts: 86
- Joined: Thu Aug 31, 2017 2:39 pm
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Run a continuous rotation servo with a PWM extension boa
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.
- rojithag
- Posts: 86
- Joined: Thu Aug 31, 2017 2:39 pm
Re: Run a continuous rotation servo with a PWM extension boa
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!
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
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.
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.
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Run a continuous rotation servo with a PWM extension boa
Did you happen to see the tutorial on the board?
- rojithag
- Posts: 86
- Joined: Thu Aug 31, 2017 2:39 pm
Re: Run a continuous rotation servo with a PWM extension boa
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?
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
Code: Select all
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()
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!
Please be positive and constructive with your questions and comments.