Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot help!? — Parallax Forums

Boe-Bot help!?

Dan TaylorDan Taylor Posts: 207
edited 2008-04-03 23:02 in Robotics
Hey guys,
I just don't get why this makes the Boe-Bot go backwards,

PULSOUT 13, 650
PULSOUT 12, 850

And this·makes it do a left turn,

PULSOUT 13, 650
PULSOUT 12, 650

And this makes·it take a·right turn,

PULSOUT 13, 850
PULSOUT 12, 850

Cause I mean if you send the same amount of pulses to each motor wouldn't it go forward?
Sorry I'm new to the Boe-Bot so please help!






·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-03 19:35
    The servos are mounted in opposite directions (on either side of the BoeBot) so one has to go in one direction and the other in the opposite direction for the BoeBot to move forwards.
  • Dan TaylorDan Taylor Posts: 207
    edited 2008-04-03 21:32
    But how do you make one turn the opposite direction to make it go forward?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
  • ZootZoot Posts: 2,227
    edited 2008-04-03 22:23
    PULSOUT 13, 850
    PULSOUT 12, 650


    The above would be forward. Remember one motor is "mirror image" of the other -- it's mounted "flipped" on the Boe-bot chassis. So you have to run one motor "forward" and one "backward" to go forward because the "backward" motor *is* backward.

    If it's too much, you could put your "motor out" commands into a subroutine that flips the value for you, i.e.

    motor1 PIN 13
    motor2 PIN 12
    mspeed VAR Word
    m1speed VAR mspeed.BYTE0 ' these will hold "desired" motor speed: 128 = stopped, > 128 = forward, < 128 = backward
    m2speed VAR mspeed.BYTE1
    counter VAR Byte
    
    DO
    
    FOR counter = 0 TO 100
    m1speed = 128 ' stopped
    m2speed = 128 ' stopped
    GOSUB Send_Motors
    NEXT
    
    FOR counter = 0 TO 100
    m1speed = 255 ' full speed ahead
    m2speed = 255 '
    GOSUB Send_Motors
    NEXT
    
    FOR counter = 0 TO 100
    m1speed = 0 ' spin
    m2speed = 255 '
    GOSUB Send_Motors
    NEXT
    
    FOR counter = 0 TO 100
    m1speed = 180 ' approx half speed forward
    m2speed = 180 '
    GOSUB Send_Motors
    NEXT
    
    LOOP
    
    Send_Motors:
      PULSOUT motor1, ( m1speed - 128 + 750 )
      PULSOUT motor2, ( 128 - m2speed + 750 ) ' this motor is "flipped"
      PAUSE 10 ' or whatever pulse padding you need to keep servos smooth
      RETURN
    
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • Dan TaylorDan Taylor Posts: 207
    edited 2008-04-03 23:02
    Ok, thanks, that helps alot!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
Sign In or Register to comment.