Skip to content

Longitudinal flight control system with thrust vectoring, demonstrating gain-scheduled PID and control allocation

License

Notifications You must be signed in to change notification settings

Kumar-S-Bhat/thrust-vectoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Thrust Vectoring Flight Control System

A longitudinal aircraft dynamics simulation with thrust vectoring control, demonstrating gain-scheduled PID control and control allocation across the flight envelope.

Pitch Rate Tracking

🎯 Project Overview

This project implements a complete 2D (longitudinal) flight control system for an F-16 class fighter aircraft with thrust vectoring capability. It demonstrates:

  • Realistic 6DOF longitudinal dynamics with nonlinear aerodynamics
  • Gain-scheduled PID control adapted to angle of attack
  • Control allocation between elevator and thrust vectoring nozzle
  • Professional numerical integration using scipy's adaptive RK45 solver

✨ Key Features

  • βœ… Trimmed flight calculation using nonlinear optimization
  • βœ… High-fidelity aerodynamics from tabulated coefficient data (Ξ± = -10Β° to 90Β°)
  • βœ… Thrust vectoring model with Β±20Β° nozzle deflection limits
  • βœ… Adaptive control allocation that shifts authority based on flight condition
  • βœ… Robust integration with automatic error control (rtol=1e-6)

πŸ“Š Demonstration Results

Scenario 1: Low Alpha Flight (200 m/s)

  • RMS Tracking Error: 0.119 deg/s (near-perfect)
  • Control Strategy: Elevator dominant (conventional control sufficient)
  • Nozzle Usage: 0% (not needed)

Scenario 2: Post-Stall Upset Recovery (35Β°, 80 m/s)

  • RMS Tracking Error: 4.945 deg/s (acceptable for extreme upset)
  • Control Strategy: Thrust vectoring dominant (100% of time)
  • Nozzle Usage: Up to 5.46Β° deflection

Key Insight: Thrust vectoring provides essential control authority during post-stall upset recovery where conventional surfaces are ineffective.

πŸš€ Quick Start

Installation

git clone https://github.com/Kumar-S-Bhat/thrust-vectoring
cd thrust-vectoring
pip install -r requirements.txt

Run Demonstrations

# Pitch rate tracking demonstration
python examples/q_tracking.py

# View results
# Plots saved as: q_tracking_comparison.png

πŸ“‚ Project Structure

thrust-vectoring/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ aircraft/
β”‚   β”‚   β”œβ”€β”€ dynamics.py          # 6DOF longitudinal equations
β”‚   β”‚   β”œβ”€β”€ aerodynamics.py      # Aero coefficient tables
β”‚   β”‚   └── frames.py            # Coordinate transformations
β”‚   β”œβ”€β”€ propulsion/
β”‚   β”‚   β”œβ”€β”€ thrust_model.py      # Engine thrust model
β”‚   β”‚   β”œβ”€β”€ nozzle.py            # TVC system
β”‚   β”‚   └── actuator.py          # Nozzle actuator dynamics
β”‚   β”œβ”€β”€ control/
β”‚   β”‚   β”œβ”€β”€ pid.py               # PID controller with anti-windup
β”‚   β”‚   β”œβ”€β”€ gain_scheduled.py    # Gain-scheduled PID
β”‚   β”‚   β”œβ”€β”€ allocator.py         # Control allocation
β”‚   β”‚   └── pitch_controller.py  # Longitudinal controller
β”‚   └── simulation/
β”‚       └── trim_solver.py       # Trim condition solver
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ q_tracking.py            # Pitch rate tracking demo
β”‚   β”œβ”€β”€ nozzle_step.py           # Actuator response test
β”‚   β”œβ”€β”€ simulate_flight.py       # Open-loop flight simulation
β”‚   └── tune_pid_nozzle.py       # PID gain tuning
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_actuator_response.py
β”‚   β”œβ”€β”€ test_dynamics.py
β”‚   β”œβ”€β”€ test_pid_response.py
β”‚   β”œβ”€β”€ test_thrust_model.py
β”‚   └── test_trim.py
β”œβ”€β”€ data/
β”‚   └── aero_tables.csv          # Aerodynamic coefficient data
β”œβ”€β”€ q_tracking_comparison.png     # Results visualization
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ LICENSE
β”œβ”€β”€ .gitignore
└── README.md

πŸ”§ Technical Details

Aircraft Model

  • Type: F-16 class fighter
  • Mass: 9,300 kg
  • Pitch Inertia: 55,814 kgΒ·mΒ²
  • Wing Area: 27.87 mΒ²
  • Thrust: 130 kN (sea level static)

Control System

  • Outer Loop: Proportional alpha-to-rate controller (Kp = 3.0)
  • Inner Loop: Gain-scheduled pitch rate PID
    • Kp: 10,000,000 - 200,000 NΒ·m (varies with Ξ±)
    • Ki: 6,000,000 - 10,000 NΒ·mΒ·s (decreases at high Ξ±)
    • Kd: 300,000 - 3,500,000 NΒ·m/s (increases with Ξ±)

Numerical Integration

  • Method: scipy.integrate.solve_ivp with RK45
  • Tolerance: rtol=1e-6, atol=1e-9
  • Advantages: Adaptive step sizing, guaranteed error bounds

πŸ“ˆ Results Analysis

Control Surface Deflections

Scenario Elevator (max) Nozzle (max) Dominant Control
Low Alpha (200 m/s) 0.30Β° 0.00Β° Elevator
Post-Stall Upset (35Β°) 0.75Β° 5.46Β° Thrust Vectoring

Tracking Performance

The system achieves excellent tracking at low angle of attack where aerodynamics are well-behaved. At post-stall conditions (35Β° alpha), tracking degrades but the system successfully recovers from the upset using thrust vectoring.

πŸŽ“ Educational Value

This project demonstrates:

  1. Aircraft Dynamics Modeling

    • 6DOF equations in body frame
    • Aerodynamic force/moment calculation
    • Thrust vectoring kinematics
  2. Control System Design

    • Gain scheduling for nonlinear systems
    • Control allocation for over-actuated systems
    • PID tuning and anti-windup
  3. Numerical Methods

    • ODE integration with error control
    • Trim solving via nonlinear optimization
    • Professional simulation architecture

πŸ”¬ Limitations & Future Work

Current Limitations

  • 2D Only: Longitudinal dynamics only (no roll/yaw)
  • Simplified Aerodynamics: 1D tables (no Ξ², Mach effects)
  • No Actuator Lag: Instant control response (simplified)
  • Linear Control Basis: PID struggles at extreme angles (>40Β°)

Suggested Improvements

  1. Full 6DOF Dynamics

    • Add lateral-directional equations
    • Implement aileron and rudder
    • Model inertia coupling effects
  2. Advanced Control

    • Dynamic inversion for nonlinear regimes
    • LQR for optimal gains
    • Adaptive control for robustness
  3. Enhanced Realism

    • Actuator dynamics (rate limits, lag)
    • Sensor noise and filtering
    • Atmospheric turbulence
  4. Extended Analysis

    • Modal analysis (eigenvalues, damping ratios)
    • Stability margins
    • Flight envelope exploration

πŸ“š References

Textbooks

  1. Stevens, B. L., & Lewis, F. L. (2003). Aircraft Control and Simulation. Wiley.
  2. Nelson, R. C. (1998). Flight Stability and Automatic Control. McGraw-Hill.
  3. Etkin, B., & Reid, L. D. (1996). Dynamics of Flight: Stability and Control. Wiley.

Aerodynamic Data

  • NASA Technical Reports on F-16 aerodynamics
  • Anderson, J. D. (2017). Fundamentals of Aerodynamics. McGraw-Hill.

Control Theory

  • Ogata, K. (2010). Modern Control Engineering. Prentice Hall.
  • Γ…strΓΆm, K. J., & Murray, R. M. (2021). Feedback Systems. Princeton University Press.

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

Kumar S Bhat
Aerospace Engineering Student
Indian Institute of Engineering Science and Technology, Shibpur

LinkedIn: https://www.linkedin.com/in/kumar-bhat-6337a7332/
GitHub: https://github.com/Kumar-S-Bhat

πŸ“„ License

MIT License - See LICENSE file for details.

πŸ™ Acknowledgments

  • Aircraft parameters based on publicly available F-16 data
  • Control architecture inspired by modern fighter flight control systems
  • Project developed as part of aerospace engineering coursework

This project demonstrates aerospace engineering principles including flight dynamics, control systems, and numerical simulation. It is intended for educational purposes.

About

Longitudinal flight control system with thrust vectoring, demonstrating gain-scheduled PID and control allocation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages