Once we got our robots moving with a differential drive system we learnt lots about what it would mean to control it precisely – we were forced to explore the geometry of the robot. In part this is also a function of the fact that we’d abandoned the cartesian grid. We couldn’t tell our robot to go to position (X,Y) any more because this position didn’t exist in the robots world – all that exists were the steps taken by each motor. This also meant that every movement had to be described by these relative steps taken by each motor.
Lets look at the very basics of this geometry.
If we run one motor (say the right motor) forward until we will eventually describe an approximate circle of any size at any point along the line of the axis with a centre point more or less at the position of the other wheel.
Doing this makes it clear that even making one turn requires some simple maths. We will have to work out how far the wheel travels in one revolution and 2048 steps. Then we will have to work out the circumference of the circle described by the wheel. By dividing the circumference of this circle by the travel per revolution of the wheel we work out how many times the wheel will have to travel in a full revolution for each complete circle made by the robot. Then we can multiply the number of circles by the number of steps. We can tell the stepper motor to move that number of steps to complete a circle around its other wheel.
This movement can be represented by the ratio of wheel speeds 0:1
In addition if we move one motor forward and one motor backward 2048 steps at the same time we will describe a set of circles along the line of the axis with diameter between zero and the infinity with the centre at the mid point between the wheels.
This movement can be represented by the ratio of wheel speeds 1:-1,
It doesn’t take much of a genius to also add that the ratios 1:1 and -1:-1 describe straight lines in either directions.
Any interesting conclusion might be that in a differential drive system all possible circles are described by a ratio of wheel speeds between 1:1 and -1:-1.
The really interesting extrapolation of this is that if all the set of possible circles are the function of a ratio between the relative speeds of the wheel all possible arcs are a function of rates of acceleration between the two wheels.