Can a continuous rotation server pause and hold position briefly?
Please forgive the newbie question, but I've searched the forums and haven't found a conclusive answer. I'm working on a project that requires a servo that will sequentially rotate 90 degrees, stop and hold that position briefly before rotating in the same direction and pausing briefly again. Can this "rotate 90 degrees, hold, repeat" behavior be accomplished over several iterations in PBASIC with a continuous rotation servo, or do this require a stepper motor? I understand how to use PBASIC to rotate a servo (with stoppers) left and right from my Board of Education lessons, and how I might move a continuous rotation servo in one direction or the other, but not how I might rotate, then stop and hold a position for a few seconds at a time. Any help would be appreciated. Thanks!
Comments
you just:
PULSOUT SPEED ' your desired speed
PAUSE TIME ' the amount of time it takes to rotate 90 degrees (this does not stop servo rotations)
PULSOUT 750 ' at this pulse the servo stops. above this pulse the servo spins in one direction. below this pulse the servo spins in the other direciton
PAUSE TIME ' this is the amount of time you want to stay at 90 degrees. it can be a different variable than the first TIME variable.
if you're trying to multitask then buying and equipping encoders for the wheel will let you know how much they rotated.
or using a counter is cheap workaround if you can time you're code. I don't see anything about a hardware counter on the bs2, so you'll probably just need to time your code for the cheap way to do it.
Post Edited (Marz Krishna) : 2/12/2010 11:06:01 PM GMT
You have to realize, though, that a continuous-rotation servo has zero active holding torque with a pulse width of 750 = 1.5 msec (i.e. there's no restoring force applied against external shaft displacements). If your load is unbalanced and is able to overcome the gearbox friction, it will rotate the shaft without a struggle from the motor.
Also, you will need some kind of position feedback, since rotating 90 degrees repeatably is impossible with just timing.
-Phil
So attaching a wire to the potentiometer will not achieve anything.
You could use a continuous servo in this fashion, but as the battery wears down the speed slows, so you won't get exactly 90 degrees each time. A stepper motor probably would get you more reproducible results.
Another approach is to use an encoder disk to read the position of the output shaft.
Something really simple would be to use a microswitch and a disk with four notches around the edge. The switch would ride the edge of the disk and turn "off" at each notch. Depending on the switch used it may also help to hold the position when engaged in the notch.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Post Edited (W9GFO) : 2/13/2010 7:48:44 PM GMT
Wayne
Wayne
Wayne
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
All the help has given me some ideas for controlling the motor via hardware or software. I really appreciate it all! Best,
Wayne
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 2/13/2010 10:05:12 PM GMT
I wish Parallax still sold it.
Jim
You can buy these mechanisms pre-fabbed from W. M. Berg, but I'm sure they're breathtakingly expensive. It'd be fun to try making one, though.
-Phil
Thanks for the advice! Like I said, newbie
Wayne
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Post Edited (W9GFO) : 2/15/2010 2:24:55 AM GMT
Wayne