Shop OBEX P1 Docs P2 Docs Learn Events
Can a continuous rotation server pause and hold position briefly? — Parallax Forums

Can a continuous rotation server pause and hold position briefly?

WHallWHall Posts: 22
edited 2010-02-15 14:35 in Robotics
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

  • Marz KrishnaMarz Krishna Posts: 26
    edited 2010-02-12 22:58
    yes it can
    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
  • WHallWHall Posts: 22
    edited 2010-02-13 00:04
    Thanks Marz! I'll give it a go. I related the PULSOUT 750 command to "centering at the 12 o'clock position" per my standard servo and the "What's a Microcontroller?" workbook, but it also makes some sense that it would stop a continuous rotation servo as well.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-13 02:01
    WHall,

    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
  • Marz KrishnaMarz Krishna Posts: 26
    edited 2010-02-13 05:27
    Yeah. i just assumed you had a boe bot or sumo bot with continuous rotation servos. *** for phil's post about position feed back you could accomplish this with actuators. i don't know about the potientiometer inside continuous rotation servos, but it may be possible pull the servo's potentiometer's variable line out (solder a wire to the lead, and drill a whole in the casing to run an extra wire) and use chapter #5 from the "what's a microcontroller" book to read absolute postition of the continuous rotation servo, but don't quote me on it. i've never opened one and don't know. as for the servo you're working with, it'll give you a specific angle, and there's also a method to modifying it for continuous rotation. you have to open it and clip the tab from the servo horn gear. i don't know how you'd go about programming it to work for continuous rotation though.
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-02-13 16:05
    The modification that makes a "modified continuous rotation servo" involves disconnecting the potentiometer from the output shaft, and fixing it in its middle position. That's actually WHY a 1.5 mSec pulse will stop the rotation -- because that pulse-width agrees with the potentiometer, the servo doesn't need to drive left or right.

    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.
  • W9GFOW9GFO Posts: 4,010
    edited 2010-02-13 19:02
    allanlane5 said...
    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.

    attachment.php?attachmentid=67711

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.

    Post Edited (W9GFO) : 2/13/2010 7:48:44 PM GMT
    168 x 162 - 8K
  • WHallWHall Posts: 22
    edited 2010-02-13 19:02
    Phil, Marz and Allanlane5 - many thanks for responding. With some experimentation, I MIGHT be able to get a way with a "timed" implementation since the torque loads are negligible, and the total duration of the action I described would probably not exceed 20 minutes or so, but it might be better to investigate a stepper or encoder disk. I don't have to achieve 90 degrees exactly, but once I miss, subsequent rotations will only magnify the error. Thanks again,

    Wayne
  • WHallWHall Posts: 22
    edited 2010-02-13 19:12
    Rich, your suggestion sounds promising. I'll look into it. Best,

    Wayne
  • WHallWHall Posts: 22
    edited 2010-02-13 20:01
    Rich, could you point me to any implementations? A visual would do wonders for me!

    Wayne
  • W9GFOW9GFO Posts: 4,010
    edited 2010-02-13 21:09
    WHall said...
    Rich, could you point me to any implementations? A visual would do wonders for me!

    Wayne
    Does this work?

    attachment.php?attachmentid=67715

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
  • WHallWHall Posts: 22
    edited 2010-02-13 21:28
    Yes. I was thinking of a perpendicular orientation, so that the switch moved over the surface like phonograph needled. What a great visual.

    All the help has given me some ideas for controlling the motor via hardware or software. I really appreciate it all! Best,

    Wayne
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-13 22:00
    If you can fabricate moderately complex mechanical parts, a Geneva mechanism is another alternative. The limit switch could be triggered by the pin. The advantage is that you don't have to stop the motor at exactly the right moment to get precise 90-degree increments.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 2/13/2010 10:05:12 PM GMT
  • hover1hover1 Posts: 1,929
    edited 2010-02-14 14:07
    When I saw the animation, it reminded me of your M-Sorter tongue.gif
    I wish Parallax still sold it. shakehead.gif
    Jim
    ·
    Phil Pilgrim (PhiPi) said...
    If you can fabricate moderately complex mechanical parts, a Geneva mechanism is another alternative. The limit switch could be triggered by the pin. The advantage is that you don't have to stop the motor at exactly the right moment to get precise 90-degree increments.

    -Phil
  • kwinnkwinn Posts: 8,697
    edited 2010-02-14 15:23
    @Phil, Thanks for that link to the Geneva mechanism. It is the perfect solution to part of a project I am just starting. And here I thought I had seen just about every type of mechanism going. What a blow to the ego.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-14 18:36
    My first (and only) real-life encounter with a Geneva mechanism came many years ago when I was making frame-at-a-time movies from a computer screen. I was provided with a 16mm Bolex movie camera, which had a mechanical coupling on the outside. By rotating the coupling a quarter turn, the camera would advance the film one frame, then trip the shutter. To the coupling was attached a beautifully-machined Geneva mechanism which was run by a small gearmotor and which included a limit switch. By pulsing the driver circuit, the motor would run to open the switch, then stop when it re-closed.

    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
  • WHallWHall Posts: 22
    edited 2010-02-15 01:38
    With some experimentation to find the required pulses from the basic stamp 2, can a standard servo with 180 degrees of motion cover the same 360 ground in two directions? For my project, I need 360 degrees of motion, but not necessarily in the same direction. I like the Nubotics Wheel Watcher and its encoder, and I might *still* like to have the position feedback for better accuracy, but maybe a standard servo with a wide range of motion will get to the same goal of exposing the 0, 90, 180, and 270 degree angles. Thoughts?

    Thanks for the advice! Like I said, newbie smile.gif

    Wayne
  • W9GFOW9GFO Posts: 4,010
    edited 2010-02-15 02:17
    WHall said...
    With some experimentation to find the required pulses from the basic stamp 2, can a standard servo with 180 degrees of motion cover the same 360 ground in two directions?
    I don't think so. However you might be able to use a sail winch servo, it is a servo which is can turn a couple rotations in each direction.

    hts0785.jpg

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.

    Post Edited (W9GFO) : 2/15/2010 2:24:55 AM GMT
  • WHallWHall Posts: 22
    edited 2010-02-15 14:35
    Looks like it's either going to be a continuous rotation servo with an encoder disk or small switch reading the surface of a disk! If anyone could point me to some code that reads an encoder disk, I'd appreciate it. Once I can get the basic idea, I can adapt it.

    Wayne
Sign In or Register to comment.