Skip to content

Commit

Permalink
fix steering
Browse files Browse the repository at this point in the history
  • Loading branch information
MoreTore committed Jul 23, 2023
1 parent d044a43 commit 5b0b00a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions selfdrive/car/mazda/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ def update(self, CC, CS, now_nanos):
# send steering command if GEN1
#The ti cannot be detected unless OP sends a can message to it because the ti only transmits when it
#sees the signature key in the designated address range.
if self.frame % 2 == 0:
can_sends.append(mazdacan.create_ti_steering_control(self.packer, self.CP.carFingerprint,
self.frame, ti_apply_steer))
can_sends.append(mazdacan.create_steering_control(self.packer, self.CP.carFingerprint,
self.frame, apply_steer, CS.cam_lkas))
can_sends.append(mazdacan.create_ti_steering_control(self.packer, self.CP.carFingerprint,
self.frame, ti_apply_steer))
can_sends.append(mazdacan.create_steering_control(self.packer, self.CP.carFingerprint,
self.frame, apply_steer, CS.cam_lkas))
else:
resume = False
hold = False
Expand Down
6 changes: 3 additions & 3 deletions selfdrive/car/mazda/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ class CarControllerParams:
def __init__(self, CP):
self.STEER_STEP = 1 # 100 Hz
if CP.carFingerprint in GEN1:
self.STEER_MAX = 600 # theoretical max_steer 2047
self.STEER_MAX = 800 # theoretical max_steer 2047
self.STEER_DELTA_UP = 10 # torque increase per refresh
self.STEER_DELTA_DOWN = 25 # torque decrease per refresh
self.STEER_DRIVER_ALLOWANCE = 5 # allowed driver torque before start limiting
self.STEER_DRIVER_ALLOWANCE = 15 # allowed driver torque before start limiting
self.STEER_DRIVER_MULTIPLIER = 40 # weight driver torque
self.STEER_DRIVER_FACTOR = 1 # from dbc
self.STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor

self.TI_STEER_MAX = 600 # theoretical max_steer 2047
self.TI_STEER_DELTA_UP = 6 # torque increase per refresh
self.TI_STEER_DELTA_DOWN = 15 # torque decrease per refresh
self.TI_STEER_DRIVER_ALLOWANCE = 5 # allowed driver torque before start limiting
self.TI_STEER_DRIVER_ALLOWANCE = 15 # allowed driver torque before start limiting
self.TI_STEER_DRIVER_MULTIPLIER = 40 # weight driver torque
self.TI_STEER_DRIVER_FACTOR = 1 # from dbc
self.TI_STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor
Expand Down

0 comments on commit 5b0b00a

Please sign in to comment.