mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 12:32:06 +08:00
Torque control: higher low speed gains and better steering angle deadzone logic (#24980)
* Try no friction and no deadzone * Learn fromd ata * update refs old-commit-hash: b3226d505b9260ec8565acfda7138601a76039a6
This commit is contained in:
@@ -56,15 +56,15 @@ class LatControlTorque(LatControl):
|
||||
lateral_accel_deadzone = curvature_deadzone * CS.vEgo ** 2
|
||||
|
||||
|
||||
low_speed_factor = interp(CS.vEgo, [0, 15], [500, 0])
|
||||
low_speed_factor = interp(CS.vEgo, [0, 10, 20], [500, 500, 200])
|
||||
setpoint = desired_lateral_accel + low_speed_factor * desired_curvature
|
||||
measurement = actual_lateral_accel + low_speed_factor * actual_curvature
|
||||
error = apply_deadzone(setpoint - measurement, lateral_accel_deadzone)
|
||||
error = setpoint - measurement
|
||||
pid_log.error = error
|
||||
|
||||
ff = desired_lateral_accel - params.roll * ACCELERATION_DUE_TO_GRAVITY
|
||||
# convert friction into lateral accel units for feedforward
|
||||
friction_compensation = interp(error, [-FRICTION_THRESHOLD, FRICTION_THRESHOLD], [-self.friction, self.friction])
|
||||
friction_compensation = interp(apply_deadzone(error, lateral_accel_deadzone), [-FRICTION_THRESHOLD, FRICTION_THRESHOLD], [-self.friction, self.friction])
|
||||
ff += friction_compensation / self.kf
|
||||
freeze_integrator = CS.steeringRateLimited or CS.steeringPressed or CS.vEgo < 5
|
||||
output_torque = self.pid.update(error,
|
||||
|
||||
@@ -1 +1 @@
|
||||
b55de9fdb2416e63ab554c95233a78219d8d3db9
|
||||
a16ca1082cd493f6cea5252eaaba9f8c6574334a
|
||||
|
||||
Reference in New Issue
Block a user