fix: fan 100% on overheat, FCW fps-aware, commIssue suppress, 10min shutdown
- Fan controller: allow full 100% fan when offroad temp >= 75°C (startup cooling) - ModelFps memory param: modeld publishes actual FPS (20 or 4) so downstream consumers can adjust frame-rate-dependent logic - Longitudinal planner: dynamically adjusts dt and v_desired_filter based on ModelFps; FCW crash_cnt threshold scales with FPS to maintain consistent 0.15s trigger window at both 20fps and 4fps - controlsd: suppress commIssue alerts for 2s after lateral control engages (FPS transition from 4->20 causes transient freq check failures) - Shutdown timer: hardcoded to 10 minutes (was 45min via FrogPilot param), screen taps reset the countdown via ShutdownTouchReset memory param, removed Shutdown Timer UI selector from ClearPilot menu Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,10 @@ class TiciFanController(BaseFanController):
|
||||
elif ignition:
|
||||
self.controller.neg_limit = -100
|
||||
self.controller.pos_limit = -15
|
||||
# CLEARPILOT: offroad but overheating (startup cooling) — full fan range
|
||||
elif cur_temp >= 75:
|
||||
self.controller.neg_limit = -100
|
||||
self.controller.pos_limit = 0
|
||||
else:
|
||||
self.controller.neg_limit = -30
|
||||
self.controller.pos_limit = 0
|
||||
|
||||
@@ -36,12 +36,9 @@ class PowerMonitoring:
|
||||
# Reset capacity if it's low
|
||||
self.car_battery_capacity_uWh = max((CAR_BATTERY_CAPACITY_uWh / 10), int(car_battery_capacity_uWh))
|
||||
|
||||
# FrogPilot variables
|
||||
device_management = self.params.get_bool("DeviceManagement")
|
||||
device_shutdown_setting = self.params.get_int("DeviceShutdown") if device_management else 33
|
||||
# If the toggle is set for < 1 hour, configure by 15 minute increments
|
||||
self.device_shutdown_time = (device_shutdown_setting - 3) * 3600 if device_shutdown_setting >= 4 else device_shutdown_setting * (60 * 15)
|
||||
self.low_voltage_shutdown = self.params.get_float("LowVoltageShutdown") if device_management else VBATT_PAUSE_CHARGING
|
||||
# CLEARPILOT: hardcoded 10 minute shutdown timer (not user-configurable)
|
||||
self.device_shutdown_time = 600
|
||||
self.low_voltage_shutdown = VBATT_PAUSE_CHARGING
|
||||
|
||||
# Calculation tick
|
||||
def calculate(self, voltage: int | None, ignition: bool):
|
||||
|
||||
@@ -197,7 +197,9 @@ def thermald_thread(end_event, hw_queue) -> None:
|
||||
engaged_prev = False
|
||||
|
||||
params = Params()
|
||||
params_memory = Params("/dev/shm/params")
|
||||
power_monitor = PowerMonitoring()
|
||||
last_touch_reset = "0" # CLEARPILOT: track last seen touch reset value
|
||||
|
||||
HARDWARE.initialize_hardware()
|
||||
thermal_config = HARDWARE.get_thermal_config()
|
||||
@@ -409,6 +411,13 @@ def thermald_thread(end_event, hw_queue) -> None:
|
||||
statlog.sample("som_power_draw", som_power_draw)
|
||||
msg.deviceState.somPowerDrawW = som_power_draw
|
||||
|
||||
# CLEARPILOT: screen tap resets shutdown timer (off_ts) while offroad
|
||||
touch_reset = params_memory.get("ShutdownTouchReset")
|
||||
if touch_reset is not None and touch_reset != last_touch_reset and off_ts is not None:
|
||||
off_ts = time.monotonic()
|
||||
cloudlog.info("shutdown timer reset by screen touch")
|
||||
last_touch_reset = touch_reset
|
||||
|
||||
# Check if we need to shut down
|
||||
if power_monitor.should_shutdown(onroad_conditions["ignition"], in_car, off_ts, started_seen):
|
||||
cloudlog.warning(f"shutting device down, offroad since {off_ts}")
|
||||
|
||||
Reference in New Issue
Block a user