Shop OBEX P1 Docs P2 Docs Learn Events
Program for a newbie? — Parallax Forums

Program for a newbie?

DavDav Posts: 3
edited 2011-10-08 21:45 in BASIC Stamp
Hi, I'm trying to program a boe-bot for the first time but I don't know how to get started.
I'm currently trying to make it go around in a square, however, I can't get the angles right and it keeps on spinning in a circle.
Can anyone help me?
Oh, I almost forgot, I have the bs2 boe-bot.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-08 15:08
    First make sure you have copies of the "What's a Microcontroller?" and "Robotics with the BoeBot" tutorials and the "BASIC Stamp Syntax and Reference Manual". They're all downloadable from the Parallax Downloads webpage. Go to the main Parallax webpage and click on the Downloads button. You'll see other buttons for "Basic Documentation" and "Stamp Tutorials and Translations" which will get you to the download links.

    The BoeBot does not have really fine control of movement. To go in a square, the BoeBot first has to go straight forward for a little while with both servos turning at the same speed in opposite directions. Then, both servos have to turn at the same speed in the same direction for a short time depending on which way it has to rotate. The whole thing has to happen for each side and corner of the square. As is usual for programming problems (and solutions), you have to break it down into steps, get each step to work separately, then get them to work together in the right order. The "Robotics with the BoeBot" tutorial goes into some detail on how to get servos to work the way you want them to.

    You're not going to get a good square, but with careful attention to timing, you should get something close. To get finer control, you'll need something like the wheel encoder that Parallax sells for the BoeBot. That still doesn't address the problem of slippage on the floor.
  • DavDav Posts: 3
    edited 2011-10-08 16:48
    I manage to get a rectangle but not a square
  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-08 20:15
    Maybe the timing is off so the motors run a little longer in one direction. Maybe the friction with the floor is different on one axis from the other axis. Who knows? A rectangle is not bad for a second try (after circles). You'll have to do some experimenting with the time that the motors run.

    If you want more specific help than that, you'll have to provide a lot more information. One thing would be to attach your source program to a reply. Click on the "Go Advanced" button and look for the Attachment Manager button.
  • DavDav Posts: 3
    edited 2011-10-08 21:45
    Alright, I figured out the problem. One of my servos weren't configured right as was a little off. It seems to go almost a perfect square now :)
Sign In or Register to comment.