βοΈ 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.
DRDO Internship Project
DRDO Young Scientist Laboratory β Asymmetric Technologies (DYSL-AT), Hyderabad
Department of Aeronautical Engineering
Hindustan Institute of Technology and Science
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.
- Project Information
- Why This Project?
- Project Highlights
- Project Statistics
- System Architecture
- Development Workflow
- Repository Structure
- Simulation Results
- Requirements
- Installation
- Quick Start
- Software & Tools
- Skills Demonstrated
- Applications
- Future Work
- Technical Report
- Author
- Acknowledgements
- License
| 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) |
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.
βοΈ 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
| 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 |
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
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.
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.
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
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 |
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.
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.
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.
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.
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.
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.
| 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.
The repository includes real-time simulation videos that provide a visual demonstration of the developed flight control system.
These demonstrations complement the simulation plots by illustrating the aircraft's dynamic behaviour and validating the overall performance of the hierarchical autopilot.
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.
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.
Clone the repository:
git clone https://github.com/amaranenivinitha/MATLAB-UAV-Flight-Control-System.gitNavigate to the project directory:
cd MATLAB-UAV-Flight-Control-SystemOpen MATLAB and add the project folders to the MATLAB search path.
Run the complete flight control simulation:
mavsim_chap6The 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 | 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 |
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
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
The modular architecture of this project enables several future extensions.
- Linear Quadratic Regulator (LQR)
- Model Predictive Control (MPC)
- Adaptive Control
- Robust Control
- Sliding Mode Control
- Reinforcement Learning-Based Flight Control
- Neural Network Controllers
- Intelligent Gain Scheduling
- AI-Augmented Autopilot
- FlightGear Integration
- PX4 Software-in-the-Loop (SITL)
- Hardware-in-the-Loop (HIL)
- Software-in-the-Loop (SIL)
- Real-Time Embedded Deployment
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.
B.Tech β Aeronautical Engineering
Hindustan Institute of Technology and Science
- Flight Dynamics
- Flight Control Systems
- Guidance, Navigation & Control (GNC)
- UAV Systems
- Autonomous Flight
- Artificial Intelligence for Aerospace
- Spacecraft Attitude Dynamics & Control
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.
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.









