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]]
|
||||
name = "tesla-charge-controller"
|
||||
version = "1.0.16"
|
||||
version = "1.0.17"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"chrono",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "tesla-charge-controller"
|
||||
version = "1.0.16"
|
||||
version = "1.0.17"
|
||||
edition = "2021"
|
||||
license = "MITNFA"
|
||||
description = "Controls Tesla charge rate based on solar charge data"
|
||||
|
|
|
@ -115,11 +115,13 @@ impl PidLoop {
|
|||
} else {
|
||||
0.
|
||||
};
|
||||
let new_target = ((config.pid_controls.proportional_gain * error)
|
||||
let offset = ((config.pid_controls.proportional_gain * error)
|
||||
+ (config.pid_controls.derivative_gain * derivative))
|
||||
+ (charge_state.charge_amps as f64)
|
||||
+ 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;
|
||||
|
||||
let new_target_int = new_target.round() as i64;
|
||||
|
|
Loading…
Reference in a new issue