We’re trying to get swerve code written in Python and have been having problems with our turning motors that just keep oscillating. We see that the desired angle is oscillating which I assume is what is making the actual turn motors oscillate. We are using Neos for both the drive and turn motors with this as our turning encoder: MA3 Absolute Encoder with Cable - AndyMark, Inc. We have verified multiple times things like CAN ids, analog ports, etc.
Op, could you update the thread title to have a few more details if you can? For example, “python swerve, turning motor oscillations”
This will help get eyes on the thread better.
As far as this issue is concerned: I would look into the PID tuning and if the D term is tuned correctly/enough.
It is possible the D term isn’t sufficient for the range of input values the encoder is providing.
Tuning PIDF
Another good way to describe it from CTRE is
Manual tuning typically follows this process:
Set , and to zero.
Increase until the output starts to oscillate around the setpoint.
Increase as much as possible without introducing jittering to the response.