Skip to content

Predicted_Curvature Weight Adjustments - #191

Open
Praeuner wants to merge 2 commits into
BluePilotDev:bp-devfrom
Praeuner:bp-predicted_curvature-blending
Open

Predicted_Curvature Weight Adjustments#191
Praeuner wants to merge 2 commits into
BluePilotDev:bp-devfrom
Praeuner:bp-predicted_curvature-blending

Conversation

@Praeuner

@Praeuner Praeuner commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Purpose

Reduce predicted_curvature model noise on straightaway to combat some oscillations at the source rather than gain dampening.

Changes

  • b-blend
    Step function to smooth out transition between low and high b_blend values.
  • Gate _kappa_entering and desired_falling
    Add a percentage delta and a min curvature value to the logic that sets these. Prevents them from flipping true/false constantly.
  • Add on_straightaway
    Add new variable that reduces predicted_curvature blend on straightaways to reduce model noise. Set using entering == false, falling == false, and curve is minimal.

Notes

I'm treating 0.001 as the boundary for a meaningful curve that might warrant higher predictive blending.

Set the weight for predicted_curvature better throughout driving situations.
@alan-polk

Copy link
Copy Markdown
Collaborator

Do you have any routes to provide context to how this really affects the control? I experimented with variable blend ratios and found little effect, but 90% of my testing was in an F150, so perhaps the MachE is more sensitive.

@Praeuner

Praeuner commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Anecdotally, it's allowed me to go back to Pop v2 model and not be completely annoyed by bouncing back and forth on straightaways. I can upload a new route, but not sure I have a good clean comparison route. I'd probably be willing to downgrade and grab one if you think that's necessary for completing the PR.

I'll keep the "get route -> make change -> get new route" order of operations in mind for future changes!

Above 55mph, predicted_curvature is not needed because PSCM delay is within stock live_delay ranges. PSCM delay smoothly decreases as speed increases, so should predicted_curvature weight.

Interpolate b based on speed:
interp b from _FORD_PATH_ANGLE_BLEND_RATIO to 0.0 between 25mph and 55mph

Few minor tweaks to b_blend logic:
Initialize b_blend halfway between 25 and 55 mph so it can quickly raise or lower.
Remove re-initializations on interruptions.
Remove straightaway logic since no more blending at highway speeds.
Replace b_blend step function with smoother low pass filter.
@Praeuner

Praeuner commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Made some tweaks to my predicted_curvature logic. Main purpose was to reduce oscillations that were still occurring during speed changes, particularly around 50mph. More description is in the new commit.

alan-polk added a commit that referenced this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants