-
Notifications
You must be signed in to change notification settings - Fork 33
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
WIP Ioniq5 pe with sync #70
base: master-new
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request introduces steering angle control support for Hyundai CAN-FD platform, specifically for vehicles like the Ioniq 5 PE and Kia EV9. It includes changes to safety limits, car controller logic, and car state estimation to accommodate angle-based control. Additionally, the Ioniq 5 PE is added to the list of supported cars, and wheel speed calculation is refactored for CAN-FD cars. Sequence diagram for steering control with anglesequenceDiagram
participant CarController
participant CarState
participant hyundaicanfd
CarController->>CarState: CS.out.steeringAngleDeg
CarController->>CarController: apply_std_steer_angle_limits(actuators.steeringAngleDeg, ...)
alt driver torque override
CarController->>CarState: CS.out.steeringTorque
CarController->>CarController: lkas_max_torque update
end
CarController->>hyundaicanfd: create_steering_messages(apply_angle, lkas_max_torque)
hyundaicanfd-->>CarController: CAN messages
Updated class diagram for CarControllerParamsclassDiagram
class CarControllerParams {
float ACCEL_MIN
float ACCEL_MAX
AngleRateLimit ANGLE_RATE_LIMIT_UP
AngleRateLimit ANGLE_RATE_LIMIT_DOWN
int ANGLE_MAX_TORQUE
int ANGLE_DRIVER_TORQUE_ALLOWANCE
int ANGLE_MIN_TORQUE
int STEER_ANGLE_MAX
int STEER_DELTA_UP
int STEER_DELTA_DOWN
float STEER_MAX
float STEER_DRIVER_TORQUE_ALLOWANCE
float STEER_DRIVER_TORQUE_OVERRIDE
float STEER_DRIVER_TORQUE_FACTOR
}
class AngleRateLimit {
float[] speed_bp
float[] angle_v
}
CarControllerParams -- AngleRateLimit : has
Updated class diagram for HyundaiFlagsclassDiagram
class HyundaiFlags {
CANFD_LKA_STEERING
CANFD_LKA_STEERING_ALT
FCEV_GAS
ALT_LIMITS_2
CANFD_ANGLE_STEERING
FLAG_HYUNDAI_ESCC
FLAG_HYUNDAI_LONG_MAIN_CRUISE_TOGGLEABLE
CAMERA_SCC
RADAR_SCC
EV
HYBRID
gasoline
DISABLE_CAN_CHECKS
SEND_LFA_MESSAGES
CANFD_CAMERA_SCC
}
Updated class diagram for HyundaiSafetyFlagsclassDiagram
class HyundaiSafetyFlags {
CANFD_LKA_STEERING
CANFD_LKA_STEERING_ALT
FCEV_GAS
ALT_LIMITS_2
CANFD_ANGLE_STEERING
FLAG_HYUNDAI_ESCC
FLAG_HYUNDAI_LONG_MAIN_CRUISE_TOGGLEABLE
CAMERA_SCC
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
624b2de
to
d8808f9
Compare
9606b59
to
63366f6
Compare
26084df
to
f0c006f
Compare
744568f
to
ddfbf8e
Compare
9633eac
to
8a32031
Compare
This commit introduces angle-based steering control for the Hyundai Ioniq 5 PE (2025+ models) with Highway Driving Assist II (HDA2). It includes fingerprint updates, platform configuration, and control modifications to enable precise steering control and fault handling for CAN FD angle steering systems.
Updated MAX_LAT_ACCEL_MEASURED parameter for HYUNDAI_IONIQ_5_PE from 3.0 to 2.36 in the override file. This change aims to refine angle control calibration for improved vehicle behavior.
Refine angle limit parameters and rate curves for improved accuracy. Expanded and adjusted breakpoints for smoother transitions across speed ranges.
Introduced a smoothing mechanism for target torque calculations to enhance response consistency. This adjustment reduces abrupt changes while maintaining stability, using a configurable smooth factor. These changes aim to improve driving dynamics and enhance system behavior. Update torque limit logic and adjust formatting Refined ANGLE_TORQUE_LIMIT speed breakpoints and values for better control. Additionally, improved code readability by fixing spacing and formatting inconsistencies across multiple sections. These changes enhance maintainability and alignment with code standards. "Adjust torque limit speed breakpoints and values" Removed the lowest speed breakpoint and corresponding torque limit, starting the limits at a higher speed. This change simplifies the speed-torque mapping and enhances consistency at lower speeds. Improve LKAS torque control with speed-based dynamic limits Replaced steering angle-based torque calculation with speed-dependent limits for smoother and more adaptive LKAS behavior. Added clamping and rate adjustments to ensure torque stays within defined bounds to enhance stability and safety. Updated constants to reflect speed breakpoints and corresponding torque limits. Adjust torque curve for Hyundai steering angle limits Updated the ANGLE_TORQUE_Y values to modify the torque curve, reducing the first point from 40% to 20% of ANGLE_MAX_TORQUE. This adjustment improves steering responsiveness and control at lower torque levels. Update torque calculation logic for Hyundai steering control Adjusted the dynamic torque interpolation to use the actual steering angle instead of the last applied angle. Also corrected the torque ramp values for smoother transitions during steering. These changes aim to improve driving stability and user experience. Fix indentation error in Hyundai values constructor Corrected the indentation for the __init__ method in the Hyundai values file. This ensures proper method definition and avoids potential runtime errors due to misaligned code structure. Adjust LKAS torque calculation for dynamic steering limits. Introduced dynamic torque interpolation based on steering angle magnitude, replacing the static LKAS torque ramp-up. Updated max torque limit to 250 and added interpolation parameters for smoother torque adjustments. These changes enhance steering control precision and adaptability.
This reverts commit e6ea493.
The ANGLE_MAX_TORQUE value was raised from 150 to 200 to allow higher torque limits. This adjustment aims to enhance handling capabilities and better align with system requirements.
Introduced a speed-based interpolation to smoothly scale the low-speed torque cap, replacing the fixed multiplier approach. This enhances steering responsiveness at varying speeds while maintaining stability and consistency.
…rn (or not) to smooth out the torque
Introduced an adaptive ramp-down rate based on the torque difference and defined a fixed number of override cycles. This ensures a smoother and more controlled reduction to minimum torque when overriding steering torque.
4135a69
to
288f954
Compare
Introduced adaptive max torque scaling near center angles using linear interpolation for smoother transitions. Additionally, revised torque ramp-up and ramp-down rates for better responsiveness and user experience. These changes improve steering precision and control behavior.
Expanded and adjusted steering interpolation points and scaling factors in the Hyundai angle limits data. These changes aim to enhance steering responsiveness and better align with real-world behavior.
Requires #68
Summary by Sourcery
Adds support for angle-based steering control for Hyundai CAN-FD vehicles, specifically the Ioniq 5 PE and Kia EV9. This includes new safety checks, parameter adjustments, and message creation logic to handle angle-based commands instead of torque-based commands. Also updates the car fingerprint to include the Ioniq 5 PE.
New Features:
Tests: