Spaceshot Flight Software
The Illinois Space Society's Homemade Rocket Firmware
|
Public Member Functions | |
void | ctrlTickFunction (pointers *pointer_struct) |
bool | ActiveControl_ON () |
Determines whether it's safe for flaps to actuate. Does this based on FSM state. More... | |
Controller (struct pointers *pointer_struct, PWMServo *controller_servo) | |
void | setLaunchPadElevation () |
Initializes launchpad elevation through barometer measurement. More... | |
Public Attributes | |
PWMServo * | controller_servo_ |
mutex_t * | dataMutex_state_ |
stateData * | stateData_ |
rk4 | rk4_ |
float | kp = 0.00008 |
float | min_extension = -2.0 / 1000.0 |
float | max_extension = 17.88 / 1000.0 |
float | dt = .006 |
float | prev_u = 0 |
float | du_max = 0.01 |
float | launch_pad_alt |
float | apogee_des_msl |
float | apogee_des_agl = 3962 |
float * | b_alt |
mutex_t * | dataMutex_barometer_ |
RocketFSM::FSM_State * | current_state |
ServoControl | activeControlServos |
bool Controller::ActiveControl_ON | ( | ) |
Determines whether it's safe for flaps to actuate. Does this based on FSM state.
void Controller::setLaunchPadElevation | ( | ) |
Initializes launchpad elevation through barometer measurement.
This method takes a series of barometer measurements on start up and takes the average of them in order to initialize the target altitude to a set value above ground level. Hard coding a launch pad elevation is not a viable solution to this problem as the Kalman filter which is the data input to the controller uses barometric altitude as its reference frame. This is equivalent to determining the barometric pressure at an airport and using it to calibrate an aircraft's onboard altimeter.
The function takes an average of 30 measurements, each made 100 ms apart