Skip to content

Raspberry Pi flight computer and camera recorder for high-power SRM rockets.

Notifications You must be signed in to change notification settings

MVHS-Rocket-Group/RPi-Flight-Computer

Repository files navigation

RPi-Flight-Computer

Repository Structure

  • BerryIMU/*: Example and library code for the BerryIMU from Ozzymaker.
  • old_software/*: Software from initial September 5, 2019 dump of the /home/pi directory.
  • IMU.py, LSM9DS0.py, LSM9DS1.py: IMU library.
  • BMP280.py: Barometer library.
  • master_startup.py: Script to launch at RPi startup.
  • mean_filter.py: Time-averaged (rolling average) IMU filter.
  • picamera_demo.py: Demo for recording video from the Pi's Camera Module.
  • pwm_demo.py: Demo for interacting with PWM ESCs over GPIO.
  • RPi-Flight-Controller.code-workspace: VSCode workspace file.

Principal control flow

  • Embedded RPi Python script functions

    • Flight controller (PWM Output)
    • Flight state data logger
      • Important flight events: e.g. Launch detection, arming of different systems, control loop decisions, deployments (detected via accelerometer edges?)
    • Camera recorder
    • Landing buzzer control?
    • Automatic safe shutdown 1 minute after landing detected (upon impact with the ground)
  • Logger file format

    • CSV text lines: flight state with additional column for events
    • TODO: Look into graphing tools to visualize flight data (maybe plot.ly Python Dash library?)

Background on PWM control for Servo Motors and ESCs

RC PWM has a "window" period of 20ms (milliseconds), with a pulse ranging in width from 1ms to 2ms, where 1ms is ~0% command and 2ms is ~100% command. Duty cycle, a percentage, is a ratio of on-time to off-time.

ESC PWM Diagram

Therefore:

  • 0% throttle command --> 5% duty cycle
  • 100% throttle command --> 10% duty cycle

Documentation from RPi.GPIO library

Rocket IMU Axes

From perspective of a cockpit at the nose cone:

Originally defined like a fighter plane due to how early spacecraft were flight cockpits plopped on the top of rocket boosters.

Vehicle Axis: Axis Description: IMU Measurement Axis:
X roll - vertical axis through center of rocket +X (acc), +X (gyro)
Y pitch - horizontal axis -Y (acc), +Y (gyro)
Z yaw - horizontal axis -Z (acc), +Z (gyro)

Helpful Resources

About

Raspberry Pi flight computer and camera recorder for high-power SRM rockets.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published