From 31da2af07853862b8a730101af0ba82fa4355180 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sat, 3 Jun 2023 00:10:09 +0200 Subject: [PATCH] Adapt impedance control to new generator --- src/switch_control.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_control.rs b/src/switch_control.rs index 286f8f2..140246b 100644 --- a/src/switch_control.rs +++ b/src/switch_control.rs @@ -279,7 +279,7 @@ pub struct SwitchControl mode_switch_delay_counter: u32, cv_pid: PID<10000, T0>, mppt: MPPT<200, 0 /* percent loss of peak power */>, - imp_ctrl: ImpedanceControl, + imp_ctrl: ImpedanceControl, pwm_max: i32, pwm_cur: i32, cv_target: i32, @@ -295,7 +295,7 @@ impl SwitchControl mode_switch_delay_counter: 0, cv_pid: PID::<10000, T0>::new(100, 50, 50, cv_target, 0, 0, pwm_max * 10000), mppt: MPPT::<200, 0>::new(3*pwm_max/4, 0, pwm_max), - imp_ctrl: ImpedanceControl::::new(1000, pwm_max), + imp_ctrl: ImpedanceControl::::new(1000, pwm_max), pwm_max, pwm_cur: 0, cv_target,