Skip to content

Commit

Permalink
Non-Linear Torque Param Tune
Browse files Browse the repository at this point in the history
  • Loading branch information
firestar5683 committed Sep 11, 2024
1 parent e1b541c commit bc55e89
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion panda/board/safety/safety_gm.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const SteeringLimits GM_STEERING_LIMITS = {
.max_steer = 300,
.max_steer = 850,
.max_rate_up = 10,
.max_rate_down = 15,
.driver_torque_allowance = 65,
Expand Down
10 changes: 2 additions & 8 deletions selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
ACCELERATOR_POS_MSG = 0xbe

NON_LINEAR_TORQUE_PARAMS = {
CAR.CHEVROLET_BOLT_EUV: [2.6531724862969748, 1.0, 0.1919764879840985, 0.009054123646805178],
CAR.CHEVROLET_BOLT_CC: [2.6531724862969748, 1.0, 0.1919764879840985, 0.009054123646805178],
CAR.CHEVROLET_BOLT_EUV: [1.75, 0.4, 0.13, 0.0],
CAR.CHEVROLET_BOLT_CC: [1.75, 0.4, 0.13, 0.0],
CAR.GMC_ACADIA: [4.78003305, 1.0, 0.3122, 0.05591772],
CAR.CHEVROLET_SILVERADO: [3.29974374, 1.0, 0.25571356, 0.0465122]
}
Expand Down Expand Up @@ -90,13 +90,7 @@ def torque_from_lateral_accel_neural(self, latcontrol_inputs: LatControlInputs,
return float(self.neural_ff_model.predict(inputs)) + friction

def torque_from_lateral_accel(self) -> TorqueFromLateralAccelCallbackType:
if self.CP.carFingerprint in (CAR.CHEVROLET_BOLT_EUV, CAR.CHEVROLET_BOLT_CC):
self.neural_ff_model = NanoFFModel(NEURAL_PARAMS_PATH, self.CP.carFingerprint)
return self.torque_from_lateral_accel_neural
elif self.CP.carFingerprint in NON_LINEAR_TORQUE_PARAMS:
return self.torque_from_lateral_accel_siglin
else:
return self.torque_from_lateral_accel_linear

@staticmethod
def _get_params(ret, candidate, fingerprint, car_fw, disable_openpilot_long, experimental_long, docs, params):
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/gm/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class CarControllerParams:
STEER_MAX = 300 # GM limit is 3Nm. Used by carcontroller to generate LKA output
STEER_MAX = 850 # GM limit is 3Nm. Used by carcontroller to generate LKA output
STEER_STEP = 3 # Active control frames per command (~33hz)
INACTIVE_STEER_STEP = 10 # Inactive control frames per command (10hz)
STEER_DELTA_UP = 10 # Delta rates require review due to observed EPS weakness
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/torque_data/override.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
"CADILLAC_ESCALADE" = [1.899999976158142, 1.842270016670227, 0.1120000034570694]
"CADILLAC_ESCALADE_ESV_2019" = [1.15, 1.3, 0.2]
"CADILLAC_XT4" = [1.45, 1.6, 0.2]
"CHEVROLET_BOLT_EUV" = [2.0, 2.0, 0.05]
"CHEVROLET_BOLT_EUV" = [5.67, 2.0, 0.015]
"CHEVROLET_MALIBU_CC" = [1.85, 1.85, 0.075]
"CHEVROLET_SILVERADO" = [1.9, 1.9, 0.112]
"CHEVROLET_TRAILBLAZER" = [1.33, 1.9, 0.16]
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/locationd/torqued.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
FIT_POINTS_TOTAL_QLOG = 600
MIN_VEL = 15 # m/s
FRICTION_FACTOR = 1.5 # ~85% of data coverage
FACTOR_SANITY = 0.3
FACTOR_SANITY = 1.0
FACTOR_SANITY_QLOG = 0.5
FRICTION_SANITY = 0.5
FRICTION_SANITY_QLOG = 0.8
Expand All @@ -34,7 +34,7 @@
MIN_ENGAGE_BUFFER = 2 # secs

VERSION = 1 # bump this to invalidate old parameter caches
ALLOWED_CARS = ['toyota', 'hyundai']
ALLOWED_CARS = ['toyota', 'hyundai', 'gm']


def slope2rot(slope):
Expand Down
2 changes: 1 addition & 1 deletion system/manager/process_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def allow_logging(started, params, CP: car.CarParams) -> bool:

def allow_uploads(started, params, CP: car.CarParams) -> bool:
allow_uploads = not (params.get_bool("DeviceManagement") and params.get_bool("NoUploads") and not params.get_bool("DisableOnroadUploads"))
return allow_uploads
return False

procs = [
DaemonProcess("manage_athenad", "system.athena.manage_athenad", "AthenadPid"),
Expand Down

0 comments on commit bc55e89

Please sign in to comment.