i hope @calcmogul might be able to offer some guidance here.
our robot this year is much heavier than last year’s, so we recently adjusted our swerve drive motor constants and kinematic constraints so that feedforward alone would yield straight-line acceleration and speed close to the maximum possible. it works great.
but then we tried rotation, and found that the feedforward was much too fast, and it occurred to me that the issue is that we’re using a single “kA” for both linear and rotational response. the test rig we were using has almost all the mass near the center, which probably made this effect more noticeable (high mass, low rotational inertia).
is there a standard solution for this situation? i thought about mixing two different “kA” values depending on the angle of each the drive wheel relative to the robot motion, but the students (correctly) felt like that was a hack, and favored decoupling the force and torque on and about the center-of-mass, which seems like a lot of work.
Have you tried finding your angular Ka that describes the acceleration characteristics for your robot when spinning in place? If you haven’t yet, that might be a good place to start, that way you can at least compare the 2 values (I think you should be able to make a direct comparison?)
We used the linear and angular Ka(s) for our robot to calculate for an experimental moment of inertia.
Run SysId with the modules oriented to spin the robot in place.
You now have two gains: Ka_angular and Ka_linear (from the ordinary SysId run). These together can be used to calculate the moment of inertia of the robot, and determine a full(er) model for the swerve drive.
I won’t quote the formula here because it’s dimensionally-laden, but @calcmogul should be able to direct you to how to use the gains in code to control the thing. I believe there may be a code handle that takes them directly (there is one for differential drives).
At least for a differential drive, the evolution of the linear and angular velocity are decoupled. Whether the input is decoupled depends on the input vector choice (e.g., voltage vs acceleration). Maybe something similar will work for swerve.