Thursday, November 10, 2011

PROGRAMMING - DIFFERENTIAL DRIVE

What is a Differential Drive Robot?

Differential drive is a method of controlling a robot with only two motorized wheels. What makes this algorithm important for a robot builder is that it is also the simplest control method for a robot.

The term 'differential' means that robot turning speed is determined by the speed difference between both wheels, each on either side of your robot. For example: keep the left wheel still, and rotate the right wheel forward, and the robot will turn left. If you are clever with it, or use PID control, you can get interesting curved paths just by varying the speeds of both wheels over time. Dont want to turn? As long as both wheels go at the same speed, the robot does not turn - only going forward or reverse.



The differential drive algorithm is useful for light chasing robots. This locomotion is the most basic of all types, and is highly recommended for beginners. Mechanical construction, as well as the control algorithm, cannot get any simpler than this.


Note that this algorithm doesnt just work for wheeled robots, but is also the same algorithm you must use for tank tread type robots and biped robots. For examples of differential drive robots.

How to Use This Algorithm
Place two motorized wheels on your robot, one on either side. Send your move commands to the motors by either using a motordriver or H-bridge. Or if you are using servos, just send the required pulse width. Note that this algorithm works great with the photovore algorithm. (last sentence not for newbies).

pseudocode:
    input sensor reading
    make decision based on sensor reading
    do one of below actions:
    to drive straight both wheels move forward at same speed
    to drive reverse both wheels move back at same speed
    to turn left the left wheel moves in reverse and the right wheel moves forward
    to turn right the right wheel moves in reverse and the left wheel moves forward

    Or if you are not using sensors, you can just connect your remote to this DD of yours and you will have a remote controlled car to gift to your little brother or sister maybe (I don't know how much RC cars are famous among girls, but a hand-made RC car just sets a lil boy ON :D)

My robot soccer team of custom differential drive robots:

And finally my favourite tapebot:

No comments:

Post a Comment

Feel free to point out flaws and even more free to appreciate :D