Toyota: Potential issues with RAV4 TSS2 EPS split
Many moons ago, RAV4 TSS2 lateral tuning was split by EPS firmware version because Toyota shipped two different steering racks (different OEM suppliers):
https://github.com/commaai/openpilot/pull/21429
if fw.ecu == "eps" and fw.fwVersion.startswith(b'\x02'):
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.15], [0.05]]
ret.lateralTuning.pid.kf = 0.00004
That check distinguished “rack A” (single fw string, ~0.6) from “rack B” (composite \x02 fw string, ~0.15).
With the introduction of torque lateral control, this firmware-based rack split is no longer used. Both EPS variants are unified under CAR.TOYOTA_RAV4_TSS2 and handled with the same torque lateral model, leading to poorer performance on both, and especially the odd EPS out as you cannot generalize tuning variables between these EPS.
👉 Important clarification:
There are still separate model keys (RAV4_TSS2, RAV4_TSS2_2022, RAV4_TSS2_2023), but those are year-based splits to reflect Toyota’s ECU firmware updates and corresponding torque fits. They are not the old rack-A vs rack-B PID split.
Current torque parameters
(legend: [LAT_ACCEL_FACTOR, MAX_LAT_ACCEL_MEASURED, FRICTION])
| Model Key | LAT_ACCEL_FACTOR | MAX_LAT_ACCEL_MEASURED | FRICTION |
|---|---|---|---|
TOYOTA_RAV4_TSS2 |
2.279239424615458 | 2.087101966779332 | 0.13682208413446817 |
TOYOTA_RAV4_TSS2_2022 |
2.241883248393209 | 1.9304407208090029 | 0.112174 |
TOYOTA_RAV4_TSS2_2023 |
2.241883248393209 | 1.9304407208090029 | 0.112174 |
I have the odd one out part number as far as EPS is concerned and OP performs terribly on my Rav4h, leading me to exclusively run the twilson lateral model on Sunny. I'd love this to be fixed so I can migrate back to mainline OP cc @sshane
We really need an uploaded route or at least a dongle ID to look into this.
I'll work on replicating this soon on 0.10.
I found this interesting from the 0.10 post: