This project presents the modeling and control of a two-wheeled differential drive robot using a backstepping control approach. The robot is required to follow a dynamically generated trajectory that avoids both static and moving obstacles, using Artificial Potential Fields (APF) for navigation. The objective is to regulate the robot’s position and orientation by controlling the torques of the two independently actuated DC motors (one per wheel), taking into account real-world complexities such as slippage, motor lag, and actuator latency.
The core focus of the project is the comparison between a PD controller and a backstepping controller, with the latter designed to smooth torque profiles and enhance tracking robustness under model uncertainty and noise. The system is modeled with nonlinear dynamics and discrete-time updates, including both longitudinal and lateral slippage, making it a practical testbed for advanced nonlinear control techniques.
- Given: The robot is provided with a trajectory generated by artificial potential fields, which account for the goal, obstacles (including moving ones), and workspace boundaries.
- Achieved: The robot's linear speed, acceleration, angular speed, and angular acceleration are controlled. The control is based on the torque derivative equations of DC motors, with both motors (left and right wheels) controlled simultaneously. The robot's movement is affected by random longitudinal and lateral slippages, making the control task more realistic and challenging.
The plant is a planar differential drive mobile robot. It consists of two independently actuated wheels mounted on either side of the robot, separated by a fixed wheelbase. The robot operates on a 2D plane with a bounded workspace and is subject to slippage.
s = [x, y, θ, v, ω]
where:
x, y: robot position in world coordinatesθ: heading anglev: forward (linear) velocityω: angular (rotational) velocity
The system evolves over time according to the following nonlinear discrete-time dynamics, which include both longitudinal and angular slippage:
v = v_cmd - μ · v_cmd · dt + slip_v
ω = ω_cmd - μ_ω · ω_cmd · dt + slip_ω
ẋ = v · cos(θ)
ẏ = v · sin(θ)
θ̇ = ω
where:
v_cmd,ω_cmd: Commanded linear and angular velocitiesμ,μ_ω: Slippage coefficients (longitudinal and angular)slip_v,slip_ω: Zero-mean Gaussian noise termsdt: Simulation time step
a = [τ_L, τ_R]
where:
τ_L: Torque applied to the left wheelτ_R: Torque applied to the right wheel
Each motor torque follows a first-order lag dynamic model:
τ̇_L = γ * (τ_L,des - τ_L)
τ̇_R = γ * (τ_R,des - τ_R)
where τ_L and τ_R are actual torques, and τ_L,des, τ_R,des are desired torques.
To avoid abrupt speed changes:
where
- (m = 2.0 , {kg}): robot mass
- (r = 0.05 , {m}): wheel radius
- (w = 0.2 , {m}): wheelbase
-
$\gamma = 0.15 , {s})$ : motor time constant -
$\mu, \mu_{\omega}$ : slippage coefficients - (dt = 0.01 , s): simulation time step
Attractive Force:
Vertical Force:
where
Horizontal Force:
where
Repulsive Force:
where
Vortex Force:
where
Variables:
-
$q$ : Robot position -
$q_{goal}$ : Goal position -
$q_o$ : Obstacle position -
$k_{att}, k_{vert}, k_{horiz}, k_{rep}, k_{vortex}$ : Field gains -
$d_0$ : Repulsion threshold
From the trajectory:
- Errors:
- PD control for torque derivatives:
- Motor torque update (first-order lag):
- Robot acceleration from torques:
Same as in PD control.
- Errors:
To ensure stability of the closed-loop system using backstepping, we construct a Lyapunov function that penalizes deviations from the desired velocity and acceleration. The Lyapunov function is chosen as the sum of the squared errors for both linear and angular velocities and accelerations:
How this Lyapunov function is constructed:
- The terms
$e_v$ and$e_\omega$ represent the errors between the actual and reference (desired) linear and angular velocities. - The terms
$e_{\dot{v}}$ and$e_{\dot{\omega}}$ represent the errors between the actual and reference (desired) linear and angular accelerations. - By squaring these errors and summing them, the function
$V$ is always non-negative and is minimized (i.e., zero) only when all errors are zero. - This form is standard in control theory for tracking problems, as it directly quantifies the deviation from the desired trajectory in both velocity and acceleration domains.
The backstepping control law is then designed to ensure that
Backstepping Control Law:
- Compute desired accelerations:
- Convert to desired torques:
- For the motor torque dynamics, the backstepping control includes additional terms:
- Update motor torques:
- Update robot velocities and pose as in the PD control.











