Obstacle Avoidance Robot

Been working on an obstacle avoidance robot for a little while now. Finally had some time to get serious with it and work out some of the kinks (although I'm still not sure if they are actually solved). current issue is that it can for the most part avoid obstacles and prevent itself from getting stuck, however there are certain situations where it will get stuck on an object that is below the ultrasonic sensor that I'm using.

That's what I need help with, when all the other measures fail and my robot gets itself stuck on something that it can't see, I would like to tell it to back up and turn around. I already have the code for this and it works but I don't know how to get it to know when it is stuck? I was thinking maybe I would be able to tell it to backup and do all that when its wheels stop moving but I'm not sure if the arduino is aware when this happens or not? Should I implement another sensor?

Would love some ideas, I'm still relatively new to all this. I've only done little projects with LEDs and stuff before this lol.

Thanks,

Seth

Yes, it gets physically stuck on something like a rug or a box that is below the sensor so it can't see it and then it runs into it.
Thanks for the ideas, I'll be sure to keep messing around with it.

Hi,

well....if the ultrasonic sensor keep measuring the distance in front of the robot when it is stuck and for say, 5 seconds, the distance does not change, then you can assume with a high probability that the robot is stuck!!!

A small sub-routine should solve your problem.

duino_nano:
Hi,

well....if the ultrasonic sensor keep measuring the distance in front of the robot when it is stuck and for say, 5 seconds, the distance does not change, then you can assume with a high probability that the robot is stuck!!!

A small sub-routine should solve your problem.

Awesome idea!
I'll be sure to try that. I actually ended up adding another sensor underneath the robot to make sure it could detect any objects below it and that solved the problem for the most part. Your idea is probably the final piece of the puzzle.

Thanks!

Yes, thanks for that!

Is there another sensor I could use that has a long range, which I could use in addition to the ultrasonic sensor to compensate for its lack of range? I'm not really sure what the max range is on the ultrasonic sensor is though. I haven't had any problems with it not detecting objects in front of it so I didn't question it.

Thanks, I appreciate it!

Move the senor to a height that is just above the clearance on the chassis and aim it down a few degrees to capture objects that are taller than the chassis clearance.

Roombas use a combination to determine stuck-ness: 1. A free-spinning wheel with an encoder - if drive wheels are commanded on but caster is not spinning, then stuck. 2. If drive motor current exceeds x, then stuck.

Food for thought.

you also can use a Proximity sensor for avoiding crash into the wall. if your Ultrasonics are not providing proper value to your robot then your robot is going to move forward after that when it reaches to the wall your IR sensor get activated and you can reverse your robot.