Skip to content

amaranenivinitha/MATLAB-UAV-Flight-Control-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✈️ Design and Simulation of Flight Dynamics and Hierarchical PID-Based Flight Control System for a Fixed-Wing UAV

A MATLAB-based nonlinear flight dynamics and hierarchical PID autopilot framework for fixed-wing UAV simulation and control, developed during a DRDO internship.

Status MATLAB 6-DOF Flight_Control DRDO_Internship

DRDO Internship Project
DRDO Young Scientist Laboratory – Asymmetric Technologies (DYSL-AT), Hyderabad
Department of Aeronautical Engineering
Hindustan Institute of Technology and Science


πŸ“– Overview

This repository presents the design, modelling, simulation, and validation of a Hierarchical PID-Based Flight Control System for a fixed-wing Unmanned Aerial Vehicle (UAV) using MATLAB.

Developed during a DRDO Internship, the project implements a complete nonlinear Six-Degree-of-Freedom (6-DOF) mathematical model of the Aerosonde UAV, followed by trim analysis, state-space linearization, transfer-function development, and hierarchical autopilot design using the Successive Loop Closure (SLC) methodology.

The proposed flight control system regulates roll, course, pitch, altitude, airspeed, and sideslip, enabling stable autonomous flight while maintaining excellent command tracking and disturbance rejection under Dryden wind turbulence.

This project demonstrates the complete engineering workflow required to design and validate a fixed-wing UAV autopilot, making it a valuable reference for aerospace education, flight control research, and future autonomous flight system development.


πŸ“‘ Table of Contents


πŸ“Œ Project Information

Item Details
Project Title Design and Simulation of Flight Dynamics and Hierarchical PID-Based Flight Control System for a Fixed-Wing UAV
Organization DRDO Young Scientist Laboratory – Asymmetric Technologies (DYSL-AT), Hyderabad
Internship DRDO Summer Internship
Aircraft Model Aerosonde UAV
Development Platform MATLAB
Flight Controller Hierarchical PID
Design Methodology Successive Loop Closure (SLC)

🌟 Why This Project?

Fixed-wing UAVs exhibit highly nonlinear behaviour due to aerodynamic coupling, propulsion dynamics, gravitational effects, and atmospheric disturbances. Designing a reliable flight controller therefore requires much more than simply tuning a PID controller.

This project demonstrates the complete engineering workflow used in modern flight control system developmentβ€”from aircraft mathematical modelling and trim analysis to controller design, nonlinear simulation, and performance validation.

The resulting simulation framework provides a modular foundation for future research involving advanced flight control techniques such as LQR, Model Predictive Control (MPC), Adaptive Control, and AI-based Flight Control Systems.


✨ Project Highlights

  • ✈️ Nonlinear 6-DOF Aircraft Dynamics Model
  • πŸ“ Newton–Euler Aircraft Mathematical Model
  • πŸ“Š Aircraft Trim Analysis
  • πŸ“‰ State-Space Linearization
  • πŸ“ˆ Transfer Function Development
  • 🎯 Hierarchical PID Flight Controller
  • πŸ”„ Successive Loop Closure (SLC)
  • πŸŒͺ️ Dryden Wind Turbulence Simulation
  • πŸ›©οΈ Closed-Loop Flight Validation
  • πŸ’» MATLAB-Based Simulation Framework

πŸ“Š Project Statistics

Category Value
Aircraft Model Aerosonde UAV
Flight Dynamics Nonlinear 6-DOF
Flight Controller Hierarchical PID
Design Methodology Successive Loop Closure (SLC)
Wind Model Dryden Turbulence
Numerical Solver Fourth-Order Runge–Kutta (RK4)
Programming Language MATLAB

🎯 Key Outcomes

The developed flight control system successfully demonstrates:

  • βœ… Stable autonomous flight
  • βœ… Accurate airspeed regulation
  • βœ… Smooth altitude tracking
  • βœ… Reliable course tracking
  • βœ… Stable roll and pitch control
  • βœ… Coordinated flight through sideslip regulation
  • βœ… Effective atmospheric disturbance rejection
  • βœ… Modular architecture for future flight control research

πŸ—οΈ System Architecture

The developed flight control system follows a Hierarchical PID Autopilot based on the Successive Loop Closure (SLC) methodology. The controller is organized into multiple nested feedback loops, allowing the aircraft to maintain stable flight while accurately tracking airspeed, altitude, course, and attitude commands.

The controller consists of six interconnected feedback loops.

Controller Controlled Variable Primary Control Surface
Roll Hold Roll Angle Aileron
Course Hold Course Angle Roll Command
Pitch Hold Pitch Angle Elevator
Altitude Hold Altitude Pitch Command
Airspeed Hold Airspeed Throttle
Sideslip Hold Sideslip Angle Rudder

The hierarchical structure separates fast inner stabilization loops from slower outer guidance loops, simplifying controller tuning while improving overall flight stability.


πŸ”„ Development Workflow

The project follows the standard workflow adopted in fixed-wing aircraft flight control system design.

Each stage builds upon the previous one, resulting in a complete simulation framework capable of modelling, controlling, and validating a fixed-wing UAV.


πŸ“‚ Repository Structure

MATLAB-UAV-Flight-Control-System/
β”‚
β”œβ”€β”€ chap2/              Aircraft Visualization
β”œβ”€β”€ chap3/              Flight Dynamics
β”œβ”€β”€ chap4/              Trim & Linearization
β”œβ”€β”€ chap5/              Controller Design
β”œβ”€β”€ chap6/              Autopilot Simulation
β”‚
β”œβ”€β”€ images/             Figures & README Assets
β”œβ”€β”€ results/            Simulation Outputs & Videos
β”œβ”€β”€ report/             Final Technical Report
β”‚
β”œβ”€β”€ parameters/         Aircraft Parameters
β”œβ”€β”€ tools/              Utility Functions
β”œβ”€β”€ message_types/      Message Definitions
β”‚
β”œβ”€β”€ README.md
└── LICENSE

πŸ“¦ Repository Contents

The repository contains all resources required to reproduce the project.

Folder Description
chap2 Aircraft visualization and coordinate transformations
chap3 Nonlinear aircraft dynamics and wind simulation
chap4 Trim computation and state-space linearization
chap5 Transfer-function extraction and controller design
chap6 Hierarchical PID autopilot and closed-loop simulation
images Figures used in the README
results Simulation plots, videos, and generated outputs
report Complete internship report and documentation

πŸ“– Project Workflow Summary

The repository demonstrates the complete lifecycle of a fixed-wing flight control system:

  • Develop a nonlinear 6-DOF aircraft model
  • Compute steady-flight trim conditions
  • Linearize the nonlinear model
  • Derive aircraft transfer functions
  • Design a Hierarchical PID Autopilot
  • Validate the controller using nonlinear simulations
  • Evaluate tracking performance and disturbance rejection

This modular workflow makes the project suitable for both academic learning and future research in advanced UAV flight control.


πŸ“ˆ Simulation Results

The developed Hierarchical PID Flight Controller was validated through nonlinear closed-loop simulations using the Aerosonde UAV model under Dryden Wind Turbulence.

The controller was evaluated based on its ability to:

  • Maintain stable autonomous flight
  • Track commanded flight conditions
  • Reject atmospheric disturbances
  • Produce smooth transient responses
  • Maintain accurate steady-state performance

The following results demonstrate the effectiveness of the proposed flight control architecture.


✈️ Flight Response Analysis

Longitudinal Control Performance

Airspeed Tracking

Altitude Tracking

The longitudinal controller successfully regulates both airspeed and altitude through coordinated throttle and elevator control.

The aircraft reaches the commanded airspeed of 28 m/s in approximately 6.24 seconds with minimal overshoot while maintaining smooth altitude tracking and stable longitudinal dynamics.


Lateral-Directional Control Performance

Course Tracking

Roll Response

The lateral-directional controller accurately follows the commanded course by generating smooth roll commands.

The roll controller rapidly stabilizes the aircraft while maintaining coordinated turns and excellent lateral stability throughout the simulation.


Aircraft Stability

Pitch Response

Sideslip Regulation

The pitch controller provides stable longitudinal attitude regulation, while the sideslip controller minimizes lateral aerodynamic disturbances through rudder control, ensuring coordinated and stable flight.


πŸ›°οΈ Three-Dimensional Flight Trajectory

The simulated trajectory confirms that the aircraft successfully tracks the commanded flight profile while simultaneously regulating airspeed, altitude, attitude, and course. The overall flight path demonstrates smooth manoeuvres and stable nonlinear closed-loop operation.


πŸ“Š Performance Summary

Metric Result
Aircraft Model Aerosonde UAV
Trim Airspeed 25 m/s
Commanded Airspeed 28 m/s
Airspeed Settling Time β‰ˆ 6.24 s
Maximum Overshoot β‰ˆ 0.27 %
Final Airspeed Error β‰ˆ 0.083 m/s
Mean Altitude Tracking Error β‰ˆ 10.07 m
Mean Course Tracking Error β‰ˆ 14.22Β°
Flight Stability βœ… Stable
Disturbance Rejection βœ… Successful

The simulation results demonstrate that the proposed Hierarchical PID Flight Controller provides accurate command tracking, smooth transient behaviour, and robust disturbance rejection while maintaining stable autonomous flight.


πŸŽ₯ Demonstration

The repository includes real-time simulation videos that provide a visual demonstration of the developed flight control system.

Video Description
AircraftViewer.mp4 Three-dimensional visualization of the UAV during nonlinear closed-loop flight simulation.
DataViewer.mp4 Real-time aircraft states, control inputs, and controller responses throughout the simulation.

These demonstrations complement the simulation plots by illustrating the aircraft's dynamic behaviour and validating the overall performance of the hierarchical autopilot.


🎯 Validation Summary

The developed flight control system successfully demonstrates:

  • βœ… Stable autonomous flight
  • βœ… Accurate airspeed regulation
  • βœ… Smooth altitude tracking
  • βœ… Reliable course following
  • βœ… Stable roll and pitch dynamics
  • βœ… Coordinated flight through sideslip regulation
  • βœ… Robust performance under atmospheric disturbances

Overall, the project validates the effectiveness of the Successive Loop Closure (SLC) methodology for fixed-wing UAV autopilot design and provides a modular foundation for future research involving LQR, Model Predictive Control (MPC), Adaptive Control, and AI-based Flight Control Systems.


πŸ“‹ Requirements

Before running the project, ensure the following software is installed:

Software Version
MATLAB R2024a (or compatible)
Aerospace Toolbox Installed
Control System Toolbox Installed
Optimization Toolbox Installed

Note: The project is based on the MAVSIM MATLAB framework developed alongside Small Unmanned Aircraft: Theory and Practice by Beard & McLain.


βš™οΈ Installation

Clone the repository:

git clone https://github.com/amaranenivinitha/MATLAB-UAV-Flight-Control-System.git

Navigate to the project directory:

cd MATLAB-UAV-Flight-Control-System

Open MATLAB and add the project folders to the MATLAB search path.


▢️ Quick Start

Run the complete flight control simulation:

mavsim_chap6

The simulation automatically:

  • Loads the Aerosonde UAV parameters
  • Computes the trim condition
  • Initializes the nonlinear aircraft model
  • Starts the Dryden wind turbulence model
  • Executes the Hierarchical PID Autopilot
  • Launches the aircraft visualization
  • Displays real-time flight data

πŸ› οΈ Software & Tools

Software Purpose
MATLAB Flight dynamics modelling & simulation
MAVSIM Framework UAV simulation framework
Aerospace Toolbox Flight dynamics utilities
Control System Toolbox Controller design & analysis
Optimization Toolbox Aircraft trim computation

πŸŽ“ Skills Demonstrated

This project demonstrates practical experience in:

  • Aircraft Flight Dynamics
  • Aircraft Stability & Control
  • Nonlinear Aircraft Modelling
  • Six-Degree-of-Freedom (6-DOF) Dynamics
  • Aircraft Trim Analysis
  • State-Space Linearization
  • Transfer Function Development
  • Hierarchical PID Controller Design
  • Successive Loop Closure (SLC)
  • Numerical Simulation using RK4
  • MATLAB Programming

🌍 Applications

The developed simulation framework can be extended to support research and development in:

  • Fixed-Wing UAV Flight Control
  • Aircraft Stability Analysis
  • Guidance, Navigation & Control (GNC)
  • Flight Controller Validation
  • Autonomous Flight Research
  • Aerospace Education
  • UAV Rapid Prototyping
  • Advanced Control System Development

πŸš€ Future Work

The modular architecture of this project enables several future extensions.

Advanced Flight Control

  • Linear Quadratic Regulator (LQR)
  • Model Predictive Control (MPC)
  • Adaptive Control
  • Robust Control
  • Sliding Mode Control

Artificial Intelligence

  • Reinforcement Learning-Based Flight Control
  • Neural Network Controllers
  • Intelligent Gain Scheduling
  • AI-Augmented Autopilot

Simulation & Validation

  • FlightGear Integration
  • PX4 Software-in-the-Loop (SITL)
  • Hardware-in-the-Loop (HIL)
  • Software-in-the-Loop (SIL)
  • Real-Time Embedded Deployment

πŸ“˜ Technical Report

A detailed internship report is available in:

πŸ“„ Report

The report includes:

  • Aircraft Mathematical Modelling
  • Flight Dynamics
  • Trim Analysis
  • State-Space Linearization
  • Transfer Function Development
  • Hierarchical PID Controller Design
  • Controller Gain Calculation
  • Simulation Methodology
  • Results & Performance Evaluation

Readers interested in the theoretical background, mathematical derivations, and implementation details are encouraged to refer to the complete report.


πŸ‘¨β€πŸ’» Author

Amaraneni Vinitha

B.Tech – Aeronautical Engineering

Hindustan Institute of Technology and Science

Research Interests

  • Flight Dynamics
  • Flight Control Systems
  • Guidance, Navigation & Control (GNC)
  • UAV Systems
  • Autonomous Flight
  • Artificial Intelligence for Aerospace
  • Spacecraft Attitude Dynamics & Control

πŸ™ Acknowledgements

This work was completed during an internship at the DRDO Young Scientist Laboratory – Asymmetric Technologies (DYSL-AT), Hyderabad.

I sincerely thank Mr. V. V. S. M. S. Ganesh (Scientist-C) for his guidance, technical mentorship, and continuous encouragement throughout the project.

I also extend my gratitude to the Department of Aeronautical Engineering, Hindustan Institute of Technology and Science, for providing the academic foundation that supported this work.


πŸ“„ License

This repository is intended for academic, educational, and research purposes.

If you use this work in your own research or learning, please provide appropriate attribution.


Model β€’ Simulate β€’ Control β€’ Validate

Contributors

Languages