diff --git a/src/pid.c b/src/pid.c --- a/src/pid.c +++ b/src/pid.c @@ -52,7 +52,7 @@ float pid_process(void) ssr_output = 0.0; } - return ssr_output; + return ssr_output; //ssr_output; } int16_t pid_update(void) @@ -64,7 +64,7 @@ int16_t pid_update(void) float temp = status->temp; // Calculate instantaneous error - int16_t error = status->setpoint * 10 - temp; // TODO: Use fixed point fraction + int16_t error = status->setpoint - temp; // TODO: Use fixed point fraction // Proportional component int32_t p_term = set->val.k_p * error; @@ -78,7 +78,7 @@ int16_t pid_update(void) // it cant help be cold despite its best efforts) // not necessary, but this makes windup guard values // relative to the current iGain - int32_t windup_guard_res = (set->val.windup_guard * 10) / set->val.k_i; + int32_t windup_guard_res = (set->val.windup_guard) / set->val.k_i; // Calculate integral term with windup guard if (state.i_state > windup_guard_res)