# Why wouldn't my robot stop?

I am working on an Arduino based robot which engages a braking mechanism detecting anything in front. I was using an ultrasonic sensor, to detect obstacles which worked well while the robot was on my table (i.e under construction). But when I ran it on the ground, it doesn't stops and crashes.

The robot is programmed as if anything is detected 50 cm ahead if the robot, the braking mechanism stops the wheels. But when testing, the robot just wouldn't stop.

My robot is running at an average 7.5m/s . Thinking that doppler's effect might have rendered my sensor useless, I tried a little IR sensor I had lying around (range 25 cm approx), but that didn't work as well.

What am I doing wrong here?

7.5m/s is pretty fast for a robot, but still not that much compared to speed of sound (approx. 330m/s), so Doppler effect may introduce some error to measurments, but not critical. The point is that if you set detection distance to only 50cm, your robot has only some 66ms to:

• perform the measurment
• communicate with the sensor, or make a AD conversion
• run the algorithm
• send a command to motor driver
• stop motors and decelarate

Even if it starts braking immidately, its inertia may be to big to decelerate completely before cruching into the obstacle. Would a car driving 7.5m/s (27km/h) stop in a distance o 0,5m?

Suggested soultions:

• Try increasing a detection distance
• Try using a IR sensor with a digital interface - they measurment times are much lower than in US sensors
• If you have to brake really quickly, think of using additional mechanical brakes

If the speed of the robot is 7.5 m/s. then it is very difficult to implement a braking. And yes doppler effect is being rendered.IR sensor will work, but implement braking by not just stopping the motors.

Your is having high moment of inertia while moving at speed you mentioned So you can rotate motors in opposite directions. but what you can do to solve the problem is you can calibrate the the robot

Firstly at low speed and check if the braking is applicable at low speeds or not. And If not we can work on that.

Secondly if the braking is working fine at low speeds say 50 cm/s. Then you can slowly increase the speed of the robot. Now, you can decrease the speed of bot via PWM in motors.

• I cannot compromise on the speed of the motors. My robot has to be a fast one. My motor driver has a brake pin which stops the motors, I'm using that only and it works fine with low and medium speeds. – YaddyVirus Jun 3 '16 at 6:33
• do not compromise, but initially try with low speed you that you will know the threshold. – Abhijeet Kumar Srivastava Jun 3 '16 at 6:38