How alaaradhwan/underwater-rocket-esp32-firmware works
This is a portfolio repository for ESP32 underwater-vehicle attitude control, with three firmware generations, an earlier WebSocket PID-tuning prototype, and a MATLAB/Simulink study. The principal documented workflow is operator input plus IMU measurements, attitude estimation and heading/control logic, then fin actuation and throttle output. The Aug 2025 workflow is best documented; other firmware and simulation branches are represented without assuming their unsampled internal wiring. Edges are limited to README relationships and excerpt/index-supported references.
Main entry points: src/main.cpp PS5 Runtime · WebServer_Module.cpp WebSocket Server · src/main.cpp WebSocket Runtime · Servo_Controller.cpp Fin Control
Components 22
Graduation Firmware
- PS5 Runtime
firmware/graduation_aug26_ps5_heading_hold/src/main.cpp - Attitude Estimate
firmware/graduation_aug26_ps5_heading_hold/src/main.cpp - Fin Control
firmware/graduation_aug26_ps5_heading_hold/lib/Servo_Controller/Servo_Controller.cpp - PCA9685 Outputs
firmware/graduation_aug26_ps5_heading_hold/lib/Servo_Module/Servo_Module.h - ESC Throttle
firmware/graduation_aug26_ps5_heading_hold/lib/Motor_Module/Motor_Module.cpp
Mission Firmware
- Mission Runtime
firmware/2025_teknofest_mission/src/main.cpp - Mission Fin Control
firmware/2025_teknofest_mission/lib/Servo_Controller/Servo_Controller.cpp - PCA9685 Outputs
firmware/2025_teknofest_mission/lib/Servo_Module/Servo_Module.cpp
Wi-Fi Firmware
- Browser Runtime
firmware/2026_wifi_control/src/main.cpp - Stabilization Control
firmware/2026_wifi_control/lib/Servo_Controller/Servo_Controller.cpp - PCA9685 Outputs
firmware/2026_wifi_control/lib/Servo_Module/Servo_Module.cpp
Tuning Prototype
- WebSocket Runtime
prototypes/2025_early_websocket_pid_tuner/src/main.cpp - WebSocket Server
prototypes/2025_early_websocket_pid_tuner/lib/WebServer_Module/WebServer_Module.cpp - PID Tuning Control
prototypes/2025_early_websocket_pid_tuner/lib/Rocket_Controller/Rocket_Controller.cpp - Tuning Web UI
prototypes/2025_early_websocket_pid_tuner/Rocket_Web/script.js
Simulation
- Pitch-Yaw-Depth Model
simulation/graduation_2025/rocket_pitch_dynamics.m - Discrete PID Simulation
simulation/graduation_2025/main.m
Other components
- PS5 Operator
- IMU Sensor
- Fin Servos
- ESC
- Browser Operator
Connections 18
- PS5 Operator → PS5 Runtime: sets mode/throttle
README.md - IMU Sensor → PS5 Runtime: supplies readings
README.md - PS5 Runtime → Attitude Estimate: estimates attitude
README.md - PS5 Runtime → Fin Control: updates control
README.md - Fin Control → PCA9685 Outputs: writes fin angles
firmware/graduation_aug26_ps5_heading_hold/lib/Servo_Controller/Servo_Controller.cpp - PCA9685 Outputs → Fin Servos: drives
README.md - PS5 Runtime → ESC Throttle: sets throttle
README.md - ESC Throttle → ESC: drives
README.md - Mission Runtime → Mission Fin Control: uses controller
- Mission Fin Control → PCA9685 Outputs: writes fin angles
firmware/2025_teknofest_mission/lib/Servo_Controller/Servo_Controller.cpp - Browser Operator → Browser Runtime: sends commands
README.md - Browser Runtime → Stabilization Control: stabilizes attitude
- Stabilization Control → PCA9685 Outputs: writes fin angles
- Tuning Web UI → WebSocket Server: exchanges commands
- WebSocket Runtime → WebSocket Server: registers commands
prototypes/2025_early_websocket_pid_tuner/src/main.cpp - WebSocket Runtime → PID Tuning Control: updates controller
prototypes/2025_early_websocket_pid_tuner/src/main.cpp - PID Tuning Control → WebSocket Server: writes fin servos
- Discrete PID Simulation → Pitch-Yaw-Depth Model: simulates dynamics