Mobile Robot Modeling and Simulation
© Maplesoft, a division of Waterloo Maple Inc., 2005
Derive the model of a two wheel differential drive mobile robot and simulate its trajectory response to various inputs. A 3D trajectory animation of the mobile robot has been created (shown above) based on the open loop system response of the derived mobile robot model. Various open loop and closed loop responses of this system have been generated in a separate application example application entitled, Mobile Robot .
The robot has two independent wheels, each connected to a motor. This way the robot can move forward, back, and turn.


Initialization
Loading libraries ... done
Defining Custom Functions ... done
System Definition
The entire system is divided into three subsystems: Robot Chassis, Wheels, and Motors.
The parameters and variables for each of the subsystems are defined as follows.
Parameter Definition
Name

Value

Units

Robot Parameters

Robot Chassis Radius ()



Robot Chassis Mass ()



Robot Chassis Moment of Inertia ()



Wheel Parameters

Wheel Radius ()



Wheel Mass ()



Wheel Moment of Inertia ()



Motor Parameters

DC Motor Armature Resistance ()



DC Motor Armature Inductance ()



DC Motor Torque Constant ()



DC Motor EMF Constant ()



Combining all of the parameters together and assigning it to the variable .
Variable Definition
Name

Description

Robot State


Robot Position (x and y coordinates)


Robot Heading (counter clockwise from the xaxis when viewed from top)


Robot Linear and Angular Velocity (w.r.t. Body Fixed Frame, positive going forward and about the vertical axis).

Wheel Variables


Wheel Angular Speed (left and right)


Wheel Applied Torque (left and right)


Wheel Traction Force (left and right)

Motor Variables


Motor Current (left and right)


Motor Input Voltage (left and right)

Model Derivation
The models for each of the three subsystems are derived here in sequence.
Robot Chassis
First, we derive the model for the robot chassis only.
Kinematics
Velocity
Define a mapping from the robot linear velocity v(t) and angular velocity w(t) to the linear velocity and angular velocity in the world coordinates.
Acceleration
Differentiate the velocities to obtain the accelerations.
Dynamics
Kinetic Energy
The kinetic energy of the robot chassis is the sum of the energy from the linear and angular motion.

States (Generalized Coordinates)
Define the state rate vector of the robot chassis as its forward velocity and turning rate.

Generalized Force
For the robot chassis, the generalized forces are the forces generated by the wheel acting on the chassis.

EulerLagrange Equations
Applying the EulerLagrange formulation:
Setting the difference between the time derivative of the partial derivative of the Lagrangian with respect to the generalized rate and the generated force to zero.
In this case, the Lagrangian is just the kinetic energy term (since there is no change in the potential energy in the system).
Solving for and results in the following set of equations.

Robot Motion Equations
To derive the equations of motion in terms of the Cartesian coordinates, we take the acceleration equation and substitute the EulerLagrange equations in and to it.

System Model For Robot Chassis Only
The system equations for the robot chassis only is formed by combining the Cartesian equation of motion (kinematics) in , and and the Lagrange equations (dynamics) in and .
For our system, we assume the system has zero initial conditions.
Robot With Wheels
Next, we would like to add the wheel dynamics to the robot chassis to obtain the combined system dynamics.
Kinematics
Velocity
Define the kinematics relationship between the linear and angular velocities and accelerations of the wheels.
Expressing as a set of differential equations.

Acceleration
Differentiate the velocities to obtain the accelerations.
Expressing as a set of differential equations.

RobotWheel Connection
Velocity Relation

Acceleration Relation

Dynamics
Given the kinematic relationships between the wheel and the chassis, we can now derive the combined system dynamics.
Kinetic Energy
The total system kinetic energy is the sum of kinetic energy of the chassis and the wheels.
States (Generalized Coordinates)
Define the state rate vector of the combined system as the angular rates of the two wheels.
Generalized Forces
For the combined system, the generalized forces are the applied torques to the wheels.
EulerLagrange Equations
Apply the EulerLagrange Formulation to the combined system kinetic energy equation, we get:
Writing them as separate differential equations:
System Model For Robot with Wheels
The combined system model is formed by combining the Cartesian equation of motion (kinematics) of the robot chassis in , the acceleration coupling equations between the robot and the wheels in and the Lagrange equations (dynamics) of the combined system and :
As with the robot chassis, the initial conditions for the wheel are also zero:
Robot with Wheel and Motor Dynamics
Finally, we include the motor dynamics into the whole system model.
Motor Characteristics
Applied Torque
The motors connect to the robot through the applied torques to the wheels.
Expressing as a set of equations.

Dynamics
The dynamics of the each motor is taken as a linear second order system in the motor current.

System Model For Robot with Wheel and Motor Dynamics
The combined system model is formed by combining the robotwheel system equations in , the torque coupling equations in between and the motor dynamics equations in and :
The initial conditions for the motors are also set to zero.
Simulation
System Input
The inputs to the combined system are the applied voltage to the motor.
For simulation purpose, they are defined as piecewise continuous functions:

Motor Input Voltage

System Responses
Robot X and Y Position

Robot Heading

Robot Chassis Linear and Angular Velocities

Trajectory Animation

Legal Notice: The copyright for this application is owned by Maplesoft. The application is intended to demonstrate the use of Maple to solve a particular problem. It has been made available for product evaluation purposes only and may not be used in any other context without the express permission of Maplesoft.