Hi, so my team and me are workning on programming a swerve drive. We already did the basic swerve code drive and it works pretty great, but I was wondering if there are any tips for making a better swerve code, in a way that the robot itself moves better/faster.
It would certainly help if we could see your code to see what you’ve already done but here are some good practices for increased speed/reliability:
Control both turning and driving with position and velocity PID, respectively.
Current limit your motors as high as you reasonably can, as this will increase peak power and thus acceleration and speed. 60 for each drive motor is a good starting point, but if your batteries are in good health (internal resistance <=0.015) you could easily go up to 70 or even 80.
Ensure you have a skew limiter on your joysticks to slow down acceleration a bit. This will lessen the likelihood of tipping by a LOT.
Try to use onboard PID for the turning motor if possible. This will generally be much more reliable and react significantly quicker than using your absolute encoder as a feedback device.
Actually I don’t understand quite well how feedforward affects the robot movement, I know how to do it but I Don’t know its pros and cons, so does feedforward only improves its drive on autonomous or is it also better in teleop?
When talking about feedforward are you talking about the modules themselves specifically or factoring in the overall robot acceleration/velocity as a whole? We tried doing a regression on the velocities of our individual modules and their velocities this year, and simply put, it didn’t work.