PDA

View Full Version : detecting if the bot is moving...



stamp_demon
06-14-2005, 08:50 AM
Is there a way to use the wheel encoders to detect if the wheels anr moving, or jammed.. and not moving??

dandreae
06-14-2005, 09:35 AM
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 (mailto:dandreae@parallax.com)
Http://www.parallax.com

ˇ

Chris Savage
06-14-2005, 09:46 AM
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 (mailto:csavage@parallax.com)

stamp_demon
06-14-2005, 10:24 AM
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 Bates
06-14-2005, 12:38 PM
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

inaki
06-14-2005, 06:36 PM
You can use an accelerometer to check motion.ˇYou will detect if the robot is stopped or stuck, even if wheels are rotating.

ˇ

Paul Baker
06-15-2005, 03:06 AM
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

dandreae
06-15-2005, 03:15 AM
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 (mailto:dandreae@parallax.com)
Http://www.parallax.com

ˇ

Newzed
06-15-2005, 03:25 AM
Dave, what is the Boe Dar?

Sid

dandreae
06-15-2005, 03:30 AM
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 (mailto:dandreae@parallax.com)
Http://www.parallax.com

ˇ

Newzed
06-15-2005, 03:38 AM
I gottaˇhave one of those http://forums.parallax.com/images/smilies/jumpin.gif

Sid