Current compensation for load switch thresholds added

This commit is contained in:
Martin Jaeger
2019-04-18 09:23:58 +02:00
parent 666ca02baf
commit e05fd95e17
10 changed files with 73 additions and 24 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ void pwm_switch_control(pwm_switch_t *pwm_switch, power_port_t *solar_port, powe
pwm_switch_stop();
printf("PWM charger stop.\n");
}
else if (bat_port->voltage > (bat_port->voltage_output_target - bat_port->droop_resistance * bat_port->current) // output voltage above target
else if (bat_port->voltage > (bat_port->voltage_output_target - bat_port->droop_res_output * bat_port->current) // output voltage above target
|| bat_port->current > bat_port->current_output_max // output current limit exceeded
//|| (solar_port->voltage < (solar_port->voltage_input_start - solar_port->droop_resistance * solar_port->current) && bat_port->current > 0.1) // input voltage below limit
|| solar_port->current < solar_port->current_input_max // input current (negative signs) above limit