Mobile Robotics: Trajectory Tracking Control for 2D Robots

A comparative study and implementation of non-linear control laws in MATLAB/Simulink to solve the trajectory tracking problem for differential-drive and bicycle-kinematic robots.

Trajectory Tracking Simulation

At a Glance

  • Situation: Trajectory tracking is a fundamental capability for autonomous mobile robots. However, real-world factors like imperfectly known robot parameters (calibration errors) and physical motor limitations (actuator saturation) can severely degrade controller performance.
  • Task: To implement and compare two different non-linear control laws—Static Feedback linearization and a Lyapunov-based approach—for two common robot models (differential drive and bicycle). The primary goal was to analyze their trajectory tracking performance and, crucially, their robustness to the previous real-world issues.
  • Action: I implemented both control laws for each robot model within a MATLAB & Simulink simulation environment. The process involved tuning controller gains for optimal performance on a reference trajectory. Then, I systematically tested the controllers' robustness by injecting a 30% calibration error into the wheel radius and by simulating wheel velocity saturation.
  • Result: While both controllers successfully tracked the trajectory under ideal conditions, the analysis clearly demonstrated that the Lyapunov-based controller was significantly more robust. It maintained better tracking performance in the presence of model errors and actuator limits. This conclusion, that the "Lyapunov control scheme has the potential to perform better in real-world scenarios", formed the core finding of our final lab report.

Technical Deep Dive

System Architecture & Design

The project explored two common kinematic models for mobile robots: the differential drive (2-0) robot and the bicycle-like (1-1) robot. For each model, two distinct control strategies were implemented to solve the trajectory tracking problem.

  1. Static Feedback Control: This approach uses input-output linearization. The goal is to define an error variable (e.g., the position of a point in front of the robot) and compute the control inputs (wheel velocities) that will drive this error to zero. It relies on inverting the robot's kinematic model, which can make it sensitive to modeling errors.
  2. Lyapunov-based Control: This method is based on Lyapunov stability theory. An "energy function" (a Lyapunov function) is defined based on the posture error (position and orientation). A control law is then derived that guarantees this energy function will always decrease, ensuring the robot's error converges to zero. The energy function used was of the form $W = \frac{1}{2}(x_e^2 + y_e^2) + \frac{1}{\alpha}(\theta_e^2)$.

Core Implementation Details

The implementation was done entirely within MATLAB & Simulink. My role was to complete the provided templates by coding the core control logic and running the simulations.

  • Controller Implementation (`controller_Lyapunov_2_0.m`): For the Lyapunov controller, I implemented the calculation of the posture error in the robot's local frame ($x_e, y_e, \theta_e$). Based on these errors and the controller gains (`k1`, `k2`, `k3`), I then computed the required linear velocity `v` and angular velocity `w` that would ensure the derivative of the Lyapunov function ($\dot{W}$) was negative semi-definite, guaranteeing stability.
  • Parameter Tuning: A critical part of the lab was the hands-on tuning of controller gains (e.g., `Kp` for static feedback, `k1, k2, k3` for Lyapunov) to achieve a balance between fast convergence and smooth, stable behavior.
  • Robustness Analysis: The core of the analysis was testing the controllers under non-ideal conditions. This was done in two ways:
    1. Calibration Error: The wheel radius parameter in the simulation model was increased by 30% relative to the value used by the controller, simulating an imperfectly calibrated robot.
    2. Actuator Saturation: The commanded wheel velocities were passed through a saturation block in Simulink, limiting them to a maximum physical value.

Challenges & Solutions

The main challenge of the project was not just to make the robot follow a line, but to understand and compare *how* and *why* different controllers succeed or fail under realistic conditions.

The solution was the systematic comparative analysis detailed in the final report. By plotting the trajectories and error metrics for both controllers side-by-side in both ideal and non-ideal scenarios, a clear conclusion emerged. The static feedback controller, which relies on perfect model inversion, performed poorly when the model was wrong (e.g., wrong wheel radius). In contrast, the Lyapunov-based controller, while also affected, was inherently more stable and maintained a much better tracking performance. As stated in our report, this demonstrated that the Lyapunov approach is comparatively more robust and better suited for real-world applications where perfect models are unattainable.

Project Information

Type: Academic Course Project

Course: Mobile Robotics

Technologies Used

  • MATLAB
  • Simulink
  • Control Theory
  • Mobile Robotics
  • Lyapunov Stability
  • Non-linear Control