Skip to content

use velocity sign instead of closed loop sign for motion magic position control#187

Merged
shishghate merged 2 commits intomainfrom
fix-static-feedforward-sign
Apr 4, 2026
Merged

use velocity sign instead of closed loop sign for motion magic position control#187
shishghate merged 2 commits intomainfrom
fix-static-feedforward-sign

Conversation

@henrymilbert
Copy link
Copy Markdown
Contributor

Since we are now using Motion Magic for the turret, incline, and intake flipper, we should use the (default) velocity sign for the static feedforward sign instead of the closed loop sign. Since Motion Magic adds a motion profile that has velocity setpoints, the controller can use the sign of the velocity setpoint to determine the sign to use when applying the static friction (kS) feedforward value. The closed-loop error sign should only be used when there is no velocity setpoint (position control without motion profiling), since using the closed-loop error sign can cause the motor to dither when close to the set position, since the closed loop error will flip back and forth between positive and negative, causing the static friction feedforward to be applied back and forth against the direction of the error.

@henrymilbert henrymilbert requested a review from a team April 1, 2026 22:01
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Code Coverage Report

Overall Project 13.39%

There is no coverage information present for the Files changed

@shishghate shishghate merged commit ff44551 into main Apr 4, 2026
2 checks passed
@henrymilbert henrymilbert deleted the fix-static-feedforward-sign branch April 4, 2026 16:08
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