PolySync/oscc

OSCC Configuration parameters - Adding config for new Car

rg4444 opened this issue · 1 comments

Here is example file of vehicle parameter configuration : https://github.com/PolySync/oscc/blob/v1.1.1/api/include/vehicles/kia_soul_petrol.h
In order to add new vehicle and configure parameters listed below we need more detailed descriptions about values, MIN MAX values and how values might influence the whole system.

Any chances to get descriptions/instructions?

/////BRAKE MODULE Configuration Values////

  • @brief Minimum allowable brake value.
    #define MINIMUM_BRAKE_COMMAND ( 0 )

  • @brief Maximum allowable brake value.
    #define MAXIMUM_BRAKE_COMMAND ( 52428 )

  • @brief Calculation to convert a brake position to a pedal position.
    #define BRAKE_POSITION_TO_PEDAL( position ) ( (position) )

  • @brief Calculation to convert a brake pressure to a pedal position.
    #define BRAKE_PRESSURE_TO_PEDAL( pressure ) ( (pressure) )

  • @brief Minimum accumulator presure. [decibars]
    #define BRAKE_ACCUMULATOR_PRESSURE_MIN_IN_DECIBARS ( 777.6 )

  • @brief Maximum accumulator pressure. [decibars]
    #define BRAKE_ACCUMULATOR_PRESSURE_MAX_IN_DECIBARS ( 878.0 )

  • @brief Value of brake pressure that indicates operator override. [decibars]
    #define BRAKE_OVERRIDE_PEDAL_THRESHOLD_IN_DECIBARS ( 43.2 )

  • @brief Brake pressure threshold for when to enable the brake light.
    #define BRAKE_LIGHT_PRESSURE_THRESHOLD_IN_DECIBARS ( 20.0 )

  • @brief Minimum possible pressure of brake system. [decibars]
    #define BRAKE_PRESSURE_MIN_IN_DECIBARS ( 12.0 )

  • @brief Maximum possible pressure of brake system. [decibars]
    #define BRAKE_PRESSURE_MAX_IN_DECIBARS ( 878.3 )

  • @brief Minimum possible value expected to be read from the brake pressure sensors when the pressure check pins (PCK1/PCK2) are asserted.
    #define BRAKE_PRESSURE_SENSOR_CHECK_VALUE_MIN ( 665 )

  • @brief Maximum possible value expected to be read from the brake pressure sensors when the pressure check pins (PCK1/PCK2) are asserted.
    #define BRAKE_PRESSURE_SENSOR_CHECK_VALUE_MAX ( 680 )

  • @brief Proportional gain of the PID controller.
    #define BRAKE_PID_PROPORTIONAL_GAIN ( 0.65 )

  • @brief Integral gain of the PID controller.
    #define BRAKE_PID_INTEGRAL_GAIN ( 1.75 )

  • @brief Derivative gain of the PID controller.
    #define BRAKE_PID_DERIVATIVE_GAIN ( 0.000 )

  • @brief Windup guard of the PID controller.
    #define BRAKE_PID_WINDUP_GUARD ( 30 )

  • @brief Minimum output value of PID to be within a valid pressure range.
    #define BRAKE_PID_OUTPUT_MIN ( -10.0 )

  • @brief Maximum output value of PID to be within a valid pressure range.
    #define BRAKE_PID_OUTPUT_MAX ( 10.0 )

  • @brief Minimum clamped PID value of the actuation solenoid.
    #define BRAKE_PID_ACCUMULATOR_SOLENOID_CLAMPED_MIN ( 10.0 )

  • @brief Maximum clamped PID value of the actuation solenoid.
    #define BRAKE_PID_ACCUMULATOR_SOLENOID_CLAMPED_MAX ( 110.0 )

  • @brief Minimum clamped PID value of the release solenoid.
    #define BRAKE_PID_RELEASE_SOLENOID_CLAMPED_MIN ( 0.0 )

  • @brief Maximum clamped PID value of the release solenoid.
    #define BRAKE_PID_RELEASE_SOLENOID_CLAMPED_MAX ( 60.0 )

  • @brief Minimum duty cycle that begins to actuate the actuation solenoid 3.921 KHz PWM frequency
    #define BRAKE_ACCUMULATOR_SOLENOID_DUTY_CYCLE_MIN ( 80.0 )

  • @brief Maximum duty cycle where actuation solenoid has reached its stop 3.921 KHz PWM frequency
    #define BRAKE_ACCUMULATOR_SOLENOID_DUTY_CYCLE_MAX ( 105.0 )

  • @brief Minimum duty cycle that begins to actuate the release solenoid.3.921 KHz PWM frequency
    #define BRAKE_RELEASE_SOLENOID_DUTY_CYCLE_MIN ( 65.0 )

  • @brief Maximum duty cycle where release solenoid has reached its stop 3.921 KHz PWM frequency
    #define BRAKE_RELEASE_SOLENOID_DUTY_CYCLE_MAX ( 100.0 )

///// STEERING MODULE configuration values

  • @brief Minimum allowable torque value.
    #define MINIMUM_TORQUE_COMMAND ( -12.8 )

  • @brief Maximum allowable torque value.
    #define MAXIMUM_TORQUE_COMMAND ( 12.7 )

  • @brief Minimum allowable steering DAC output. [volts]
    #define STEERING_SPOOF_LOW_SIGNAL_VOLTAGE_MIN ( 0.80 )

  • @brief Maximum allowable steering DAC output. [volts]
    #define STEERING_SPOOF_LOW_SIGNAL_VOLTAGE_MAX ( 4.10 )

  • @brief Minimum allowable steering DAC output. [volts]
    #define STEERING_SPOOF_HIGH_SIGNAL_VOLTAGE_MIN ( 0.90 )

  • @brief Maximum allowable steering DAC output. [volts]
    #define STEERING_SPOOF_HIGH_SIGNAL_VOLTAGE_MAX ( 4.20 )

  • @brief Minimum allowed value for the low spoof signal value. [steps]

  • Equal to \ref STEERING_SPOOF_LOW_SIGNAL_VOLTAGE_MIN * \ref STEPS_PER_VOLT.
    #define STEERING_SPOOF_LOW_SIGNAL_RANGE_MIN ( 656 )

  • @brief Minimum allowed value for the low spoof signal value. [steps]

  • Equal to \ref STEERING_SPOOF_LOW_SIGNAL_VOLTAGE_MAX * \ref STEPS_PER_VOLT.
    #define STEERING_SPOOF_LOW_SIGNAL_RANGE_MAX ( 3358 )

  • @brief Minimum allowed value for the low spoof signal value. [steps]

  • Equal to \ref STEERING_SPOOF_HIGH_SIGNAL_VOLTAGE_MIN * \ref STEPS_PER_VOLT.
    #define STEERING_SPOOF_HIGH_SIGNAL_RANGE_MIN ( 738 )

  • @brief Minimum allowed value for the low spoof signal value. [steps]

  • Equal to \ref STEERING_SPOOF_HIGH_SIGNAL_VOLTAGE_MAX * \ref STEPS_PER_VOLT.
    #define STEERING_SPOOF_HIGH_SIGNAL_RANGE_MAX ( 3440 )

  • @brief Scalar value for the low spoof signal taken from a calibration curve.
    #define TORQUE_SPOOF_LOW_SIGNAL_CALIBRATION_CURVE_SCALE ( 0.135 )

  • @brief Offset value for the low spoof signal taken from a calibration curve.
    #define TORQUE_SPOOF_LOW_SIGNAL_CALIBRATION_CURVE_OFFSET ( 2.39 )

  • @brief Scalar value for the high spoof signal taken from a calibration curve.
    #define TORQUE_SPOOF_HIGH_SIGNAL_CALIBRATION_CURVE_SCALE ( -0.145 )

  • @brief Offset value for the high spoof signal taken from a calibration curve.
    #define TORQUE_SPOOF_HIGH_SIGNAL_CALIBRATION_CURVE_OFFSET ( 2.42 )

  • @brief Value of torque sensor difference that indicates likely operator override.
    #define TORQUE_DIFFERENCE_OVERRIDE_THRESHOLD ( 1600 )

// THROTTLE MODULE configuration parameters

  • @brief Minimum allowable throttle value.
    #define MINIMUM_THROTTLE_COMMAND ( 0.0 )

  • @brief Maximum allowable throttle value.
    #define MAXIMUM_THROTTLE_COMMAND ( 1.0 )

  • @brief Minimum allowed voltage for the low spoof signal voltage. [volts]
    #define THROTTLE_SPOOF_LOW_SIGNAL_VOLTAGE_MIN ( 0.30 )

  • @brief Maximum allowed voltage for the low spoof signal voltage. [volts]
    #define THROTTLE_SPOOF_LOW_SIGNAL_VOLTAGE_MAX ( 2.00 )

  • @brief Minimum allowed voltage for the high spoof signal voltage. [volts]
    #define THROTTLE_SPOOF_HIGH_SIGNAL_VOLTAGE_MIN ( 0.70 )

  • @brief Maximum allowed voltage for the high spoof signal voltage. [volts]
    #define THROTTLE_SPOOF_HIGH_SIGNAL_VOLTAGE_MAX ( 4.10 )

  • @brief Minimum allowed value for the low spoof signal value. [steps]

  • Equal to \ref THROTTLE_SPOOF_LOW_SIGNAL_VOLTAGE_MIN * \ref STEPS_PER_VOLT.
    #define THROTTLE_SPOOF_LOW_SIGNAL_RANGE_MIN ( 245 )

  • @brief Minimum allowed value for the low spoof signal value. [steps]

  • Equal to \ref THROTTLE_SPOOF_LOW_SIGNAL_VOLTAGE_MAX * \ref STEPS_PER_VOLT.
    #define THROTTLE_SPOOF_LOW_SIGNAL_RANGE_MAX ( 1638 )

  • @brief Minimum allowed value for the low spoof signal value. [steps]

  • Equal to \ref THROTTLE_SPOOF_HIGH_SIGNAL_VOLTAGE_MIN * \ref STEPS_PER_VOLT.
    #define THROTTLE_SPOOF_HIGH_SIGNAL_RANGE_MIN ( 573 )

  • @brief Minimum allowed value for the low spoof signal value. [steps]

  • Equal to \ref THROTTLE_SPOOF_HIGH_SIGNAL_VOLTAGE_MAX * \ref STEPS_PER_VOLT.
    #define THROTTLE_SPOOF_HIGH_SIGNAL_RANGE_MAX ( 3358 )

  • @brief Value of the accelerator position that indicates operator override. [steps]
    #define ACCELERATOR_OVERRIDE_THRESHOLD ( 185.0 )

The min and max values are vehicle and module specific to ensure that the limits are within an expected range of either the actuators or the vehicle voltage lines, and the override threshold for determining if the operator is looking to take control or if there is noise in the signal.

In the case of the header you mentioned a lot of these values are for the add on brake module on the petrol vehicle based on brake pressure in that system. I would recommend starting with something like the kia soul ev or throttle since that is usually a differential voltage signal at the pedal. For example the pedal characteristics could be measured where the intended spoofing would occur and operator override threshold could be determine based on noise in the signal comparison to user's input.