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

Potential for module to spin while idle #21

Open
willtoth opened this issue Feb 22, 2022 · 0 comments
Open

Potential for module to spin while idle #21

willtoth opened this issue Feb 22, 2022 · 0 comments

Comments

@willtoth
Copy link

Hello Triple Helix!

Our team FRC3005 was looking at your implementation for the brake() function and pulled in something similar. We ran into an issue only on one of the modules, and I figured I would pass along our learning.

Just to make sure I understand the intent. The idea is to keep the modules in the same orientation when you let go of the joystick, to avoid excess module movement.

module.setDesiredState(new SwerveModuleState(0, module.getState().angle));

The issue we were seeing is one of the modules would slowly spin whenever we had the joystick in a neutral location, and confirmed that it was in fact calling the neutral case.

The call to getState() gets the current module position. I think what we were seeing is this had a slight delay, or maybe some effect from the backlash in the system (didn't spend too much time on the root cause). So my guess is it would set the position of the module to some point slightly ahead of where it actually was, causing it to rotate.

To work around this, we changed getState() to getDesiredState() which we added to the SwerveModule class. This resolved the issue.

I figure since we had referenced your implementation we'd pass this along, if y'all haven't seen anything like this feel free to ignore. Great reveal video and good luck this season!

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

No branches or pull requests

1 participant