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

Cherokee kl - Added Pid Tuning (Working 2019 kl), Modified Minsteerspeed (Testing 2019 kl) #111

Closed
wants to merge 10 commits into from
8 changes: 5 additions & 3 deletions selfdrive/car/chrysler/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ def update(self, CC, CS, now_nanos):
elif self.CP.carFingerprint in CUSW_CARS:
# TODO: Chrysler 200 appears to support asymmetric down to mid-13s, Cherokee not verified yet, model-year variances likely
# TODO: Consolidate with HIGHER_MIN_STEERING_SPEED cars if we can make engage consistently work at 17.5 m/s
if CS.out.vEgo < 16.5:
lkas_control_bit = False

#if CS.out.vEgo < 16.5:
# lkas_control_bit = False
# Testing reduced asymmetric
if CS.out.vEgo < 13.5: #Starting test at 13.5 per previous comment
lkas_control_bit = False
# EPS faults if LKAS re-enables too quickly
lkas_control_bit = lkas_control_bit and (self.frame - self.last_lkas_falling_edge > 200)

Expand Down
1 change: 1 addition & 0 deletions selfdrive/car/chrysler/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def update(self, cp, cp_cam):
ret.cruiseState.available = cp_cruise.vl["DAS_3"]["ACC_AVAILABLE"] == 1
ret.cruiseState.enabled = cp_cruise.vl["DAS_3"]["ACC_ACTIVE"] == 1
ret.cruiseState.speed = cp_cruise.vl["DAS_4"]["ACC_SET_SPEED_KPH"] * CV.KPH_TO_MS
#Not qualified to troubleshoot but on 2019 Cherokee KL, can enable autosteer when adaptive isn't enabled
ret.cruiseState.nonAdaptive = cp_cruise.vl["DAS_4"]["ACC_STATE"] in (1, 2) # 1 NormalCCOn and 2 NormalCCSet
ret.cruiseState.standstill = cp_cruise.vl["DAS_3"]["ACC_STANDSTILL"] == 1
ret.accFaulted = cp_cruise.vl["DAS_3"]["ACC_FAULTED"] != 0
Expand Down
11 changes: 9 additions & 2 deletions selfdrive/car/chrysler/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,16 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
ret.mass = 1747
ret.wheelbase = 2.70
ret.steerRatio = 17 # TODO: verify against params learner
ret.minSteerSpeed = 18.5 # TODO: conservative, need to test
#ret.minSteerSpeed = 18.5 # TODO: conservative, need to test
ret.minSteerSpeed = 15.5 # reduced to 15.5
ret.steerActuatorDelay = 0.2
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning, 1.0, False)
#Adding PID call and params from Jeep Grand Cherokee
ret.lateralTuning.init('pid')
ret.lateralTuning.pid.kpBP, ret.lateralTuning.pid.kiBP = [[9., 20.], [9., 20.]]
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.15, 0.30], [0.03, 0.05]]
ret.lateralTuning.pid.kf = 0.00006
#Attempt to enable PID by removing tork tune disable
#CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning, 1.0, False)

elif candidate in (CAR.JEEP_GRAND_CHEROKEE, CAR.JEEP_GRAND_CHEROKEE_2019):
ret.mass = 1778
Expand Down