Shop OBEX P1 Docs P2 Docs Learn Events
Servo Motors, please help — Parallax Forums

Servo Motors, please help

NoNo Posts: 26
edited 2008-12-03 03:41 in BASIC Stamp
Hey guys, Is it possible to have to servo motors (both a left and a right side) to turn in the same direction? I tried using

counter VAR Word


for counter = 500 to 1000
pulsout 12,counter
pulsout13, counter
pause 20
next

for counter =1000 to 500
pulsout 13, counter
pulsout12, counter
pause 20
next

-when i did it this way they spin together but in the opposite direction.

if i set the program up with two seperate counters they wont spin at the same time but will go in the right direction. sorry i cant post the actual program since im at work. but any help would be appreciated.

Is there a command i can nest to make this work? or do i have to add circuitry?

thanx in advance

Comments

  • UghaUgha Posts: 543
    edited 2008-12-02 11:58
    I'm assuming your talking about continuous rotation servos? Like those supplied with the BOE-Bot?

    If so, then take a look at them and how they are mounted. One on each side, the exact mirror opposite placement.
    You really want them to spin in opposite directions in order for the robot/whatever to go forward.

    Also, if you ARE talking about Parallax's continuous rotation servos, your ranges are too high and too low. I'd be
    worried that it'd damage the servos with that high of a range.
    750 should be dead stop for the servos, and your range of usable movement should be 650-850

    So... to make the robot move forward or backward (depending on how you have the servos mounted) at full speed
    for a short distance with no "ramping" to slowly speed up or slow down...

    for counter = 1 to 50
    pulsout 12, 650
    pulsout 13, 850
    next

    To make it go the other way, just swap it like this:

    for counter = 1 to 50
    pulsout 12, 850
    pulsout 13, 650
    next

    Now this will only work correctly with tuned servos. For instructions on how to tune the servos you need to read Robotics
    with the Boe-bot available free for download at this site, or supplied with every BOE-bot kit.

    If you meant standard servos, please ignore everything I said as I've never had a standard servo.

    Hope this helps.
  • MSDTechMSDTech Posts: 342
    edited 2008-12-02 12:00
    Try the following to get them both to turn in the same direction:
    for counter = 500 to 1000
    pulsout 13, counter
    pulsout 12, (1500-counter)
    Pause 20
    Next

    I assume this is using a BS2 for the counter values. Also if these are right and left, you do want one motor turning clockwise and the other counter clockwise for the left and right sides of a robot, like the BOE-BOT.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-12-02 12:07
    No·-

    Which PBASIC Stamp are you using?

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.

    Post Edited (Bruce Bates) : 12/2/2008 12:12:21 PM GMT
  • MSDTechMSDTech Posts: 342
    edited 2008-12-02 12:18
    I usually use a BS2. Since most servos have a 1ms to 2ms control band, the code I posted would send that range with a BS2.
  • NoNo Posts: 26
    edited 2008-12-02 13:02
    thx for the response guys. Im using PBasic 2.5.· the servo motor is a standard GWS Pico·(not contiinuious)·servo. Im using this to lift a flap via pivot. one wasnt enough to carry the wieght (well it can but it struggles when lifting), so i wanted to add a second servo to the other side. I would need one turning clockwise and the other turning counter clockwise.

    thanx again
    ·
  • $WMc%$WMc% Posts: 1,884
    edited 2008-12-02 18:37
    No

    Can You list the spec.s for Your servo,I've never used the "GWS Pico".With some spec.s this should be pretty easy to fix.Also the $stamp Your useing...


    _______$WMc%______
  • NoNo Posts: 26
    edited 2008-12-02 21:03
    SERVO (this was all parallax had on it, not much)
    http://www.parallax.com/Portals/0/Downloads/docs/prod/Servos/GWSServo.pdf
    Naro HP/STD



    BS2

    thnx
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2008-12-02 21:13
    This looks like a standard servo which should respond to the usual pulses with the pulse width (from 1.0ms to 2.0ms) representing the servo position. Your code is
    counter VAR Word
    
    for counter = 500 to 1000
    pulsout 12,counter
    pulsout 13, counter
    pause 20
    next
     
    for counter =1000 to 500
    pulsout 13, counter
    pulsout 12, counter
    pause 20
    next
    


    which would work fine if the servos were to move in the same direction. To get them to move in opposite directions, do
    counter VAR Word
     
    for counter = 500 to 1000
    pulsout 12, counter
    pulsout 13, 1500 - counter
    pause 20
    next
     
    for counter = 500 to 1000
    pulsout 12, 1500 - counter
    pulsout 13, counter
    pause 20
    next
    


    the way MSDTech suggested for a BS2.

    Post Edited (Mike Green) : 12/2/2008 9:18:21 PM GMT
  • NoNo Posts: 26
    edited 2008-12-02 21:35
    smilewinkgrin.gif· Niceee. That way seemed to work just great (Mike/MSD). thanx for all the input guys.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-12-03 03:41
    No

    A little info helps alot

    ________$WMc%___
Sign In or Register to comment.