Hi there! Our team switched to a custom swerve drive setup this year, and it is working for the most part, but we’re having some issues that I haven’t seen other threads about, and I was wondering if anyone would be able to give some insight.
We are using team 364’s swerve template (GitHub - Team364/BaseFalconSwerve) and are going to implement team 177’s swervemodule.java fix (2023-ChargedUp-177/SwerveModule.java at main · BobcatRobotics/2023-ChargedUp-177 · GitHub) to stop the modules from randomly angling after code redeploys. Here’s our code: 2023-ChargedUp-5914/2023Robot_Final at main · nstig22/2023-ChargedUp-5914 · GitHub
Our modules are a custom setup using two Falcons and Rev Through-Bore Encoders on 1:1 gearing from the steering axis. We have them set up in absolute mode through the duty cycle encoder class. We are using a navx2 for our gyro.
1. Modules have to be manually straightened before every boot
Even with the absolute magnetic encoders, the wheels maintain their positions relative to each other, rather than the position of the absolute encoders. If they are not straightened they will be misaligned. Not sure if this is normal for swerve drive, but I haven't seen other teams manually straightening wheels before matches.2. Module alignment issues
We are able to drive through most of a match, but if we take a few good hits, the modules will become misaligned relative to each other. To fix this, we have to manually straighten them and restart. I'm not sure what the cause of this is, because our code is using PID control to account for error in the angles of the modules. Is this just a PID tuning issue or something wrong with the encoders?3. Drive characterization issues
We've recharacterized our drive multiple times with the angle motors in brake mode and the modules clamped straight with pieces of flexcraft. However, the bot still spins when driven straight, indicating that the drive motors on one side are spinning faster than the other. I've made sure our SysId values are correct, but it still doesn't seem to help. It didn't look like it in the code, but is there some characterization that needs to be done for the angle motors?4. Encoder noise
This isn't necessarily an issue, but the SmartDashboard values for the encoder positions read to 6 decimal places that are constantly bouncing around. Would reducing the encoder duty cycle help with this, and would that even be something worth doing?5. Angle motor clicking
Because of the design of the modules, there is a small amount of slop in the gears the angle motors drive through. This leads to noise coming from the Falcons that keep trying to correct the position when the error is just the backlash in the gears. It doesn't happen with every movement, but will this burn out the Falcons eventually?Any insight into these issues would be greatly appreciated. Thanks!