YAGSL Swerve Drive Help

Hi!

We are running into some huge issues with our swerve drive (again). This time, after driving, 3/4 of our swerves pivots just start going crazy - no input from controller anymore, they just start to randomly pivot around. This weirdly only happens without controller input - as soon as we start driving with controller again, it works fine and stops randomly pivoting.

Any thoughts? Our code is here: https://github.com/MontclairRobotics/YAGSL-Swerve

1 Like

Here’s a quick video of the problem. Sorry if the earlier explanation wasn’t super sound.
IMG_3607-ezgif.com-video-to-gif-converter
Any ideas?

Can you send a video with FRC Web Components or Elastic?

Sorry, I’m not with the robot anymore. But when the problem was happening the module setpoints stayed constant, but the encoders were reading rapidly changing values. We also forgot to mention in our post that the problem only occurs for the first time after boot after the swerve drive receives input other than zero. After that, it happens whenever there is no stick input.

I have also linked the correct repository, sorry about that, the one that was linked is from our old drive implementation.

I can send a video tomorrow if this isn’t enough information. Thanks so much for your help!

That sounds like an inversion state issue. or a PID issue. The TalonFX PID’s are orders of magnitudes larger than SparkMAX ones.

Just looking and noticed your inversion states are not uniform. Are you sure they’re correct?

I’m not positive about the inversion states, but the robot was driving a few weeks ago using the same exact program and configuration. We even tried reverting to the commit where the robot worked properly. We are using CANSparkMax motors for turning, not falcons. Also, we tried reducing kp by a lot, and the problem persisted, just much slower so as far as I can tell it is not an overshoot problem.

Then maybe you should redo the configuration and maybe it will work?

We played some of the inversions and offsets with no success. Here’s a video of smart dashboard:

Thanks for your help!

Can you send a video of FRC Web Components?

Thank you so much for your help, we hadn’t realized that the electronics were changed when the drivetrain was redone. The two CANCoders that were acting up had switched CAN IDs, and all of the falcons were shifted by 90 degrees. By redoing all of the CAN IDs and inverts, our drivetrain is now working perfectly. Thank you again!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.