mirror of
https://github.com/dexterbg/KlausBMS.git
synced 2024-11-08 12:35:43 +00:00
- Fix: sanitize temperature compensation results
This commit is contained in:
parent
b9f6fefbec
commit
7bf56f8e0d
1 changed files with 3 additions and 3 deletions
|
@ -1065,11 +1065,11 @@ public:
|
|||
float dt = 20 - min(temp_f, temp_r);
|
||||
float dy;
|
||||
dy = (max_drive_power - max_drive_power_0c) / 20;
|
||||
drvpwr -= dt * dy;
|
||||
drvpwr = max(drvpwr - dt * dy, 0);
|
||||
dy = (max_recup_power - max_recup_power_0c) / 20;
|
||||
recpwr -= dt * dy;
|
||||
recpwr = max(recpwr - dt * dy, 0);
|
||||
dy = (max_charge_current - max_charge_current_0c) / 20;
|
||||
chgcur -= dt * dy;
|
||||
chgcur = max(chgcur - dt * dy, 5);
|
||||
}
|
||||
|
||||
#endif // CALIBRATION_MODE
|
||||
|
|
Loading…
Reference in a new issue