## Kinematic model of a differential drive robot

Differential drive configuration consists of two wheels which are in-line with each other. Both are independently powered so the desired movements will rely on how these wheels are commanded. It is probably the simplest approach and that is why its use has become widespread among most of the robotic competitors. In this post a kinematic model for this configuration will be presented and applied to a simulation carried out in Simulink. The resulting system takes voltage as a motor input, hence the rotational speed of the wheels may vary and so will the robot’s position whose central point is represented in a Cartesian plane (XY).

Since the motor voltage is regarded as the input of the system, a DC motor simulation has been deemed necessary. For those of you who are  only interested in the Kinematic model and/or have a good insight into DC motors, you can skip this part.

In a nutshell, a DC motor is an electro-mechanical device which, as its name suggest, converts electrical energy into mechanical energy. Its working principle lies in the Lorenz force created as a consequence of having an electric current going through a conductor which is placed within an external magnetic field. The electrical diagram of a DC motor with permanent magnets and the differential equations that describe its dynamics are indicated bellow:

From these equations we can notice that there is a proportional relationship between the current in the winding and the rotor torque (K_i) and it also exits a correspondence between the back EMF and the rotor rotational speed (K_v). The torque is exerted to accelerate the rotor and ultimately this mechanical power will be transmitted through a gear set to the wheel. Therefore part of the torque will cause a rotational acceleration of the rotor, depending on its inertia (J_m),  and the other of the energy will be dissipated in the bearings according to its viscous friction (B_m) and the rotational speed. As mentioned, our application will require certain reduction in order to adapt the speed (reduced) and torque (increased) and meet the wheel kinematic needs. Therefore, what we would be interested in modelling would be:

If we study the gear reduction effect in more detail we will happily realise that not only does it adapt our mechanical variables but it also reduces quadratically the dynamic effect of the wheel inertial and viscous friction on the motor. This equations express this idea precisely:

At this point we have the whole set of equations that we need to describe the motor-wheel dynamics. So, we are pretty much ready to arrange all the equations and apply Laplace transform. Working out the calculations, the outcome could be represented in a block diagram as follows:

Let’s recap, our target was to relate the voltage with the speed. The input of this diagram is the voltage of the motor (V) and it has as outputs the linear speed generated by the rotation of the wheel (m/s) and its displacement (m), which is merely its integral. The large transfer function relates the rotor torque with the rotor speed considering the wheel dynamic influence and also the gear efficiency. Actually the diagram above constitutes a subsystem of the kinematic model, we will need two of these for a differential drive robot. I would like to mention that at the end of this post I will attach a copy of the Simulink and Matlab files containing all the information needed to develop and follow the stated ideas.

Now that we are able to control independently the speed and/or position of each wheel, let’s study what kinematic equations exist for our robots to perform the desire trajectories. The kinematic model of a differential drive robot is pretty forward indeed.

The image above depicts an example of a robot turning around a certain point due to a difference in the linear velocity of each wheels. Where:

• D is the distance between wheels.
• V is the robot speed.
• V_r and V_l, are the linear speed of the right and left wheels, respectively.
• R is the wheel radius.
• C is the turning radius.
• W is the rotational speed of the robot.

The average speed and rotational speed of the mobile platform are quite simple to calculate.

Bearing in mind that the linear velocity is the cross product of the rotational velocity and the distance from the turning point to the centre, in other words the turning radius. As we just need its absolute value:

This is it, there isn’t much mystery in the kinematic model of a differential drive robot. What I did next was to  write down all this equations in Simulink and related the different blocks. Therefore, we could track the location of the centre of the robot.

The subsystem at bottom of the picture represents the position of the robot in function of its angle through time. The good thing of having a dynamic model of the motors is that it would allow us to design theoretical regulators in order to improve its transient response. Back to the model we could roughly analyse the influence of the construction parameters. For instance, widen the chassis or reducing the diameter of the wheels.

It is quite obvious that a complete model would not neglect the effect of the forces that are exerted while the robot is in motion. Unfortunately, a dynamic model entails higher complexity but it might be worth as it would provide precious information and enhance the reliability and consistency of the model. Even an ideal simulator is likely to neglect uncertainties that arise from model inaccuracies, other considerations can be added; however, the problem is already challenging. Under this circumstance the designer has to consider matters such as the location of the centre of mass, weight transfer, friction, centripetal forces,…

In the real world if we want to put this into practice we should have a pretty accurate method to calculate the speed of our robots, for that purpose there are encoders. Jorge’s designs are characterized by simplicity, as well as a remarkable performance, and in order to supply a constant voltage reference to the motor driver his approach relies on a DC/DC step-up converter. In this case, I am not sure if any correspondence might be determined by ensuring a constant level as the current variations for the same voltage input will cause a variation of the EMF. In any case, the encoders work quite well for motion control, nevertheless they are prone to accumulate small angle errors. In order to deal with this issue, there are techniques which combine the best of the encoders (linear motion) with other sensors, like a gyroscope to figure out the orientation more accurately.

The files included to successfully run the example in MATLAB are a .m containing the motor-wheel parameters, this file should be executed first, and a .mdl to be open in Simulink. If you have any questions feel free to ask.

The motor modelling equations and diagrams have been extracted from the Book:  Platero C., Apuntes de Regulación Automática I, Servicio de Publicaciones EUITI-UPM, 2006.

Visitas :147793

Both comments and pings are currently closed.

### 15 Responses to “Kinematic model of a differential drive robot”

1. uday says:

• Raul says:

Hi,

I am afraid that in order to solve any doubts you have about it, I will have to know what they are first. Please, provide more specific information regarding your queries.

Cheers

2. BHARGAV says:

hello sir ,it was really fantastic and iwill be very happy if you mail the actual content to me ,as i recently joined in the robotic society and it will surely be helpful to people like me

3. Raul says:

Hi Bhargav,

Thanks for your compliments. I reckon in the second to last paragraph there is a link which will allow you to download all the files. You will need a version of Matlab to run it.

Cheers,

Raul

4. John says:

What tool is used to create the image http://webdelcire.com/wordpress/wp-content/uploads/2011/02/graph.jpg ?

5. Raul says:

Hi John,

The software is Autodesk Inventor, but for this example its use is a bit of cracking a nut with a sledge hummer.

Cheers

6. nasyir tamara says:

Thanks for the sharing, it is good enough to know the basic of DDMR (differential driven mobile robot). but i still have a question about the input…what are they? is it the x,y target or something else? because when i’m using the constant input (not step input) with different value it also conduct the elliptical trajectory, but when it is in the same value. it conduct a straight line.i think it is OK whether using step value of constant..again is it xy target of any other input??

7. Raul says:

Hi Nasyir,

I am glad you find the example helpful. The step functions, inputs of the system, simulate the voltage applied across the motors of your robot. XY is a grid coordinates measure in meters that draws the central point of the robot. If you maintain a constant inputs, with same magnitudes, you will see that a line will be drawn. However, if the constants differ then you will get a circle. It might give you the impression that the actual shape is an ellipse but that is the scale selected for the axis. The model should allow you to feed any function as an input, usually the voltage is modulated with a signal at a constant frequency.

Hope this helps and sorry about the late response,

Raul

8. Mohan says:

What is the purpose of the saturation blocks in the Simulink block diagrams?

9. Raul says:

Hi Mohan,

The saturation blocks prevent from computing the loop with values greater than the max voltage the motors can handle.

10. Mohan says:

Thanks for your response Raul. You have done a great job with this model!

One other question … even though you label this a “kinematic model”, haven’t you included dynamics by incorporating the motor models for the two wheels, with their attendant delays. In fact, we could add a load torque downstream of the gearing to represent the frictional resistance to the wheels on level ground. But for the fact that we would have to assume a mass distribution for the robot and a coefficient of friction, it would be a good first step towards a full dynamic model. Additionally, wheel encoders and a PI controller would be additional inclusions that would move further towards a complete model (assuming that the actual motors we use has an associated motor controller and is not running open loop!).

I am still puzzled about one aspect of the circular plot you get. A circle will be generated if the radius of curvature is constant throughout the run, which requires both wheels to be at constant velocity. However, if you plot the left or right wheel velocities, one can see the transient as the velocity climbs to its final steady state. Is it true then that it only appears to be a complete circle because of the relatively short duration of the transients?

11. Raul says:

Hi Mohan,

Your observations are very much appreciated. To begin with your last paragraph, you are right. If you have a look at the response time is simply neglectable in comparison with the simulation time. Moreover, that difference is minimised as it is a mathematical model and both motors are identical with the same regulator we obtain the same transient slopes. Hence the acute difference will be produced since the inner wheel has reached the steady state value until the outer gets to its desired value (I would say a few tens of milliseconds, based on the radius and final value).

I guess when I am talking about kinematic model, I refer to a set of mathematical equations that into account the whole picture things like, the value and position of the center of gravity, moment of inertia, … All of them concerned to the robot and not to individual parts. My purpose was to focus on how a differential robot will vary its speed due to a voltage input excitation. There are some dynamic allusions while modeling the DC motor, you are absolutely right, as I am considering friction and a few inertias. Nonetheless, I would not consider it as an overall dynamic approximation, it would lack of many relevant considerations.

This is a very simple approach, it can be complemented in many ways. But there is always a trade-off. E.g. Is it worth to introduce a death band to model the backlash induce in the gear? (This together with friction and saturation would cause non-linearity)
Encoders would be a magnificent solution to develop a speed/position motor controller, they would greatly contribute to validate and complement the model. Personally, I would deem necessary a gyro as well to tackle the limitations that the encoders will offer. But that is a different matter.

I hope this helps.

Raul

12. salm says:

hello Mr. Raul

i am writing a researsh paper about mobile robot control and i want to use a modified version of the model you introduced , i want to reference the sources can you please tell me were i can find published version of your work, or how can i reference your work

13. Raul says:

Hi Salm,

This is the only source I have for this model, hence if you are intended to reference it, I reckon that this entry would be the only information to provide.

Let us know where we could get access to that paper once finished.

All the best,

Raul

14. salm says:

hello Raul

thank you, onec again, as it will puplished , i will send to you a soft copy

All the best,

slam