We have targeted rounding to the closest 100 m below the predicted altitude, using a PD controller.
This PD controller has been implemented twice: in Java, for use in the OpenRocket Simulator (see Custom Technologies page), and again in C++ for use on the STM32-duino based board of the flight computer. Code is available on github at
and
https://github.com/MIT-Rocket-Team/RT_Firmware_Libs/blob/master/airbrakes.cpp and https://github.com/MIT-Rocket-Team/RT_Firmware_Libs/blob/master/airbrakes.h
For the Zephyrus Test Launch, graph output shows controlled behavior to arrive at an altitude of 4805 meters according to the (flawed) predicted altitude algorithm part of the airbrakes controller; control output was bounded and stable.
However, this prediction of the altitude was not correct in that predictions matched neither barometer or GPS readings, and so this mission was not successful.
A full description of the algorithm is found in section 11 of the flight manual.