Skip to content

Shivam7Sharma/Sliding-Mode-Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RBE502_Final_Project

Sliding Mode Control for Drone Trajectory Following

Project Banner

Objective

The objective of this project is to develop a robust control scheme to enable a quadrotor to track desired trajectories in the presence of external disturbances.


Part 1: Trajectory Generation

Quintic Trajectory

Consider a quintic trajectory of the form ( q_d(t) = a_0 + a_1t + a_2t^2 + a_3t^3 + a_4t^4 + a_5t^5 ).

Coefficients

The coefficients ( a_0, a_1, a_2, a_3, a_4 ) and ( a_5 ) can be found by solving the matrix equation below:

Matrix Equation

Velocity and Acceleration

Differentiating ( qd(t) ) with respect to time, we get:

  • Velocity: ( q'd(t) = a1 + 2a2t + 3a3t2 + 4a4t3 + 5a5t4 )
  • Acceleration: ( q''d(t) = 2a2 + 6a3t + 12a4t2 + 20a5t3 )

Desired Trajectory Plot

Desired Trajectory position Desired Trajectory velocity Desired Trajectory acceleration

Part 2: Controller Design

Control Law

Control laws derived in handwritten notes are as follows:

Tuned Parameters

  • PD Controller: ( Kp = 110 ), ( Kd = 8 )
  • Lambda Parameters: ( λz = 12 ), ( λφ = 13 ), ( λθ = 19 ), ( λψ = 5 )
  • Gain Parameters: ( kz = 6 ), ( kφ = 140 ), ( kθ = 111 ), ( kψ = 25 )

Part 3: Code Explanation

Odom Callback and SMC Control

Upon receiving a call to odom_callback, the time (self.t) is initialized and relevant information such as the drone's current position, velocity, orientation, and angular velocity along the 3 axes are extracted from the odometry message. These values are then fed into the smc_control function.

SMC Control Function

smc_control function first invokes the traj_evaluate function which predicts the drone's trajectory and invokes the generate_trajectory to obtain the desired position, velocity, and acceleration for the x, y, z axis at that instant.


Part 4: Trajectory 3D and Analysis

3D Trajectory

3D Trajectory

Analysis

The 3D plot reveals that the drone's trajectory slightly deviates from the actual path, which can be attributed to the saturation function implemented to prevent chattering. Therefore, it can be concluded that the controller functions effectively and possesses the ability to handle external disturbances reasonably well, while still being able to closely track the desired trajectory.


Getting Started

To get started with this project, clone the repository:

git clone https://github.com/Shivam7Sharma/RBE502_Final_Project.git

About

Robot Control Final Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published