Go to idle state if MPPT power is too low

This commit is contained in:
Thomas Kolb 2020-04-12 17:31:45 +02:00
parent c00f9f2f74
commit efca8d7e1a

View file

@ -953,10 +953,8 @@ int main(void)
timer_set_oc_value(TIM1, TIM_CH_CONV, pwm); timer_set_oc_value(TIM1, TIM_CH_CONV, pwm);
if(time_in_state > 5000 && power_state.current_avg < CURRENT_THRESHOLD) { if(time_in_state > 1000 && power_state.power_avg < POWER_THR_MPP_TO_IDLE) {
operState = Bootstrap; operState = Idle;
nextState = ConvMPP;
mpp_state.testIdx = -1;
} }
if(power_state.vout_avg > VOLTAGE_THR_MPP_TO_CV) { if(power_state.vout_avg > VOLTAGE_THR_MPP_TO_CV) {