Shop OBEX P1 Docs P2 Docs Learn Events
How to make Boe-Bot turn with certain degree? — Parallax Forums

How to make Boe-Bot turn with certain degree?

HasherHasher Posts: 3
edited 2008-10-25 22:15 in BASIC Stamp
I would like to know how to make my Boe-Bot turn the degree I wish???

Example==> turn 270 degree to right

FOR counter=1 TO endValue
PULSEOUT 13, 850
PULSEOUT 12, 850
PAUSE 20
NEXT

How to get the endValue to turn 270?

Thanks in advance!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-24 22:05
    There's no accurate way to do this. The continuous motion servos use the control pulse (from the PULSOUT) to set the speed of the movement, not the amount of movement. There's some slop in this movement and the wheels can slip on the surface underneath. Without some kind of position sensor, the best you can do is to calibrate the turning angle of the BoeBot, figuring out what pulse width (motor speed) and number of pulses is needed to get the BoeBot turned as closely as possible to 270 degrees. All trial and error. There will still be some error.

    There are wheel position encoders available from Parallax that produce pulses as the wheels turn and these can be used to give feedback as to wheel position and speed. There's still the problem of slippage on the floor.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-10-25 00:00
    Hasher--

    Mike is certainly correct and I would EMPHASIZE the problem of slippage. Only in the high precision machinery world, such as in mills or lathes or whatever, do we find it possible to "turn" almost precisely.

    This bothered me greatly during my very beginning robot days. (I am still a newbie.) However, I got to thinking about it and finally asked myself this question: What turns precisely or navigates precisely in nature? The answer is easy: NOTHING. All living organisms capable of locomotion navigate to an end point via a series of trial and errors with continuous negative feedback correcting the errors.

    You might think of robotics from that perspective. If you do, it might have an impact on your sensor choices. The end point is the goal. Not falling off the cliff before you get there is the problem.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • SRLMSRLM Posts: 5,045
    edited 2008-10-25 01:35
    Take a look at this thread posted in the propeller forum. It might work with a continuous rotation servo...
  • RoboticsProfessorRoboticsProfessor Posts: 54
    edited 2008-10-25 03:39
    Depending on what you are doing, you can sometimes compensate.



    For example, I wanted my line-maze BOE-Bot to turn 180 degrees at any dead-end path. (Black line on white background)

    It kinda worked, but between the battery voltage reducing, slippage and whatever, I didn't get as close as I wanted. What I did was:

    1. Turn about 120 degrees (to make sure I was clear of the line behind me.)

    2. Do pulsout in a loop, reading the sensors after each pulsout, waiting for one or two of the left sensors (in a left 180 turn) to "see" black. Then return to the "follow the line" routine.

    I found this lets the robot pick up the line perfectly each time and take off in the new direction much more dependably and accurately.

    Code for this is at www.picrobots.com/my-line-maze.php


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard Vannoy

    Programming and Electronics Instructor
    www.PICRobots.com
    www.SailingStrategy.info
    www.TeachingTechnicalTraders.com
    ·
  • ercoerco Posts: 20,256
    edited 2008-10-25 22:15
    Hasher:

    Welcome to the Wonderful World of Robotics! They never do exactly what you intend, and they never do exactly the same thing twice. Too many variables in the real world. And you're only asking about one simple turn to a heading! Imagine the cumulative error of long range odometry: telling your robot to drive a certain distance, then turn a certain amount, several times in a row.

    It seems simple, but it's incredibly difficult and maddeningly erratic. Yet it's fun to try and learn what does and (mostly!) doesn't work. Besides being a great technical resource, this forum is also a support group for frustrated roboticists. Semper Fi!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.