Shop OBEX P1 Docs P2 Docs Learn Events
detecting if the bot is moving... — Parallax Forums

detecting if the bot is moving...

stamp_demonstamp_demon Posts: 69
edited 2005-06-14 20:38 in BASIC Stamp
Is there a way to use the wheel encoders to detect if the wheels anr moving, or jammed.. and not moving??

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-06-14 02:35
    This could be done·using RF modules to report the count of the encoders with a time schedule set up.· Basically you are going to report the variable serially using the serout command using the RF modules.· Here is a link to our RF modules: http://www.parallax.com/html_pages/products/communication/rf_modules.asp·.·

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    [noparse][[/noparse]url]Http://www.parallax.com[noparse][[/noparse]/url]

    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-14 02:46
    Hello,

    ·· If you just need to detect it on the BOT itself, you could just detect when the pulses stop.· What exactly did you need to do?



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • stamp_demonstamp_demon Posts: 69
    edited 2005-06-14 03:24
    What I'd like to do is to find a way, threw software to detect if the bot is moving, or not. So if the bot gets jammed up somewhere, he could then back, or go forward, to get unjammed......
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-06-14 05:38
    stamp_demon -

    There are essentially two relatively simple methods to accomplish what you are trying to do. In no case is there a software-only solution, as one needs to sense some external conditions to determine whether the 'bot moving or not.

    The wheel encoder technique (noted in a prior post) is one way which will usually provide both the speed and direction (forward or reverse) of the wheels, and thus the speed and direction of the robot. This method will fail however if the wheels are slipping, as might happen if the 'bot were jammed against a wall and the floor was highly polished hardwood or (wet) linoleum. The indication presented to the program will be that the 'bot is moving along at a merry pace, but there will be no real motion relative to the outside world.

    The second technique involves sensing some dynamic characteristic of the motor, and basing your 'moving or not?' decision on that. The easiest parmeter to measure or sense is the motor current. The motor current technique can be done in one of two ways.

    One can measure the voltage drop across a small value (higher wattage) resistor that is in series with the motor supply line. The two leads from the resistor are the input to an ADC, and that ADC output (voltage) is input to the Stamp. There is a slight voltage loss to the motor as the motor supply voltage is reduced by the voltage dropping effect of the current sense resistor.

    Alternatively, one can use a Hall Effect sensor (see Allegro Micro, ACS704 typical) to sense the currrent draw, and the output of that sensor can be read by an ADC and the output of the ADC is input into the Stamp. There are generally no losses in using this technique. Again, the Hall Effect technique will fail if the wheels are slipping, as a wheel that is slipping will show a low current usage.

    How does one overcome this slippage problem? Sensing a trailer wheel provides the answer. A non-driven wheel with an encoder on it will only indicate motion if the 'bot is actually moving. Alternatively a trailer wheel might have a voltage generating tachometer (think bicycle generator/dynamo) on it which also might be sensed.

    Regards,

    Bruce Bates
  • inakiinaki Posts: 262
    edited 2005-06-14 11:36
    You can use an accelerometer to check motion.·You will detect if the robot is stopped or stuck, even if wheels are rotating.

    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-14 20:06
    Dave Andreae (Parallax) said...
    This could be done·using RF modules to report the count of the encoders with a time schedule set up.· Basically you are going to report the variable serially using the serout command using the RF modules.· Here is a link to our RF modules: http://www.parallax.com/html_pages/products/communication/rf_modules.asp·.·

    Dave
    Dave, Im not sure how an RF module would be applicable, I didn't see him seeking to communicate the information off-bot.

    As Bruce and inaki show there are several different ways to do this. Heres a quick rundown (though there are probably more ways of doing in)
    1) wheel encoder (hall effect or optical)
    2) accelerometer
    3) current sensing the motor (a stopped motor draws more current than a running one, I have a reference circuit for this, ask and I will provide it to you)
    4) a sensor which detects movement, I am specifically thinking of an optical mouse that you interface with the stamp (via ezMouse) and whenever mickey data is transmitted your bot is moving (mickey is the measurement of mouse movement, yes this was some engineer's idea of a joke).

    Post Edited (Paul Baker) : 6/14/2005 8:10:13 PM GMT
  • dandreaedandreae Posts: 1,375
    edited 2005-06-14 20:15
    stamp_demon said...
    What I'd like to do is to find a way, threw software to detect if the bot is moving, or not. So if the bot gets jammed up somewhere, he could then back, or go forward, to get unjammed......
    Paul Baker said...

    Dave, Im not sure how an RF module would be applicable, I didn't see him seeking to communicate the information off-bot.
    Paul,
    Using the RF modules will allow us to report if there is any movement coming from the encoder using the debug terminal, therefore letting us know if the Boe-Bot·has stopped.· We also offer the Boe Dar software using the Surelink modules that visually tracks the Boe-Bot on the PC.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    [noparse][[/noparse]url]Http://www.parallax.com[noparse][[/noparse]/url]

    ·
  • NewzedNewzed Posts: 2,503
    edited 2005-06-14 20:25
    Dave, what is the Boe Dar?

    Sid
  • dandreaedandreae Posts: 1,375
    edited 2005-06-14 20:30
    Here you go Sid, here is a link for·the Boe-Dar software:· http://www.parallax.com/html_pages/resources/custapps/app_Boe-Dar.asp

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    [noparse][[/noparse]url]Http://www.parallax.com[noparse][[/noparse]/url]

    ·
  • NewzedNewzed Posts: 2,503
    edited 2005-06-14 20:38
    I gotta·have one of those jumpin.gif

    Sid
Sign In or Register to comment.