Trial-N-Terror-FRC-7900 / YAGSL-Max-Swerve-Example

Apache License 2.0
0 stars 1 forks source link

Absolute encoder offsets? #2

Closed jaredandrews closed 7 months ago

jaredandrews commented 7 months ago

Hi, my team is trying to setup our 2023 robot to use YAGSL as a test case for our 2024 robot. We are using MAX Swerve.

We are stuck on the "absolute encoder offsets" bit, we started by following the procedure described here. Which did not get the job done. Started googling and found this repo.

I'm wondering if you would mind expanding this note from the README:

"Absolute Encoder offsets should be done on the sparkmaxes directly. Ignore the offsets in the JSON config files. We initally set the offsets using the MaxSwerve jigs, but then adjusted the offsets in the Rev Hardware Client in the advanced tab. Adjust in +/-0.25 increments until all the modules will run in the same direction. Using YAGSL currently may cause the modules to jitter. We plan to put in sparkmax offsets using the RevLib Directly."

What do you mean by this? We have calibrated the modules based using Rev Hardware client, which I assume yall did as well? We don't see any offset values in the advanced tab, so we are not really sure what we are looking for here. Any advice would be appreciated and thank you for sharing this repo!

Technologyman00 commented 7 months ago

Calibrating through the Rev Hardware Client won't work perfectly if you are using the calibration brackets. YAGSL expects the wheels to all face forward when at 0. The calibration brackets don't do that. You can just add or subtract 0.25 to the absolute Encoder offset to get them all facing forward.

But if you are setting the offsets in the Sparkmaxes set the JSON offsets to 0.

jaredandrews commented 7 months ago

Thanks for the response, we appreciate it!

Just to clarify when you say "You can just add or subtract 0.25 to the absolute Encoder offset to get them all facing forward" are you referring to:

In the advanced tab of Rev Hardware Client for a particular SparkMAX, Duty Cycle Absolute Encoder -> kDutyCycleZeroOffset? Or is there a different variable we should be seeking?

Technologyman00 commented 7 months ago

Yeah that's correct

jaredandrews commented 7 months ago

Cool, we will give that a shot. Thank you so much for your help!