From 494eba59618634e00583aaab24c631ab14cfdc09 Mon Sep 17 00:00:00 2001 From: Daniel Koepping Date: Fri, 24 Apr 2026 13:22:43 -0700 Subject: [PATCH] Raise mici thermal limits (#37891) * adjust thermal bands * raise OFFROAD_DANGER_TEMP * rename thermal bands * rm warm --- cereal/log.capnp | 8 ++++---- selfdrive/selfdrived/selfdrived.py | 2 +- selfdrive/ui/layouts/sidebar.py | 4 +--- system/hardware/hardwared.py | 28 +++++++++++++++++----------- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/cereal/log.capnp b/cereal/log.capnp index c0ee33743..71e9deb5b 100644 --- a/cereal/log.capnp +++ b/cereal/log.capnp @@ -460,10 +460,10 @@ struct DeviceState @0xa4d8b5af2aa492eb { } enum ThermalStatus { - green @0; - yellow @1; - red @2; - danger @3; + ok @0; + warmDEPRECATED @1; + overheated @2; + critical @3; } enum NetworkType { diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index 110b0b722..52ddb8397 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -226,7 +226,7 @@ class SelfdriveD: self.events.add(EventName.pedalPressed) # Create events for temperature, disk space, and memory - if self.sm['deviceState'].thermalStatus >= ThermalStatus.red: + if self.sm['deviceState'].thermalStatus >= ThermalStatus.overheated: self.events.add(EventName.overheat) if self.sm['deviceState'].freeSpacePercent < 7 and not SIMULATION: self.events.add(EventName.outOfSpace) diff --git a/selfdrive/ui/layouts/sidebar.py b/selfdrive/ui/layouts/sidebar.py index a7f3a4627..3b45c994c 100644 --- a/selfdrive/ui/layouts/sidebar.py +++ b/selfdrive/ui/layouts/sidebar.py @@ -121,10 +121,8 @@ class Sidebar(Widget): def _update_temperature_status(self, device_state): thermal_status = device_state.thermalStatus - if thermal_status == ThermalStatus.green: + if thermal_status == ThermalStatus.ok: self._temp_status.update(tr_noop("TEMP"), tr_noop("GOOD"), Colors.GOOD) - elif thermal_status == ThermalStatus.yellow: - self._temp_status.update(tr_noop("TEMP"), tr_noop("OK"), Colors.WARNING) else: self._temp_status.update(tr_noop("TEMP"), tr_noop("HIGH"), Colors.DANGER) diff --git a/system/hardware/hardwared.py b/system/hardware/hardwared.py index 4324e90c7..97b84c0e4 100755 --- a/system/hardware/hardwared.py +++ b/system/hardware/hardwared.py @@ -41,15 +41,21 @@ HardwareState = namedtuple("HardwareState", ['network_type', 'network_info', 'ne # List of thermal bands. We will stay within this region as long as we are within the bounds. # When exiting the bounds, we'll jump to the lower or higher band. Bands are ordered in the dict. -THERMAL_BANDS = OrderedDict({ - ThermalStatus.green: ThermalBand(None, 80.0), - ThermalStatus.yellow: ThermalBand(75.0, 96.0), - ThermalStatus.red: ThermalBand(88.0, 107.), - ThermalStatus.danger: ThermalBand(94.0, None), -}) +if HARDWARE.get_device_type() == "mici": + THERMAL_BANDS = OrderedDict({ + ThermalStatus.ok: ThermalBand(None, 100.0), + ThermalStatus.overheated: ThermalBand(92.0, 107.), + ThermalStatus.critical: ThermalBand(98.0, None), + }) +else: + THERMAL_BANDS = OrderedDict({ + ThermalStatus.ok: ThermalBand(None, 96.0), + ThermalStatus.overheated: ThermalBand(88.0, 107.), + ThermalStatus.critical: ThermalBand(94.0, None), + }) # Override to highest thermal band when offroad and above this temp -OFFROAD_DANGER_TEMP = 75 +OFFROAD_DANGER_TEMP = 85 if HARDWARE.get_device_type() == "mici" else 75 prev_offroad_states: dict[str, tuple[bool, str | None]] = {} @@ -181,7 +187,7 @@ def hardware_thread(end_event, hw_queue) -> None: started_ts: float | None = None started_seen = False startup_blocked_ts: float | None = None - thermal_status = ThermalStatus.yellow + thermal_status = ThermalStatus.ok last_hw_state = HardwareState( network_type=NetworkType.none, @@ -289,7 +295,7 @@ def hardware_thread(end_event, hw_queue) -> None: if is_offroad_for_5_min and offroad_comp_temp > OFFROAD_DANGER_TEMP: # if device is offroad and already hot without the extra onroad load, # we want to cool down first before increasing load - thermal_status = ThermalStatus.danger + thermal_status = ThermalStatus.critical else: current_band = THERMAL_BANDS[thermal_status] band_idx = list(THERMAL_BANDS.keys()).index(thermal_status) @@ -312,13 +318,13 @@ def hardware_thread(end_event, hw_queue) -> None: startup_conditions["not_taking_snapshot"] = not params.get_bool("IsTakingSnapshot") # must be at an engageable thermal band to go onroad - startup_conditions["device_temp_engageable"] = thermal_status < ThermalStatus.red + startup_conditions["device_temp_engageable"] = thermal_status < ThermalStatus.overheated # ensure device is fully booted startup_conditions["device_booted"] = startup_conditions.get("device_booted", False) or HARDWARE.booted() # if the temperature enters the danger zone, go offroad to cool down - onroad_conditions["device_temp_good"] = thermal_status < ThermalStatus.danger + onroad_conditions["device_temp_good"] = thermal_status < ThermalStatus.critical extra_text = f"{offroad_comp_temp:.1f}C" show_alert = (not onroad_conditions["device_temp_good"] or not startup_conditions["device_temp_engageable"]) and onroad_conditions["ignition"] set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", show_alert, extra_text=extra_text)