My team is working on the code to hold our arm in a steady position, and we were wondering if feedforward would help, and if it does, how can i get the kS value for an arm ff, i got the other gains from recalc.
And then how do i apply this feedforward to the pid loop, is it just calculating it from the arm feed forward object in the subsystem and feeding that into the spark max setrefrence method?
The WPILib ArmFeedForward class includes a kG value which is used to fight gravity on a pivoting arm. To tune it, put your arm parallel to the ground and increase kG until the arm stops falling.
Our team also has an arm. We use WPILIB PID control with Neos and a throughbore encoder. We were looking into feedforward control and we found a well-tuned PID worked very accurately for us. We have a small tolerance that we are able to hit quickly and reliably.
Yes, our repository is a little messy but here is our rotating to a setpoint with PID.
We found it a lot more simplistic and friendly to use WPILIB PID control. Many people seem to worry about running PID on the RIO but we didn’t want to increase CAN utilization because we have a lot of motors.