This project simulates a quadcopter's flight dynamics using a PID (Proportional-Integral-Derivative) controller. The program computes the quadcopter’s behavior in terms of roll, pitch, and yaw stability based on a simulated PID control system, using numerical integration for dynamics and visualizations for understanding the quadcopter's motion.
- [Introduction]
- [Features]
- [Usage]
- [Files]
- [References]
PID controllers are widely used for stabilizing drones by controlling their roll, pitch, and yaw. In this project, a simulation of a quadcopter using a PID controllers is implemented in Python. The program integrates the drone's dynamics over time and applies the PID controller to achieve stability and maintain the desired roll, pitch, and yaw.
- PID Control: Three independent PID controllers (for roll, pitch, and yaw) to stabilize the quadcopter.
- Dynamic Simulation: Uses the drone's physical parameters and integrates motion over time to simulate realistic behavior.
- 3D Visualization: A 3D animation of the quadcopter’s movements over time.
- Performance Metrics: Calculation of key performance metrics like steady-state error, rise time, settling time, and overshoot.
- Logging: Logs the simulation data, initial conditions, and PID parameters with timestamps for tracking multiple simulation runs.
To run the simulation, execute the main.py file:
python main.pyThe parameters are changed on config.py and control.py
main.py: Main script that runs the simulation, applies the PID controller, and generates visualizations.dynamics.py: Contains the dynamics equations of the quadcopter (e.g., angular velocity, motor thrust computation).control.py: Implements the PID control algorithm.visualization.py: Generates the visualizations of the quadcopter’s movement.performance.py: Calculates performance metrics for the system.config.py: Defines initial parameters for the simulation.
- Borase, Rakesh P.; Maghade, D. K.; Sondkar, S. Y.; Pawar, S. N. (2020). A review of PID control, tuning methods, and applications. International Journal of Dynamics and Control, doi:10.1007/s40435-020-00665-4
- ISA - Fundamentals of PID Control (June 2023). Link
- Medium - Drones and PID Control: An Introductory Guide to Aerial Robotics Link
- Medium - Understanding PID Controllers: Stable Flight in Drones and Beyond Link