Quadrotor Control Simulation

The goal of this project was to develop a robust control scheme to enable a quadrotor to track desired trajectories in the presence of external disturbances. This was done by deriving the sliding mode control laws, tuning gain values, and simulating the quadrotor on gazebo. The control law worked as intended as the quadrotor went to the designated waypoints in the proper sequence and time.

Trajectory Generation

For each of the 4 control inputs, we calculated the desired trajectory, velocity, and acceleration equations for the xyz directions with quintic trajectory generation. 

Sliding Mode Control Laws

The control laws were derived to control altitude, roll, pitch, and yaw. We solved for the derivative of the sliding surface equation to satisfy the sliding mode condition ensuring stable control. We then solved for the control input to get our final control law.

Simulation

Quadrotor Trajectory Tracking Simulation.mp4

The controller was put to the test in ROS with Gazebo as the physics simulator. In code, the controller works by looping through and updating control inputs and other values over time as it receives the ROS messages containing the quadrotor current states and elapsed time. The main controller function takes in XYZ, roll pitch yaw values, and their derivatives. 


The program calculates the desired trajectories and computes the resulting error. These values are then used in the control law equations to get the proper control input in real time.