# Calculating individual wheel velocities from a desired angle in a differential wheeled robot

I am working on a simulation of a two-wheeled robot, and at present am driving it by setting each individual wheel's velocity. The robot is similar to an ePuck: What I would like to do is set an initial (and constant) overall speed for the robot, and simply command it to turn by a specified angle while moving. At this point, I'd like to keep the model simple and not worry as much about acceleration.

Essentially, what I would like to do is command it to turn by 90 degrees, as shown in the next picture. On that basis, with a constant speed on the forward motion of the body itself, what I'd like to know is how to calculate the appropriate velocity of each wheel separately. I'd looked into some existing models that go into differential equations here and here, however I wasn't able to understand if it were possible to find the values that I'm interested in.

• How can the body have constant velocity and turn? Did you mean constant speed? Are you just trying to turn, or are you trying to follow some path? – copper.hat Oct 8 '13 at 23:01
• Perhaps I meant constant speed. Essentially I want the robot to overall move at a constant pace and reorient itself to its new direction as it is moving. Worst case I could stop it and spin it, but I'd rather avoid that. – the_e Oct 8 '13 at 23:11
• If the exact path is not crucial, just speed up the outer wheel by some amount and slow the inner wheel by the same amount. – copper.hat Oct 8 '13 at 23:14
• Exact path isn't crucial, but I would like to turn this into a simple function that would take an angle as a parameter and set the wheel velocities appropriately. I may need it to turn to any angle between 0 and 360 deg as it is moving. – the_e Oct 8 '13 at 23:16
• Do what I said above, then the device will yaw at an easily computed rate, so by controlling the time you can turn to whatever angle you want. – copper.hat Oct 8 '13 at 23:20

Let $W$ be the distance between the points of contact of the two wheels. If you want to turn the (really neat) vehicle through an angle of $\theta \text{ }$radians, then the outer wheel must travel a distance $W\cdot \theta \text{ }$farther than the inner wheel.
If the radius of each wheel is $R$, then the outer wheel must rotate on its axle through an "extra" angle (relative to the inner wheel) given by, in radians:$$\theta_{extra}=\frac{W\cdot \theta}{R}$$If you want to work in angular velocity and time, assume that you can add an angular velocity $\omega_{add}$, in radians per second to the outer wheel for T seconds. Then to turn through an angle $\theta$ $$T=\frac{W\cdot \theta}{R\cdot \omega_{add}}$$ If you can "add" positive or negative angular velocity, you could change the speed of just one wheel, say the left one; add speed to turn right, and reduce speed to turn left.
• So if I understand correctly, the angular velocity updates to each wheel can be found by solving for $\omega_{add}$? And, according to @RossMillikan, the outside wheel is +0.5*$\omega_{add}$ and the inner would be -0.5*$\omega_{add}$? – the_e Oct 9 '13 at 1:09