From 5be01f56c012e630eb8a9c4e1956a0fcded4e04d Mon Sep 17 00:00:00 2001 From: EdwardApollo <51210836+EdwardApollo@users.noreply.github.com> Date: Thu, 1 Dec 2022 17:18:32 -0500 Subject: [PATCH] Increase Minimum Offroad Battery Voltage (#26661) * Reduce Min Idle Battery Voltage and Idle Time Updated minimum offroad battery voltage to reduce wear on car batteries and updated max offroad time to reflect the increased power consumption at idle based on EPHOT hardware power draw (this may have changed). Most vehicles make use of lead acid batteries which during normal use shouldn't ever decrease below ~12V (sources give a range of 11.8-12V). Increasing this limit will prevent premature battery failure by preventing sulfation of the cells. * Voltage cutoff to 11.8V, max offroad to 30h Changed lower voltage limit to 11.8V, removed power usage comment entirely, reverted change to max offroad time to 30 hours * Added Offroad Shutdown conditional Added IsOffroad Shutdown conditional statement to prevent shutting down due to voltage floor. * LPF Gain: Tau = 45s Tau modified to 45s to result in a LPF gain of ~0.011. Assuming a dT of 0.5s: (0.5/45)/((0.5/45)+1) * Revert IsOffroad check Removed due to unnecessary redundancy. old-commit-hash: 30165134e8963e260245c1b6596ca3ae3cc08fea --- selfdrive/thermald/power_monitoring.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/selfdrive/thermald/power_monitoring.py b/selfdrive/thermald/power_monitoring.py index b748064d2b..85e9510eb7 100644 --- a/selfdrive/thermald/power_monitoring.py +++ b/selfdrive/thermald/power_monitoring.py @@ -7,14 +7,13 @@ from system.hardware import HARDWARE from system.swaglog import cloudlog from selfdrive.statsd import statlog -CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau (dt/tau / (dt/tau + 1)) +CAR_VOLTAGE_LOW_PASS_K = 0.011 # LPF gain for 45s tau (dt/tau / (dt/tau + 1)) -# A C2 uses about 1W while idling, and 30h seens like a good shutoff for most cars # While driving, a battery charges completely in about 30-60 minutes CAR_BATTERY_CAPACITY_uWh = 30e6 CAR_CHARGING_RATE_W = 45 -VBATT_PAUSE_CHARGING = 11.0 # Lower limit on the LPF car battery voltage +VBATT_PAUSE_CHARGING = 11.8 # Lower limit on the LPF car battery voltage VBATT_INSTANT_PAUSE_CHARGING = 7.0 # Lower limit on the instant car battery voltage measurements to avoid triggering on instant power loss MAX_TIME_OFFROAD_S = 30*3600 MIN_ON_TIME_S = 3600