Skip to content

Commit

Permalink
improve tici thermal control (commaai#24228)
Browse files Browse the repository at this point in the history
* improve tici thermals

* more i

* always 70
  • Loading branch information
adeebshihadeh authored Apr 19, 2022
1 parent 0cc162a commit c5378cf
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 2 deletions.
4 changes: 2 additions & 2 deletions selfdrive/thermald/fan_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self) -> None:
cloudlog.info("Setting up TICI fan handler")

self.last_ignition = False
self.controller = PIDController(k_p=0, k_i=2e-3, k_f=1, neg_limit=-80, pos_limit=0, rate=(1 / DT_TRML))
self.controller = PIDController(k_p=0, k_i=4e-3, k_f=1, neg_limit=-80, pos_limit=0, rate=(1 / DT_TRML))

def update(self, max_cpu_temp: float, ignition: bool) -> int:
self.controller.neg_limit = -(80 if ignition else 30)
Expand All @@ -27,7 +27,7 @@ def update(self, max_cpu_temp: float, ignition: bool) -> int:
if ignition != self.last_ignition:
self.controller.reset()

error = 75 - max_cpu_temp
error = 70 - max_cpu_temp
fan_pwr_out = -int(self.controller.update(
error=error,
feedforward=interp(max_cpu_temp, [60.0, 100.0], [0, -80])
Expand Down
92 changes: 92 additions & 0 deletions tools/plotjuggler/layouts/thermal_debug.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget parent="main_window" name="Main Window">
<Tab tab_name="tab1" containers="1">
<Container>
<DockSplitter sizes="0.200099;0.200099;0.199606;0.200099;0.200099" orientation="-" count="5">
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range left="0.000000" bottom="62.240001" right="1671.937015" top="81.559998"/>
<limitY/>
<curve color="#1f77b4" name="/deviceState/cpuTempC/0"/>
<curve color="#d62728" name="/deviceState/cpuTempC/1"/>
<curve color="#1ac938" name="/deviceState/cpuTempC/2"/>
<curve color="#ff7f0e" name="/deviceState/cpuTempC/3"/>
<curve color="#f14cc1" name="/deviceState/cpuTempC/4"/>
<curve color="#9467bd" name="/deviceState/cpuTempC/5"/>
<curve color="#17becf" name="/deviceState/cpuTempC/6"/>
<curve color="#bcbd22" name="/deviceState/cpuTempC/7"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range left="0.000000" bottom="56.440473" right="1671.937015" top="82.418528"/>
<limitY/>
<curve color="#1f77b4" name="/deviceState/pmicTempC/0"/>
<curve color="#d62728" name="/deviceState/gpuTempC/0"/>
<curve color="#1ac938" name="/deviceState/gpuTempC/1"/>
<curve color="#f14cc1" name="/deviceState/memoryTempC"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range left="0.000000" bottom="-0.025000" right="1671.937015" top="1.025000"/>
<limitY/>
<curve color="#1f77b4" name="/deviceState/thermalStatus"/>
</plot>
</DockArea>
<DockSplitter sizes="0.500152;0.499848" orientation="|" count="2">
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range left="0.000000" bottom="4.185483" right="1671.937015" top="14.634767"/>
<limitY/>
<curve color="#ff7f0e" name="/deviceState/powerDrawW"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range left="0.000000" bottom="29.475000" right="1671.937015" top="51.525000"/>
<limitY/>
<curve color="#9467bd" name="/deviceState/fanSpeedPercentDesired"/>
</plot>
</DockArea>
</DockSplitter>
<DockSplitter sizes="0.500152;0.499848" orientation="|" count="2">
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range left="0.000000" bottom="1.600000" right="1671.937015" top="102.400000"/>
<limitY/>
<curve color="#1f77b4" name="/deviceState/cpuUsagePercent/0"/>
<curve color="#d62728" name="/deviceState/cpuUsagePercent/1"/>
<curve color="#1ac938" name="/deviceState/cpuUsagePercent/2"/>
<curve color="#ff7f0e" name="/deviceState/cpuUsagePercent/3"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range left="0.000000" bottom="-2.500000" right="1671.937015" top="102.500000"/>
<limitY/>
<curve color="#f14cc1" name="/deviceState/cpuUsagePercent/4"/>
<curve color="#9467bd" name="/deviceState/cpuUsagePercent/5"/>
<curve color="#17becf" name="/deviceState/cpuUsagePercent/6"/>
<curve color="#bcbd22" name="/deviceState/cpuUsagePercent/7"/>
</plot>
</DockArea>
</DockSplitter>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
</root>

0 comments on commit c5378cf

Please sign in to comment.