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

Drivetrain code #1

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Drivetrain code #1

wants to merge 15 commits into from

Conversation

mimizh2418
Copy link
Member

@mimizh2418 mimizh2418 commented Jan 9, 2025

Initial drivetrain code.

@mimizh2418 mimizh2418 marked this pull request as ready for review January 30, 2025 00:04
@mimizh2418 mimizh2418 requested a review from a team as a code owner January 30, 2025 00:04
@mimizh2418 mimizh2418 mentioned this pull request Jan 31, 2025
Comment on lines +233 to +236
synchronized (driveConfig) {
driveConfig.MotorOutput.NeutralMode = enabled ? NeutralModeValue.Brake : NeutralModeValue.Coast;
lastDriveConfigStatus =
PhoenixUtil.tryUntilOk(5, () -> drive.getConfigurator().apply(driveConfig.MotorOutput, 0.25));
Copy link
Member

Choose a reason for hiding this comment

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

So you can change the neutral mode of a spinning motor and it doesn't affect it? Please confirm this with docs or testing

Copy link
Member Author

Choose a reason for hiding this comment

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

This has been tested, but it would definitely be beneficial to test this more. I did take this code from 6328 who used it all of last year without problems, however.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also neutral mode only an impact on motor behavior when it's outputting 0V, so changing neutral mode while spinning shouldn't affect anything.

Copy link
Member

Choose a reason for hiding this comment

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

In theory sure but it depends on how their firmware deals with config applications. It could be blocking motor-side, in which case PID loops won't recalculate until it's done.

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