Shop OBEX P1 Docs P2 Docs Learn Events
Not Going the Distance — Parallax Forums

Not Going the Distance

AngDeaverAngDeaver Posts: 4
edited 2013-09-02 19:44 in Learn with BlocklyProp
I am on Chapter 4 in "Robotics with the Boe-Bot". I just measured how far my Boe-Bot goes in one minute, 8.4 inches. So using that I calculated how many seconds it would take to travel 24 inches. 24in / 8.4in = 2.86s. If a count of 1 to 41 = 1s; shouldn't I just be able to multiply 41 * 2.86 and change the count to 1 to 117? However, when I run it it falls short nearly 2 inches.
On a side note to go straight I had to adjust the P13 to 808 and the P1 is 650.

Can someone help me?

Here is the program I used:

' Example Program: ForwardOneSecond.bs2
' Robotics with the Boe-Bot - ForwardOneSecond.bs2
' Make the Boe-Bot roll forward for one second.

' {$STAMP BS2}
' {$PBASIC 2.5}

DEBUG "Program Running!"

counter VAR Word

FREQOUT 4, 2000, 3000 'Signal program start/reset

FOR counter = 1 TO 117
PULSOUT 13, 808
PULSOUT 12, 650
PAUSE 20
NEXT

END

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-09-01 18:42
    There are a couple of uncertainties in your initial calculation. The robot doesn't reach its full speed immediately nor does it stop immediately so there will be some error in the calculation. There's also the problem of the robot going slower as the batteries loose their charge.

    When attempting to get one of my robot to perform a figure 8 I couldn't get the robot to behave in a repeatable fashion until I used a voltage regulator with a higher voltage battery pack. The regulator kept the voltage at a constant level so I was finally able to set the timing needed for a figure 8. Post #3 of the this thread discusses the voltage regulator. The figure 8 video in is post #1.
  • doggiedocdoggiedoc Posts: 2,240
    edited 2013-09-02 04:07
    Another consideration in addition to the ones Duane mentioned is traction. Variability in the Bot's purchase on the flooring could be a factor.

    BTW - welcome to the Parallax forums!

    Doc
  • AngDeaverAngDeaver Posts: 4
    edited 2013-09-02 08:45
    Thank you both for your help, I made tweaks to get it to work, however I couldn't figure it out mathmatically. Would the Digital Encoder Kit help with this as well?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-09-02 13:08
    AngDeaver wrote: »
    I am on Chapter 4 in "Robotics with the Boe-Bot". I just measured how far my Boe-Bot goes in one minute, 8.4 inches. So using that I calculated how many seconds it would take to travel 24 inches. 24in / 8.4in = 2.86s.

    8.4ft / 60 sec = 24ft / x sec
    8.4x = 60 * 24
    8.4x = 1440
    x = 1440 / 8.4
    x = 171.4 sec = 2.86 min
  • kwinnkwinn Posts: 8,697
    edited 2013-09-02 19:44
    AngDeaver wrote: »
    Thank you both for your help, I made tweaks to get it to work, however I couldn't figure it out mathmatically. Would the Digital Encoder Kit help with this as well?

    Yes, it would help with anything except for slippage. If you used a separate drag wheel for the encoder it will also account for slippage.
Sign In or Register to comment.