@ -23,11 +23,12 @@ class CarControllerParams:
ADAS_KEEPALIVE_STEP = 100
ADAS_KEEPALIVE_STEP = 100
CAMERA_KEEPALIVE_STEP = 100
CAMERA_KEEPALIVE_STEP = 100
# Volt gasbrake lookups
# Volt gas/brake lookups
# TODO: These values should be confirmed on non-Volt vehicles
# TODO: These values should be confirmed on non-Volt vehicles.
# MAX_GAS should achieve 2 m/s^2 and MAX_BRAKE with regen should achieve -4.0 m/s^2
MAX_GAS = 3072 # Safety limit, not ACC max. Stock ACC >4096 from standstill.
MAX_GAS = 3072 # Safety limit, not ACC max. Stock ACC >4096 from standstill.
ZERO_GAS = 2048 # Coasting
ZERO_GAS = 2048 # Coasting
MAX_BRAKE = 350 # ~ -3.5 m/s^2 with regen
MAX_BRAKE = 400 # ~ -4.0 m/s^2 with regen
MAX_ACC_REGEN = 1404 # Max ACC regen is slightly less than max paddle regen
MAX_ACC_REGEN = 1404 # Max ACC regen is slightly less than max paddle regen
# Allow small margin below -3.5 m/s^2 from ISO 15622:2018 since we
# Allow small margin below -3.5 m/s^2 from ISO 15622:2018 since we
@ -38,15 +39,14 @@ class CarControllerParams:
ACCEL_MAX = 2. # m/s^2
ACCEL_MAX = 2. # m/s^2
ACCEL_MIN = - 4. # m/s^2
ACCEL_MIN = - 4. # m/s^2
EV_GAS_LOOKUP_BP = [ - 1. , 0. , ACCEL_MAX ]
EV_BRAKE_LOOKUP_BP = [ ACCEL_MIN , - 1. ]
# ICE has much less engine braking force compared to regen in EVs,
# ICE has much less engine braking force compared to regen in EVs,
# lower threshold removes some braking deadzone
# lower threshold removes some braking deadzone
GAS_LOOKUP_BP = [ - 0.1 , 0. , ACCEL_MAX ]
GAS_LOOKUP_BP = [ - 0.1 , 0. , ACCEL_MAX ]
BRAKE_LOOKUP_BP = [ ACCEL_MIN , - 0.1 ]
EV_GAS_LOOKUP_BP = [ - 1. , 0. , ACCEL_MAX ]
GAS_LOOKUP_V = [ MAX_ACC_REGEN , ZERO_GAS , MAX_GAS ]
GAS_LOOKUP_V = [ MAX_ACC_REGEN , ZERO_GAS , MAX_GAS ]
BRAKE_LOOKUP_BP = [ ACCEL_MIN , - 0.1 ]
EV_BRAKE_LOOKUP_BP = [ ACCEL_MIN , - 1. ]
BRAKE_LOOKUP_V = [ MAX_BRAKE , 0. ]
BRAKE_LOOKUP_V = [ MAX_BRAKE , 0. ]