use velocity sign instead of closed loop sign for motion magic position control#187
Merged
shishghate merged 2 commits intomainfrom Apr 4, 2026
Merged
use velocity sign instead of closed loop sign for motion magic position control#187shishghate merged 2 commits intomainfrom
shishghate merged 2 commits intomainfrom
Conversation
Code Coverage Report
|
shishghate
approved these changes
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.