How sparkyvt/hpr-rocket-flight-computer works
Project type and purpose
• This is an embedded-systems project for a high-power rocket flight computer plus a companion ground-station and desktop parser.
• Purpose: Acquire, fuse, log and transmit sensor data in real time during a rocket flight; recover data post-flight; display live telemetry on a ground station; analyze flight logs on a PC.
File structure
Top-level directories:
• “Main Code” – the firmware for the on-board flight computer (Teensy).
• “Ground Station” – Arduino Nano BLE firmware for live telemetry reception and display.
• “Parser” – Python scripts for post-flight data analysis/plotting on a PC.
• “Build Photos”, “Operations Flow Chart.docx”, “LICENSE”, “README.txt” – docs and assets.
Key patterns:
• Main Code is split by functional modules (Device_Drivers, Telemetry, Event_Logic, SD, Radio drivers, Calibration, Rotation, etc.).
• Ground Station code is organized by sub-modules (GPS, Radio, LCD, SD_Card, packet parsing).
• Parser uses standalone Python scripts to read/write CSV data and generate plots.
Extract architectural insights from the README
• Hardware components: Teensy MCU, IMU, magnetometer, barometer, GPS, LoRa radio, SD card, pyro outputs.
• Ground station hardware: Arduino Nano, LoRa radio, GPS (optional), IMU, LCD, SD card.
• Data flows: Real-time telemetry via LoRa; local SD logging on both flight computer and ground station; post-flight USB/SD data extraction; desktop analysis.
Main components
A. On-Board Flight Computer
• Sensors: IMU, barometer, GPS
• MCU: Teensy 3.x/4.x running modular firmware (drivers, event logic, telemetry, SD logger)
• Outputs: Pyro drivers, continuity checks, servo outputs
• Storage: SD card (configuration + flight logs)
• Radio: LoRa transceiver (433/915 MHz)
B. Ground Station
• MCU: Arduino Nano 33 BLE
• Radio: LoRa transceiver (433/915 MHz)
• 20×4 LCD
• GPS + IMU (optional real-time position/orientation)
• Storage: SD card for telemetry logs
C. Desktop/PC Parser
• benchTestAnalysis.py, plotFlightData.py, plotTelemetryData.py
• Inputs: CSV/log files from SD cards or serial dumps
• Outputs: graphs, reports, Google Earth KML files
Relationships and data flows
• Sensors → MCU (I2C/SPI) on flight computer
• MCU processes data → stores on SD card
• MCU packages telemetry → sends via LoRa → Ground Station
• Ground Station LoRa RX → parses packets → updates LCD + logs to its SD
• Post-flight: remove SD or use USB serial → feed logs into Parser scripts on PC
• Parser scripts produce plots, event timing, trajectory analysis
Architectural patterns and design principles
• Real-time, event-driven state machine for flight phases (pre-launch, ascent, apogee, deployment).
• Sensor fusion for attitude and apogee detection.
• Modular firmware layers: hardware abstraction (drivers), core logic (event handling), I/O layers (SD, radio), user interface (configuration).
• Separation of concerns: on-board vs. ground vs. post-processing.
Technologies and frameworks to annotate
• Firmware: Arduino/C++ (.ino files), hardware drivers (SPI/I2C).
• Radio: LoRa (RFM9x family).
• Storage: SDfat or SD library.
• GPS: TinyGPS++ library.
• Parser: Python (matplotlib, pandas or built-ins).
• Deployment targets: Teensy 3.2/3.5/3.6/4.x, Arduino Nano 33 BLE.