Feedforward PL with one-sided Trim and pedal mapping#241
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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.
| if (pedal_raw_pct < 0.01f || derated_table_torque_nm <= 0.0f) { | ||
| state->integral_w_s = 0.0f; | ||
| } |
| 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; | ||
| } |
There was a problem hiding this comment.
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
- 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.
No description provided.