You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simulation and control of a quadcopter UAV, visualization of its trajectory and tracking performance in Python.
📌 Overview
This project aims to develop a simple simulation model of a small quadcopter UAV with its graphic visualization in Python. Moreover, it implements different controllers for tracking several types of 3D reference trajectories. It also includes visualization of the flight data, and controller performances.
🛩️ System dynamic description
The quadrotor is modeled using the full 6-DOF Newton–Euler equations (second law of Newton and Euler’s rotation equations), including nonlinear couplings, gyroscopic moments, drag forces, and cross-inertia effects.
with $u = [u_1,u_2,u_3,u_4]^\top = [T_B,\tau_{\phi},\tau_{\theta},\tau_{\psi}]^\top$ the torque input, $(\phi,\theta,\psi)$ the Euler attitudes (roll,pitch,yaw), $(\omega_x,\omega_y,\omega_z)$ the angular velocities in the body frame, $R(\phi,\theta,\psi)$ the rotation matrix from from the inertial world frame to the body frame, $m$ the quadcopter mass, $k_D$ the drag coefficient, $I_{xx},I_{yy},I_{zz}$ the inertia matrix diagonal coefficients, $J(\phi,\theta)$ the angular velocity transformation matrix which convert attitude and angular speed of the quadcopter from body frame to inertial frame.
🔧 Control loop scheme
To simplify we can consider command in torque that will be converted into a command in rotation speed of each motor:
📊 Controllers Implemented:
Feedback linearization
Sliding Mode Control (SMC) with saturation
📈 Visualize Results
Tracking helicoidal trajectory using SMC:
Tracking Bernoulli lemniscate type trajectory using SMC:
How to use it
Run the main script quadcopter_main.py on your favorite Python interpreter.