From efca8d7e1ae475c4744ef217866f7f0485bea5b6 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sun, 12 Apr 2020 17:31:45 +0200 Subject: [PATCH] Go to idle state if MPPT power is too low --- src/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 1fbbf1d..6b743c7 100644 --- a/src/main.c +++ b/src/main.c @@ -953,10 +953,8 @@ int main(void) timer_set_oc_value(TIM1, TIM_CH_CONV, pwm); - if(time_in_state > 5000 && power_state.current_avg < CURRENT_THRESHOLD) { - operState = Bootstrap; - nextState = ConvMPP; - mpp_state.testIdx = -1; + if(time_in_state > 1000 && power_state.power_avg < POWER_THR_MPP_TO_IDLE) { + operState = Idle; } if(power_state.vout_avg > VOLTAGE_THR_MPP_TO_CV) {