Shop OBEX P1 Docs P2 Docs Learn Events
remembering moves — Parallax Forums

remembering moves

n5hoon5hoo Posts: 4
edited 2007-11-25 03:51 in Robotics
If I use a tactile switch to GOSUB forward, for instance.· How can I get it to remember the move?· Like, the direction and the distance. So that I could then use that info to run it in auto.
This is on a boe-bot.

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-11-22 16:10
    Hi, you would need an encoder to keep track of the distance and a variable monitoring the switch to keep track of direction. You would then need a record and playback routine. During record you could write the direction and distance to EEPROM·then read EEPROM back during playback,Data direction byte,distance word,direction byte,distance word etc.

    It is likely to begin with that movement/distance would only be in a forward direction so a sample data may look like "F",200,"L",0,"F",50,"R",0,"F",2000

    hope this helps

    Jeff T.
  • DgswanerDgswaner Posts: 795
    edited 2007-11-22 22:28
    I've tried this with out encoders and it can actually work quite well. forward was not just turning on the motors it was turning on the motors for 2 seconds. turning was done by turning on one motor for a specific amount of time. I tuned it in so 1 forward command would move the bot about 1' one turn command would turn the bot 45deg. if you've ever played with a big track it's similar to how it functions. for example F,F,F,F,R,R,F,F,F,F,R,R,F,F,F,F,R,R,F,F,F,F would make a 4' square. this works well if every thing is laid out in feet. Of course this is usually not the case so it does have it's issues. you could have make finer adjustments for better results. and I don't think you'll get near the accuracy of encoders.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • n5hoon5hoo Posts: 4
    edited 2007-11-23 03:13
    Thanks for the response, Jeff. In my situation, it appears that a real encoder that attaches to the motor shaft wouldn't be feasible.... but I

    could probably mount a homemade target to each drive wheel...

    ·Do you know where I could access some pbasic of examples of reading

    a homemade encoder on each of two wheels?

    Thanks,

    ·Dick Miller

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··· As decent Americans, we need to pray for our troops

    who are in harms way.· We need to pray for The President,
    and for congress, that they might also pray for wisdom.
    ·Our men and women who go off to war, are knowingly
    putting themselves at risk.· They love America.· Jesus
    said, "No greater love hath any man than this, that he
    lay down his life for a friend."· Our service men and women,
    love us so much, as Americans, that they go ahead and
    take the risk of their lives.
    ·God Bless 'em!
    Semper Fi!
    Dick Miller 11/22/2007
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-24 02:55
    Dick,

    Have you looked at the BOE Bot Digital Encoder Kit?

    -Phil
  • n5hoon5hoo Posts: 4
    edited 2007-11-25 03:51
    Phil,

    Thanks a lot! Boy did you save me an awful lot of research and experimentation.

    Thank you,

    Dick Miller

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··· As decent Americans, we need to pray for our troops

    who are in harms way.· We need to pray for The President,
    and for congress, that they might also pray for wisdom.
    ·Our men and women who go off to war, are knowingly
    putting themselves at risk.· They love America.· Jesus
    said, "No greater love hath any man than this, that he
    lay down his life for a friend."· Our service men and women,
    love us so much, as Americans, that they go ahead and
    take the risk of their lives.
    ·God Bless 'em!
    Semper Fi!
    Dick Miller 11/22/2007
Sign In or Register to comment.