Any Suggestions for controlling Autonomous robot speed?

Hello Guys

I am working on my first robot project. I can't think of any way to automatically and programmatically control the speed. for example I want the robot to start with a very low speed and gradually increase the speed, when an obstacle is detected, it should gradually decrease its speed.

I appreciate your help,

Thanks

I've got mine running under the control of a TV remote where I use the volume up and down keys to speed up and slow down- but the same principles would hold for doing it with a sensor or just program control at start up.

Use PWM from the Arduino outputs to pulse the motor to give its speed. I'm using a MotoMama board with a 298, where each motor enable pin (there are two, for two motors) can be PWM'd for speed.

The output on a PWM pin goes from 0 to 255. So just have some code that increases the analogWrite gradually as it pulls off, something like this, where I'm using pin5 as a PWM ~ pin....

analogWrite(5, 50);
delay(500);
analogWrite(5, 100);
delay(500);
analogWrite(5, 150);
delay(500);
analogWrite(5, 200);
delay(500);

Or have a variable called say maxSpeed and loop it thru various percentages to speed up and slow down...

HTH,

Jim

Thank you very much Jim, It was helpful

Much appreciated.

A good introduction to robot motion control

http://www.seattlerobotics.org/encoder/200011/SmallRobotMotionControl.htm