log pid loop
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 1m51s
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 1m51s
This commit is contained in:
parent
dd7711eafd
commit
b48f00b798
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2573,7 +2573,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.16"
|
version = "1.0.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.16"
|
version = "1.0.17"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MITNFA"
|
license = "MITNFA"
|
||||||
description = "Controls Tesla charge rate based on solar charge data"
|
description = "Controls Tesla charge rate based on solar charge data"
|
||||||
|
|
|
@ -115,11 +115,13 @@ impl PidLoop {
|
||||||
} else {
|
} else {
|
||||||
0.
|
0.
|
||||||
};
|
};
|
||||||
let new_target = ((config.pid_controls.proportional_gain * error)
|
let offset = ((config.pid_controls.proportional_gain * error)
|
||||||
+ (config.pid_controls.derivative_gain * derivative))
|
+ (config.pid_controls.derivative_gain * derivative))
|
||||||
+ (charge_state.charge_amps as f64)
|
|
||||||
+ extra_offsets;
|
+ extra_offsets;
|
||||||
|
|
||||||
|
let new_target = offset + (charge_state.charge_amps as f64);
|
||||||
|
log::warn!("pid loop: wants to go {offset}, to {new_target}");
|
||||||
|
|
||||||
self.previous_error = error;
|
self.previous_error = error;
|
||||||
|
|
||||||
let new_target_int = new_target.round() as i64;
|
let new_target_int = new_target.round() as i64;
|
||||||
|
|
Loading…
Reference in a new issue