Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiled PID for controlling the rotation of targeting commands #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shom770
Copy link
Member

@Shom770 Shom770 commented Mar 31, 2024

Uses the ProfiledPIDController for all targeting commands in regards to the rotation. Using a profiled PID controller helps us account for larger amounts of error and adjust accordingly, while adhering to our constraints. The controller was changed to a profiled PID controller for the TargetSpeakerCommand, TargetAngleCommand, and TargetNoteCommand.

@Shom770 Shom770 changed the title Profiled PID for all targeting commands Profiled PID for controlling the rotation of targeting commands Mar 31, 2024
@Shom770 Shom770 requested a review from sswadkar March 31, 2024 02:36
)
}

thetaPID.enableContinuousInput(-PI.radians, PI.radians)
}

override fun initialize() {
thetaPID.reset() // maybe do first for x?
thetaPID.reset(0.degrees) // maybe do first for x?
Copy link
Member

Choose a reason for hiding this comment

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

why 0 degrees?

Copy link
Member Author

Choose a reason for hiding this comment

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

what would we reset it to then? the current gyro angle?

Copy link
Member

Choose a reason for hiding this comment

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

you're not resetting the angle, you're resetting the error it sees. we don't want error from the previous path to carry on, but rather recalculate in our execute function

)
}

thetaPID.enableContinuousInput(-PI.radians, PI.radians)
}

override fun initialize() {
thetaPID.reset()
thetaPID.reset(0.degrees)

if (thetakP.hasChanged() || thetakI.hasChanged() || thetakD.hasChanged()) {
Copy link
Member

Choose a reason for hiding this comment

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

please add tunable numbers for steering vel max and accel max as well

Copy link
Member

Choose a reason for hiding this comment

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

for the rest of the commands as well

@@ -69,7 +69,7 @@ object ControlBoard {
val climbAlignLeft = Trigger { driver.dPadLeft }
val climbAlignRight = Trigger { driver.dPadRight }

val targetSpeaker = Trigger { driver.xButton } // TODO: switch back to climbAlignLeft
Copy link
Member

Choose a reason for hiding this comment

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

doesn't belong in this commit

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