diff --git a/common/fingerprints.py b/common/fingerprints.py index 051ed7a702..dda045c74b 100644 --- a/common/fingerprints.py +++ b/common/fingerprints.py @@ -127,7 +127,7 @@ def fingerprint(logcan): elif candidate_cars[0] == "HONDA ACCORD 2016 TOURING": ret.steerKp, ret.steerKi = 12.0, 1.0 elif candidate_cars[0] == "HONDA CR-V 2016 TOURING": - ret.steerKp, ret.steerKi = 14.0, 1.67 + ret.steerKp, ret.steerKi = 6.0, 0.5 else: raise ValueError("unsupported car %s" % candidate_cars[0]) diff --git a/dbcs/honda_crv_touring_2016_can.dbc b/dbcs/honda_crv_touring_2016_can.dbc index 666da1a4f8..f06d78aca0 100644 --- a/dbcs/honda_crv_touring_2016_can.dbc +++ b/dbcs/honda_crv_touring_2016_can.dbc @@ -87,7 +87,7 @@ BO_ 401 GEARBOX: 8 PCM SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" NEO BO_ 404 STEERING_CONTROL: 4 NEO - SG_ STEER_TORQUE : 7|16@0- (1,0) [-2047.5|2047.5] "" EPS + SG_ STEER_TORQUE : 7|12@0- (1,0) [-768|768] "" EPS SG_ SET_ME_X00 : 11|4@0+ (1,0) [0|15] "" EPS SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index a87af94f7f..eb13332b93 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -141,7 +141,7 @@ class CarController(object): GAS_MAX = 1004 BRAKE_MAX = 1024/4 if CS.crv: - STEER_MAX = 0x380 # CR-V only uses 12-bits and requires a lower value + STEER_MAX = 0x300 # CR-V only uses 12-bits and requires a lower value else: STEER_MAX = 0xF00 GAS_OFFSET = 328 @@ -149,7 +149,6 @@ class CarController(object): # steer torque is converted back to CAN reference (positive when steering right) apply_gas = int(clip(final_gas*GAS_MAX, 0, GAS_MAX-1)) apply_brake = int(clip(final_brake*BRAKE_MAX, 0, BRAKE_MAX-1)) - # crvtodo: tweak steering to match precision of 0xE4 code. apply_steer = int(clip(-final_steer*STEER_MAX, -STEER_MAX, STEER_MAX)) # no gas if you are hitting the brake or the user is diff --git a/selfdrive/controls/lib/latcontrol.py b/selfdrive/controls/lib/latcontrol.py index 8af1bb8a5a..d89c976dde 100644 --- a/selfdrive/controls/lib/latcontrol.py +++ b/selfdrive/controls/lib/latcontrol.py @@ -13,7 +13,7 @@ def calc_d_lookahead(v_ego): # howfar we look ahead is function of speed offset_lookahead = 1. coeff_lookahead = 4.4 - # sqrt on speed is needed to keep, for a given curvature, the y_offset + # sqrt on speed is needed to keep, for a given curvature, the y_offset # proportional to speed. Indeed, y_offset is prop to d_lookahead^2 # 26m at 25m/s d_lookahead = offset_lookahead + math.sqrt(max(v_ego, 0)) * coeff_lookahead @@ -31,7 +31,7 @@ def pid_lateral_control(v_ego, y_actual, y_des, Ui_steer, steer_max, steer_override, sat_count, enabled, Kp, Ki, rate): sat_count_rate = 1./rate - sat_count_limit = 1.2 # after 0.8s of continuous saturation, an alert will be sent + sat_count_limit = 0.8 # after 0.8s of continuous saturation, an alert will be sent error_steer = y_des - y_actual Ui_unwind_speed = 0.3/rate #.3 per second