Firmware

Main Areas of Change to DENNIS:

  • State Machine
  • Kalman Filter (it's there, we don’t really know how it works past basic Bayesian logic)
  • Estimator
  • Executor
  • Pyros

 How we think this works with the limited documentation we worked off of

  • Estimator takes in data from sensors to estimate what state of flight it’s in, and changes the state accordingly. 
  • StateMachine tracks states we use to arm pyros and turn on/off logging, 

StateMachine

dennis-firmware/firmware/core/StateMachine.h and StateMachine.cpp

Code is incomplete with TODO statements scattered about, but the general idea of what we were going for is included in comments. 

StateMachine states

  • STARTUP
    • //TODO turn on radio
    • can transition to either TESTING, ARMED, or DISARMED
  • TESTING: State to put the rocket in for testing wow couldn’t’ve guessed
    • transition from STARTUP
    • stateMachine.transition(StateTransition::TESTING)) called in Executer.cpp
      • puts the rocket in testing mode
      • //TODO Manual button to enter testing
    • lockouts:
      • velocity = 0
      • calibration is  complete
      • pyro continuity
      • rocket is horizontal
  • ARMED
    • transition from STARTUP
    • Activated via manual human input
    • Arm pyros (which activate parachutes later)
    • Turn off logging
    • lockouts:
      • velocity = 0
      • calibration complete
      • pyro continuity
      • button/whatever thing we have the human do actually is activated
  • LANDED
    • Can transition to DISARMED
  • DISARMED (DEFAULT)
    • State reserved for when something was set up incorrectly
      • e.g. calibration incomplete, no pyro continuity…
    • Must turn flight computer off and on again
    • pyros are disarmed
    • transition from STARTUP, LANDED, or DISARMED

Estimator

dennis-firmware/firmware/estimator/Estimator.h or Estimator.cpp

Uses a Multiplicative Extended Kalman Filter on data from sensors to estimate the behavior of the rocket to trigger events like activating pyros for parachutes. Controls FlightStates. Continuously call on update() to use the Estimator. 

EstimatorState:

  • DISARMED
    • estimator doesn’t function
  • ARMED
  • AIR
  • LANDED

FlightState:

in dennis-firmware/firmware/estimator/EstimatorStates.h

  • IDLE
    • should never occur
  • BOOST
    • When engines are boosting the rocket
    • If acceleration upwards (acc.z) becomes negative, transition to COAST
  • COAST
    • When rocket is coasting
      • if the velocity upwards decreases beyond a certain threshold (set to 10 m/s2 right now), and if the rocket isn’t pointed upwards anymore, transition to APOGEE and fire pyros for drogue parachutes
  • APOGEE
    • peak of the rocket’s trajectory
    • if velocity upwards decreases below a lower threshold (set to 5m/s2 right now), transition to DESCENT
  • DESCENT
    • on the way down
    • if the altitude decreases beyond a certain threshold (not determined yet), fire pyros for main parachutes
    • if the velocity is close to 0, transition to FlightState::LANDED and StateTransition::LANDED in the StateMachine
  • LANDED
  • LENGTH
    • Not really sure what this is for lol



  • No labels