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.
-
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?)
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.
Therefore:
- 0% throttle command --> 5% duty cycle
- 100% throttle command --> 10% duty cycle
Documentation from RPi.GPIO library
From perspective of a cockpit at the nose cone:
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) |