Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rivian: increase torque #2016

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Rivian: increase torque #2016

wants to merge 19 commits into from

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Mar 19, 2025

2 things noticed from plotting torque points in 3D from torqued on this route: 2d2da5dea63b5c5e/00000011--fc863c57a2/q

  • Lateral acceleration response to torque looks linear (as it should)
  • Lateral acceleration achieved across 15-30 m/s^2 looks to be the same (as it should)

But this goes against what we found in the lateral injection test. Perhaps higher torques become non-linear, need to plot more data.

rivian.3d.torque.mp4

@github-actions github-actions bot added car related to opendbc/car/ rivian labels Mar 19, 2025
@github-actions github-actions bot added the car safety vehicle-specific safety code label Mar 20, 2025
@sshane sshane force-pushed the rivian-increase-torque branch from d487a7a to b66d920 Compare March 20, 2025 02:32
@sshane sshane force-pushed the rivian-increase-torque branch from b66d920 to 53ec81a Compare March 20, 2025 02:33
@sshane
Copy link
Contributor Author

sshane commented Mar 21, 2025

Re-ran injection tests on the R1S to get a clearer picture at the torque drop off, pretty obvious now. It looks like it starts around 17 m/s (38 mph) and goes to 6.68 m/s (15 mph).

Note that for the points at 5 m/s we couldn't maintain the max torque for very long as the wheel could reach 90 degrees which was the ACC disengagement threshold.

https://connect.comma.ai/bc095dc92e101734/00000126--5176aa3ee8
https://connect.comma.ai/bc095dc92e101734/00000123--033ffdfa50

image

@sshane
Copy link
Contributor Author

sshane commented Mar 21, 2025

Injection test with the latest interp on this PR:

https://connect.comma.ai/bc095dc92e101734/0000012b--885dacf910

image

apply_torque = apply_driver_steer_torque_limits(new_torque, self.apply_torque_last,
CS.out.steeringTorque, CarControllerParams)
CS.out.steeringTorque, CarControllerParams, dynamic_steer_max)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: move this into apply_driver_steer_torque_limits

Comment on lines +15 to +26
def get_steer_max(self, v_ego: float) -> int:
return round(np.interp(v_ego, CarControllerParams.STEER_MAXES[0], CarControllerParams.STEER_MAXES[1]))

# def torque_from_lateral_accel_rivian(self, latcontrol_inputs: LatControlInputs, torque_params: structs.CarParams.LateralTorqueTuning,
# lateral_accel_error: float, lateral_accel_deadzone: float, friction_compensation: bool, gravity_adjusted: bool) -> float:
# # The default is a linear relationship between torque and lateral acceleration (accounting for road roll and steering friction)
# friction = get_friction(lateral_accel_error, lateral_accel_deadzone, FRICTION_THRESHOLD, torque_params, friction_compensation)
# return (latcontrol_inputs.lateral_acceleration / float(torque_params.latAccelFactor)) + friction
#
# def torque_from_lateral_accel(self) -> TorqueFromLateralAccelCallbackType:
# return self.torque_from_lateral_accel_rivian

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

@sshane sshane marked this pull request as draft March 22, 2025 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car safety vehicle-specific safety code car related to opendbc/car/ rivian
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant