Shop OBEX P1 Docs P2 Docs Learn Events
Going striaght — Parallax Forums

Going striaght

meburnemeburne Posts: 5
edited 2007-04-30 20:44 in Robotics
Just new to Boe Bots and am programing to go forward, straight but I get drift 2" to the left over a ten foot run10ft.

I have tried differant surfaces just in case of non flatness. Also turned the bot around and it still drifts.

I have changes numbers up and down to slow and speed up each side but I can not get it perfect.

Question then. How accurate should I expect and can some one then point me in the right direction to what I should change

' Robotics with the Boe-Bot - Boebotforwardthreeseconds.bs2
' Make the Boebot role forward for three seconds
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running"
counter······· VAR················ Word
FREQOUT 4, 500, 3000
FOR counter = 1 TO 800
· PULSOUT 13, 807········· ' left
· PULSOUT 12, 637·········· ' right
· PAUSE 20
NEXT
DEBUG CR,CR,· "Finished"
END

Cheers MArk

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-04-27 22:32
    Your accuracy will vary depending on the servos, they were not designed for this purpose and as such are not identical. Adjusting the numbers by trial and error is the quick fix but if you want better control adding an encoder to the wheels will let you count the revolutions of each wheel and dynamically adjust for the drift.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Skywalker49Skywalker49 Posts: 172
    edited 2007-04-27 22:34
    Hi Mark,

    don't expect any better results. What you need is an encoder to count (part of) wheel cycles.
    Parallax sells wheels with 8 holes and an encoder .. check this out:

    Search for ENCODER on www.parallax.com

    good luck.
  • meburnemeburne Posts: 5
    edited 2007-04-27 22:41
    I kinda thought I may be wasting my time trying to get it to go perfectly straight.

    I am very new to programing and the Boe Bots. Thanks for the info and I will update to the ENCODER when I need to be perfect. For the learning curve I think I will be ok.

    Thanks again.

    Mark
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-28 00:23
    Hello,

    One thing to remember when adjusting your values to get things to go straight…A servo can only go so fast. Adjusting the slow side to speed it up won’t work. You need to slow down the faster side to match the slower side. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • meburnemeburne Posts: 5
    edited 2007-04-28 00:32
    I was thinking of that. How do I know if I have reached max speed on one side?



    Mark
  • PARPAR Posts: 285
    edited 2007-04-28 01:18
    meburne said...

    I was thinking of that. How do I know if I have reached max speed on one side?

    Mark

    You would measure --by some method of your choice-- the speed of rotation at differing pulsing lengths, narrowing in on the threshold pulse value after which no further speed changes occur.
    You might start by decreasing the "fast" side speed (pulse length) until it matches the "slow" side speed. Then, try to increase either the slow side or the fast side a bit, to see if either change makes the bot deviate from a straight line. That process, iterated, would help you find which servo can go faster, and what the max speed of the slower servo is.
    If you are trying to obtain matching (max) speed for two servos --each one mounted on the bot turning in the opposite direction (cw, ccw) to move "forward" (or "backward"), make sure you are calibrating the relative speeds of the two servos by running one servo cw and the other ccw. And, also do this for both "forward" and "backward" driving of the bot --the two servos may have different behavior in their respective cw and ccw rotation.
    PAR
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-28 02:10
    Mark,

    When adding to one side no longer seems to make a difference you’ve probably reached maximum speed and need to start subtracting from the slow side (the side that you’re turning in that direction). Due to the nature of continuous rotation servos the maximum speed is reached rather quickly when ramping from 750 out toward a given direction and the curve is non-linear. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • WarrlokWarrlok Posts: 77
    edited 2007-04-30 20:44
    the GUIBOT program on ur parallax install disk would probly be the easiest thing to use to figure out the different speeds of the servos and ramping would also help give more adjustment through the whole rpm range ,,,being that u could adjust the speeds of the servos separately

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Problems are the "roads" of life,
    solutions are only "onramps" to the next problem



    ············································· "Brad Smith"
    ·
Sign In or Register to comment.