Shop OBEX P1 Docs P2 Docs Learn Events
Project Idea... — Parallax Forums

Project Idea...

koolitudekoolitude Posts: 37
edited 2007-03-01 18:26 in BASIC Stamp
I would like to build a robot which can move straight ahead without referencing to a guided line... Any idea?

Is it possible for me to achieve this by using a digital compass, an acelerometer, a pair of servo wheels together with BS2?

I would like to implement PID control on the robot...
i.e. Read the compass bearing -> compare with the set point (reference direction) -> decide the output to the servos

And I would also like to implement Fuzzy logic on the robot such that the degree of vibration (when moving) can be used to correct the error.

Is it a possible idea?

By the way, I find it a bit difficult to write a PID program in PBasic:
1) negative numbers are troublesome in PBasic
2) fractions cannot be handled easily
3) the variable size is not so big.

Comments

  • ZootZoot Posts: 2,227
    edited 2007-03-01 16:27
    The easiest way to go "straight" would be to use encoders on your wheels to help determine turn radius, speed, angle, etc. Of course this is relative to the platform, not the outside world, but if you have good code then it won't be difficult to interface your "engine" with external sensors (such as a compass).

    PID is not too hard on the Stamp and there are some pretty good tricks for handling negative numbers and fractional constants.

    Here is a link to a discussion about negatives and fractional constants with PID control: http://forums.parallax.com/showthread.php?p=616844

    Here is a link to code I wrote for a PID "engine" which allows you to store your constants, offsets, etc in EEPROM tables (for different PID scenarios) and then call one set of routines to run your PID variables and constants through the mill: http://forums.parallax.com/attachment.php?attachmentid=42031

    Here is a link to Phil Pilgrim's Boe-bot with encoders geometry engine that is so brilliant I can't always follow the code: www.parallax.com/dl/docs/prod/datast/ApplyEncoder.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • FranklinFranklin Posts: 4,747
    edited 2007-03-01 18:26
    www.geology.smu.edu/~dpa-www/myrobots.html has some robots you should look at. Take a look at the hat trick video for the lourney bot, it's impressive.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.