DC/DC: Split P&O algorithm into buck and boost function

The previous combined function was hard to read and understand. Now using
a dedicated function for both power flow directions.
This commit is contained in:
Martin Jäger
2022-02-10 17:39:57 +01:00
parent d670f8bd6a
commit 0087114020
4 changed files with 118 additions and 88 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ static void init_structs_buck(int num_batteries = 1)
dcdc.inductor_current = 0;
dcdc.power = 0;
dcdc.power_prev = 0;
dcdc.pwm_delta = 1;
dcdc.pwm_direction = 1;
dcdc.enable = true;
}
@@ -79,7 +79,7 @@ static void init_structs_boost(int num_batteries = 1)
dcdc.temp_mosfets = 25;
dcdc.off_timestamp = 0;
dcdc.power_prev = 0;
dcdc.pwm_delta = 1;
dcdc.pwm_direction = 1;
dcdc.enable = true;
}