TalonSRX Motion Profiling Issues

We are trying to use the Talon SRX Motion Profile feature on our 6 wheel drivetrain for autonomous driving. We have 3 Talons on each side of the drivetrain, one with a CTRE Magnetic Encoder connected and setup in Motion Profile mode, and the other two setup in follower mode.

Using the CTRE example Motion Profile Java code as a reference and Team 254’s motion profile path planning code, we are able to get our robot to drive in a straight line and end in the same spot very reliably.

However, when we add any left/right adjustment to our path or change the heading, the robot will drive to that spot and then begin oscillating back and forth (turning left/right).

We have tried several things to fix this issue, and the only one that had some success was when we reach the last point in the profile, set the Talon’s state to be disabled instead of trying to hold its current position (this results in 1-2 seconds of oscillation, then it stops).

Any ideas or input would be appreciated.

If you have some integral gain set, it may be trying to correct a very small error in final position. Curved paths are harder to get perfect the first time. See this thread for discussion of why curved and straight paths have different challenges where I got some great help from others:

https://www.chiefdelphi.com/forums/showthread.php?t=154671&highlight=path

You might want to try using the Motion Magic mode. It’s really convenient.
Even with Motion Magic, though, calculating the PIDF values can be tricky. I posted a blog that might help: