Active Flight Control Rocket
An ESP32-based active flight control system for high-power rocketry, combining PID-controlled fin actuators, Simulink-based flight dynamics modeling, and custom embedded avionics to achieve stable controlled flight.
Overview
An active flight control system for high-power rocketry, built to address the stability failure observed in the IREC rocket project. The system uses an ESP32-based flight computer with a PID controller driving fin actuators to actively correct the vehicle's flight path in real time.
This project is a direct continuation of the IREC rocket work. The previous launch attempt revealed that passive fin geometry alone was insufficient to maintain stable vertical flight under the actual launch conditions. This project aims to replace passive stability with an active control system capable of correcting attitude in real time. The controller is designed in Simulink, the fin actuator mechanism in Fusion 360, and the embedded implementation runs on an ESP32 flight computer. A test launch is planned to validate the system under real flight conditions.
Problem & Approach
The IREC rocket project demonstrated that a passively stable rocket can still fail to maintain stable flight if late-stage mass changes shift the CG/CP relationship or if environmental conditions are not accounted for in the simulation. Passive fin geometry provides no correction once the vehicle begins to deviate from its intended flight path.
The approach for this project is to add an active control layer: a PID controller reads attitude data from an IMU, computes the correction needed, and drives servo-actuated fins to apply that correction in real time. The full flight dynamics model is developed in Simulink before any hardware is built, allowing the PID gains to be tuned in simulation and verified before embedded implementation.
System Architecture
The system is organized around three layers: sensing, control, and actuation. The IMU and barometric altimeter provide state feedback to the ESP32 flight computer. The PID controller running on the ESP32 computes correction commands and drives the fin actuators through servo PWM signals. GPS provides position data for recovery and post-flight analysis.
MPU-6050
BMP390
Module
Kalman Filter
Computer
Fin Actuators
Telemetry Optional
Hardware Stack
| Component | Spec | Role | Rationale |
|---|---|---|---|
| Flight Computer | ESP32 DevKit | Main MCU | No boot delay, real-time PID loop, C/C++ support, prior project experience |
| IMU | MPU-6050 | Attitude sensing | 6-axis accel/gyro, I2C, widely supported library |
| Altimeter | BMP390 | Altitude / pressure | High resolution barometric altimeter, SPI/I2C |
| GPS | NEO-M9N or BN-880 | Position tracking | Recovery and post-flight analysis |
| Fin Actuator | MG996R or DS3225 servo | Active fin control | High torque, PWM controlled, compatible with ESP32Servo |
| Airframe | TBD carbon fiber | Structure | Consistent with IREC build experience |
| Power | LiPo + BEC/regulator | Power supply | Regulated 5V for servos, 3.3V for ESP32 and sensors |
Software Stack
Design Tools
- MATLAB / Simulink: 6DOF flight dynamics model, PID controller design, gain tuning, and hardware-in-loop validation.
- Fusion 360: Fin actuator mechanism design, servo mount, and airframe mounts.
- OpenRocket: Initial CG/CP verification before Simulink modeling.
Embedded ESP32
- Language: C/C++ using the Arduino framework.
- IDE: PlatformIO.
- Libraries: MPU6050, Adafruit BMP3XX, TinyGPS++, ESP32Servo, and SD.
Control Loop
- IMU sampled at 500Hz.
- Kalman filter for attitude estimation.
- PID controller computes fin deflection commands.
- Servo PWM updated at each loop iteration.
- Altimeter and GPS sampled at 10Hz.
Ground / Post-Flight
- Python and MATLAB for SD card log parsing and flight data visualization.
- PID performance analysis from logged data.
My Role
This is a solo project. I am responsible for the full system from controller design through embedded implementation and test launch.
- Developing the 6DOF flight dynamics model and PID controller in Simulink.
- Designing the fin actuator mechanism and servo mounts in Fusion 360.
- Implementing the embedded flight computer software on ESP32 in C/C++.
- Integrating IMU, altimeter, and GPS sensors into the avionics stack.
- Planning and executing bench tests, hardware-in-loop validation, and a test launch to verify the system under real flight conditions.
Evidence
This page will be updated as the project develops.
Planned artifacts include:
- Simulink model screenshots: PID controller and flight dynamics block diagram.
- Fusion 360 fin actuator design renders.
- Bench test photos for servo response and sensor integration.
- Hardware assembly photos.
- Hardware-in-loop validation plots: simulated vs commanded attitude.
- Test launch video and photos.
- Post-flight data plots from SD card logs.
Outcome
To be updated after test launch.
Current status: controller design and hardware procurement in progress. Target: successful test launch demonstrating active attitude correction during powered ascent.
Limitations
This project is currently in progress. All claims at this stage are limited to design intent and simulation results. No flight validation has been completed yet. PID gains tuned in Simulink may require further adjustment after real hardware testing, as simulation models cannot fully capture all aerodynamic and structural dynamics of the actual vehicle.
Next Step
- Complete Simulink flight dynamics model and PID gain tuning.
- Finalize fin actuator mechanism design in Fusion 360 and 3D print prototype for bench testing.
- Integrate full avionics stack on ESP32 and conduct hardware-in-loop validation against Simulink model.
- Conduct static bench test for servo response and sensor verification.
- Execute test launch and analyze post-flight SD card data.