Skip to content

Ford native curvature#3405

Open
elkoled wants to merge 30 commits into
masterfrom
curvature-safety
Open

Ford native curvature#3405
elkoled wants to merge 30 commits into
masterfrom
curvature-safety

Conversation

@elkoled
Copy link
Copy Markdown
Contributor

@elkoled elkoled commented May 27, 2026

Moves Ford to the generic apply_std_curvature_limits, which works in lateral acceleration and lateral jerk space, same as the Tesla angle VM safety.
We apply it directly to curvature so no vehicle model is needed (lat_accel = curvature * v^2).

The three hand picked curvature rate breakpoints are replaced by two physical constants,
MAX_LATERAL_ACCEL = 3.6 m/s^2 and MAX_LATERAL_JERK = 3.6 m/s^3.

  • Ford bronco test drive
  • Ford bronco lateral reports

@github-actions github-actions Bot added car related to opendbc/car/ ford labels May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Car behavior report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

Testing 91 segments for: FORD_BRONCO_SPORT_MK1, FORD_ESCAPE_MK4, FORD_ESCAPE_MK4_5, FORD_EXPLORER_MK6, FORD_F_150_MK14, FORD_F_150_LIGHTNING_MK1, FORD_FOCUS_MK4, FORD_MAVERICK_MK1, FORD_MUSTANG_MACH_E_MK1, FORD_RANGER_MK2

✅ 0 changed, 91 passed, 0 errors

@github-actions github-actions Bot added the tesla label May 27, 2026
@github-actions github-actions Bot added the car safety vehicle-specific safety code label May 27, 2026
Comment thread opendbc/car/ford/carcontroller.py
Comment thread opendbc/safety/modes/ford.h Outdated
@elkoled elkoled force-pushed the curvature-safety branch from 2fbd568 to ac9fc19 Compare May 27, 2026 18:42
@elkoled
Copy link
Copy Markdown
Contributor Author

elkoled commented May 27, 2026

Removed rate limits as currently applied in VW MEB, kept ford max_curvature_error tracking in python and safety.

@elkoled elkoled marked this pull request as ready for review May 28, 2026 04:48
@elkoled
Copy link
Copy Markdown
Contributor Author

elkoled commented May 28, 2026

New curvature limits:
lat_accel_envelope

New rate limit:
rate_limit

@sshane
Copy link
Copy Markdown
Contributor

sshane commented May 28, 2026

What is that in accel/jerk space?

@elkoled
Copy link
Copy Markdown
Contributor Author

elkoled commented May 28, 2026

Same as Tesla VM:
unified 3.6m/s² lat accel and 3.6m/s³ jerk

accel:
envelope_accel_space

jerk:
rate_limit_jerk

@adeebshihadeh
Copy link
Copy Markdown
Contributor

We should really have these plots generated in the loop somewhere in the repo, rather than one-off scripts.

@elkoled
Copy link
Copy Markdown
Contributor Author

elkoled commented May 28, 2026

Test drive
Lateral reports show same behavior before/after.
Also same behavior at highway speeds.
The EPS limits the commanded curvature.

Lateral Reports
master
curvature-safety

curvature-safety report has stepping around 9m/s which is FORDs no-blending threshold in carcontroller that is surfaced with the new permissive limits:

      # No blending at low speed due to lack of torque wind-up and inaccurate current curvature
      if CS.out.vEgoRaw > 9:
        apply_curvature = float(np.clip(apply_curvature, current_curvature - CarControllerParams.CURVATURE_ERROR,
                                        current_curvature + CarControllerParams.CURVATURE_ERROR))
      apply_curvature = apply_std_curvature_limits(apply_curvature, self.apply_curvature_last, CS.out.vEgoRaw,
                                                   0., CarControllerParams.STEER_STEP, CC.latActive,
                                                   CarControllerParams.CURVATURE_LIMITS)

Comment thread opendbc/car/ford/carcontroller.py
Comment thread opendbc/car/ford/values.py Outdated
Comment thread opendbc/safety/tests/test_ford.py
elkoled and others added 3 commits May 28, 2026 16:37
@elkoled elkoled mentioned this pull request May 29, 2026
1 task
@elkoled elkoled changed the base branch from master to unify-lat May 30, 2026 01:08
@github-actions github-actions Bot removed the tesla label May 30, 2026
Base automatically changed from unify-lat to master May 31, 2026 08:16
@github-actions github-actions Bot added the tesla label May 31, 2026
@github-actions github-actions Bot removed the tesla label Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car safety vehicle-specific safety code car related to opendbc/car/ ford

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants