51 float signal_diff = new_signal - axis->
signal;
139 if (*new_signal == 0 || *new_signal != *new_signal) {
142 bool sign = *new_signal > 0;
149 bool new_sign = *new_signal > 0;
151 if (sign != new_sign) {
153 *new_signal = 0.00001f;
155 *new_signal = -0.00001f;
194 memset(*state, 0,
sizeof(**state));
void smoothcontrol_set_mode(smoothcontrol_state state, uint8_t axis_num, uint8_t mode, uint8_t duty_cycle)
Main PiOS header to include all the compiled in PiOS options.
#define SMOOTHCONTROL_PREDICTOR_SLOPE
#define sign(x)
This is but one definition of sign(.)
void * PIOS_malloc_no_dma(size_t size)
uint8_t integrator_timeout
void smoothcontrol_update_dT(smoothcontrol_state state, float dT)
struct smoothcontrol_axis_state axis[4]
#define SMOOTHCONTROL_CHAMFER_START
void smoothcontrol_reinit_thrust(smoothcontrol_state state, float new_signal)
void smoothcontrol_next(smoothcontrol_state state)
void smoothcontrol_initialize(smoothcontrol_state *state)
float bound_min_max(float val, float min, float max)
Bound input value between min and max.
static void smoothcontrol_update(smoothcontrol_state state, struct smoothcontrol_axis_state *axis, const float new_signal)
#define SMOOTHCONTROL_TIMEBOMB
bool * smoothcontrol_get_ringer(smoothcontrol_state state)
Includes PiOS and core architecture components.
void smoothcontrol_run_thrust(smoothcontrol_state state, float *new_signal)
#define PIOS_Assert(test)
void smoothcontrol_run(smoothcontrol_state state, uint8_t axis_num, float *new_signal)
void smoothcontrol_reinit(smoothcontrol_state state, uint8_t axis_num, float new_signal)