My team, Team 6897, is new to using swerve drive this year.
We were originally running the bot in Field Centric orientation and strafing was working fine. However, when turning in place, the bot would not pivot around the center of the bot. We remeasured our bot’s dimensions and tried switching them around and the same thing happened. The thing is, the bot more drifts than pivots because the bot doesn’t end up at the same spot after a full rotation nor does it end up back at the same spot after a full rotation in the opposite direction.
We then tried switching to robot centric in our code and turn in place was now working better, albeit having slight drift, but turning while strafing instead causes the bot to drive in a large circle (pivoting around a side of the bot).
We are not pivoting around a specified point and kept the pivot point in the center. We also tried messing around with the weight of the bot (trying to make sure the weight is in the center), cleaning the wheels, and even tuning the feedforward of every drive motor. We don’t really know what else to try, but we suspect it could be a NavX issue (at least for the field centric ) and the remaining issue in robot centric seems more likely to be a code issue, but we don’t know what exactly it would be.
Anyone have any tips / things to look at and/or a solution for either of the issues?
(P.S. we are using Rev 3in MAXSwerve modules and the NavX 2.0)
The spinning in a large circle while in robot-oriented drive is not an issue. That is supposed to happen because driving forward is based on the front of the robot, and since the robot is spinning, so is the front of the robot. This causes a large circle instead of spinning while going in the desired direction.
The drift while in field oriented is interesting, I never experienced this so I wouldn’t know what is causing this. Just from some experience that caused a lot of headaches, are you sure all your modules are using the same driving motor pinion? We had one module using a different pinion and it was causing drift.
We’re thinking it might be because we didn’t have the navx in the center of the bot. Do you think that would have an effect on the drift in field centric?
That would not be causing the issue here, 250 had their navx on the right side of the robot not even close to being centered and we did not experience the drift you are talking about.
I wish I could try to help more but I cannot think of anything else that could be causing it.
Perhaps one (or more) of your encoder offsets are off? If you have the robot on blocks or on its side, do any of the wheels visibly point in a different direction when commanded to drive straight?
That’s probably not updated code, I don’t think we have a public repository with current code rn, we can push what we have now and publish it so that you can look and we can send a link once we do.