Skip to content

Feedforward PL with one-sided Trim and pedal mapping#241

Open
Acloran wants to merge 3 commits into
mainfrom
codex/powerlimit-feedforward-main
Open

Feedforward PL with one-sided Trim and pedal mapping#241
Acloran wants to merge 3 commits into
mainfrom
codex/powerlimit-feedforward-main

Conversation

@Acloran
Copy link
Copy Markdown

@Acloran Acloran commented May 25, 2026

No description provided.

@Acloran Acloran requested a review from a team as a code owner May 25, 2026 01:27
@Acloran Acloran requested review from KaitlynWChang and rbala25 and removed request for a team May 25, 2026 01:27
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lhre-2026 Ready Ready Preview, Comment May 25, 2026 6:13am

@github-actions github-actions Bot added documentation Improvements or additions to documentation Control Systems labels May 25, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the VCU torque mapping logic by replacing the 2D lookup table with a 1D RPM-based table and integrating power-limiting features directly into the TorqueMap component. Key enhancements include pedal exponent shaping, low-voltage derating based on min-cell OCV estimates, and a PID trim loop for electrical power management. The standalone PowerLimit component has been removed in favor of this integrated approach. Review feedback suggests refining the integral reset logic to prevent abrupt torque changes upon pedal re-application and emphasizes that closed-loop torque trim subtraction should remain disabled until fully verified.

Comment on lines +251 to +253
if (pedal_raw_pct < 0.01f || derated_table_torque_nm <= 0.0f) {
state->integral_w_s = 0.0f;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The integral term is reset when the pedal is released or the table torque is zero. While this prevents windup, consider if a small deadzone or a more gradual reset is needed to avoid abrupt torque changes when re-applying the pedal after a brief release.

Comment on lines +269 to 275
bool saturating_high =
unsaturated_trim_nm > trim_limit_nm && power_error_w > 0.0f;
bool saturating_low =
unsaturated_trim_nm < -trim_limit_nm && power_error_w < 0.0f;
if (!(saturating_high || saturating_low)) {
state->integral_w_s = candidate_integral_w_s;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The anti-windup logic correctly checks the total unsaturated trim against the limit. While the implementation is robust, note that the closed-loop torque trim subtraction must remain disabled (commented out) in the VCU power limit component until the logic is fully verified and intended for use.

References
  1. In the VCU power limit component, the closed-loop torque trim subtraction should remain disabled (commented out) until the closed-loop power limit logic is fully verified and intended for use.

@Acloran Acloran changed the title Codex/powerlimit feedforward main Feedforward PL with one-sided Trim and pedal mapping May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Control Systems documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant