The requirement for the competitions states:
At motor burnout, the thrusters shall increase the rocket’s roll rate from 0 revolutions per minute (rpm) to 120 rpm, maintain 120-240 rpm for 3 seconds, then decrease to 0 rpm before apogee.
1) Make a state machine that can detect the phase of flight based on significant events during flight
2) Allow it to be used for any system regardless of motor size
This state machine was made to track the phase of flight the rocket is in so we can fire the cold gas thrusters at the right time so we can operate withing the requirements. the phases of flight are seen below.
To keep track of the rocket flight phase during the mission, we can use the acceleration as a marker. On the launch pad, acceleration will be gravity. During powered flight, the acceleration should arbitrarily increase proportional to the size of the motor. Once the motor burns out for coast, the ship should experience acceleration slightly less then gravity. Using acceleration we can track the phases of flight and use it as a trigger.
To check the functionality of state detection machine logic, we took last years electronics, that were similar to this years, and ran some test trials on a small model rocket, seen on the left. The goal of this test was to see if we could rely on this control strategy before sending it up on a large expensive system along with our payload.
This rocket was clearly aerodynamically and mechanically unstable due to the electronics taped on the outside. Regardless, the theory should work.
Looking at this data, we can clearly see the acceleration spike during powered flight, and the drop during coast phase (and a second spike from crashing). Using this acceleration shape we can mark the time when the motor burns out so we can activate the cold gas system.