Skip to content

Comments

Add aggressiveness-scaled brake ramping#195

Merged
JohanAlvedal merged 1 commit intocodex/01from
codex/add-dynamic-ramping-to-brake_offset_c
Jan 20, 2026
Merged

Add aggressiveness-scaled brake ramping#195
JohanAlvedal merged 1 commit intocodex/01from
codex/add-dynamic-ramping-to-brake_offset_c

Conversation

@JohanAlvedal
Copy link
Owner

Motivation

  • Implement directional, aggressiveness-scaled ramping for the winter brake_offset_c so the brake offset approaches the target at a controllable speed instead of using a symmetric rate limiter.

Description

  • Compute ramp_factor by clamping aggressiveness to 1..5 and dividing by 3.0, then derive ramp_up_c_per_15min = 3.0 * ramp_factor and ramp_down_c_per_15min = 2.0 * ramp_factor.
  • Scale ramp steps by the update interval with step_up = ramp_up_c_per_15min * (dt_minutes / 15.0) and step_down = ramp_down_c_per_15min * (dt_minutes / 15.0) and apply directional logic so the offset increases by step_up or decreases by step_down toward the target.
  • Replace the previous symmetric apply_rate_limit usage for brake offset with the new separate up/down ramp logic and continue to persist the offset using the existing _persist_brake_offset flow.
  • Expose the computed ramp_up_c_per_15min and ramp_down_c_per_15min in the sensor attributes via _build_attributes.

Testing

  • Ran the test suite with pytest -q and all tests passed: 31 passed.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@JohanAlvedal JohanAlvedal merged commit 7b3aa84 into codex/01 Jan 20, 2026
1 of 4 checks passed
@JohanAlvedal JohanAlvedal deleted the codex/add-dynamic-ramping-to-brake_offset_c branch January 29, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant