First- thanks to all the people who did the work to make these tools possible (Jaci, Oblarg, 254, CTRE, and more). I’ve searched through all of the Pathfinder and profiling threads to get help first.
We have been trying to tune any of the various motion profiling tools available and haven’t gotten any to work reasonably (we are on a swerve drivebase, with C++ source code). We started with Jaci’s Pathfinder, and made the drivebase go forward 5 feet. That worked (+/- a few inches - that I assumed we could tune or hard code out), but it was very slow - maybe 2-3 seconds.
We tried tweaking the Kv, Ka, and P/D to no avail, and had two outcomes. One was where the robot would essentially twitch or stutter roughly in the same location. I surmise the robot and control was oscillating, perhaps at each segment in the path plan. With other parameters, we are able to have the robot reasonably get to the 5 foot set point, but it passes it by about a foot or two, then goes all the way back to 0, and then creeps back up to 5. So in that case it seems to be oscillating only around the final set point.
From there, we read the Oblarg Drivetrain characterization paper,
And calculated out theoretical and empirical values for Kv and Ka. They correlated well, and we used those the Pathfinder, but still had the same general issues. We were also able to make the robot race forward 20+ (beyond the 5 foot set point) and we just shut it down.
In all the threads, I don’t see anyone claiming they definitively tuned Pathfinder (stand-alone on the Robo-Rio), effectively. If anyone is aware of a team that did and we could browse their code, that would be helpful.
We were considering some potential issues with slow CAN bus response, or network delays, etc, and tried to move the loop closure to the Talon. So we had Pathfinder generating the path, and effectively stream that to the Talon for motion profiling. We have looked through various teams repositories who suggest they do this successfully, and haven’t had this working yet, either. This also sees to run very slow, if at all.
It seems like we have some parameter off, but we haven’t found any way to tune this effectively.
Any tips or advice are appreciated. Code is here, but has been back and forth over different approaches in the last few days: