Skip to content

SaadWajih99/UAV-Controller-Design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UAV Controller Design

PID-Based UAV Pitch Autopilot with Sensor Fusion and Robustness Validation

🚀 Project Summary

Designed and validated a UAV pitch control system using PD/PID controllers and complementary sensor fusion.
Achieved <2% overshoot and ~3 s settling time under realistic sensor noise and bias conditions.
Demonstrated robust closed-loop performance across multiple feedback strategies and disturbance levels.


🧠 System Overview

This project models and controls UAV pitch dynamics using:

  • Plant Model: Second-order pitch dynamics
  • Controllers: P, PD, and PID control strategies
  • Sensors:
    • Gyroscope (rate measurement with bias and noise)
    • Accelerometer (angle estimation with noise)
  • Sensor Fusion: Complementary filter for reliable attitude estimation

🔁 System Architecture

Reference → PID Controller → UAV Model → Sensors → Complementary Filter → Feedback


📊 Key Results

Closed-Loop Performance (Best Case: Filtered Feedback)

  • Overshoot: ~1.97%
  • Settling Time: ~3.1 s
  • Steady-State Error: ~0.0047 rad

![Closed Loop Comparison] image


🔍 Sensor Behaviour Comparison

  • Accelerometer-only: High noise leads to oscillatory response
  • Gyro-only: Smooth short-term response but drifts due to bias
  • Filtered (Best): Combines noise reduction and drift correction

![Sensor Estimation Under High Noise Conditions] image


⚙️ Key Engineering Insights

  • Increasing Kp improves response speed but increases overshoot
  • Derivative action (Kd) improves damping and reduces oscillations
  • Integral action (Ki) removes steady-state error but must be tuned carefully
  • Gyro drift occurs due to bias accumulation during integration
  • Complementary filtering balances noise rejection and drift correction

🧪 Robustness & Validation

System tested under increasing disturbance levels:

  • Baseline noise
  • Moderate disturbance
  • Severe disturbance

Results:

  • Raw accelerometer feedback degraded significantly with noise
  • Gyro-only feedback showed increasing drift
  • Filtered feedback remained stable and met performance requirements

![Disturbance Test] image


✅ Requirements Verification

ID Requirement Limit Result
REQ_01 Overshoot (baseline, filtered) < 5% PASS
REQ_02 Settling time (baseline, filtered) < 5 s PASS
REQ_03 Steady-state error < 0.05 rad PASS
REQ_04 Filtered SSE < Raw SSE inequality PASS
REQ_05 Filtered SSE < Gyro SSE inequality PASS
REQ_06 Overshoot (moderate disturbance) < 10% PASS
REQ_07 Overshoot (severe disturbance) < 15% PASS

⚠️ Limitations

  • Simplified second-order model (not full aircraft dynamics)
  • Complementary filter introduces slight estimation lag
  • Performance degrades under extreme disturbance conditions

▶️ How to Run

pip install numpy matplotlib control
python uav_controller.py

  • Generates plots automatically
  • Outputs verification results
  • Saves figures in images/

📁 Project Structure

UAV-Controller-Design/
├── README.md
├── uav_controller.py
├── images/
└── .gitignore


👤 Author

Saad Wajih

Releases

No releases published

Packages

 
 
 

Contributors

Languages