-
Notifications
You must be signed in to change notification settings - Fork 1
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
Phoenix6 update #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to use the new configuration API to its fullest potential, it will make your code much cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greate fixes, just a few more!
Still needs work
Yes I know it's bad sorry
One comment left! #3 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is beautiful code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎸 Good job!
driveMotor.getConfigurator().apply(driveConfig.Slot0); | ||
angleMotor.getConfigurator().apply(angleConfig.Slot0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I just have two last little things.
- It's not a very good idea to update the PID inside the motor every loop. You need to use the
hasChanged
method in theLoggedTunableNumber
object. - The
Slot0
object is never updated, so the PID would never really change.
private final Integral driveSupplyChargeUsedCoulomb = new Integral(); | ||
private final Integral driveStatorChargeUsedCoulomb = new Integral(); | ||
private final Integral angleSupplyChargeUsedCoulomb = new Integral(); | ||
private final Integral angleStatorChargeUsedCoulomb = new Integral(); | ||
private final MotionMagicVoltage angleControlRequest = | ||
new MotionMagicVoltage(0).withEnableFOC(true).withSlot(0); | ||
private final PositionVoltage angleControlRequest = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use the new Motion Magic Expo mode
https://pro.docs.ctr-electronics.com/en/stable/docs/api-reference/device-specific/talonfx/motion-magic.html#motion-magic-expo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tried using the motion magic expo, and we tried normal motion magic. But in the end we found that regular position control is best.
…update them in ModuleIO
No description provided.