Arm Feedforward

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 best way is to probably run a SysID Routine for it.

Here is a tutorial on SysID:

Is it possible for me to limit how far it can rotate? it can’t rotate 360 degrees.

Do you also know if I’m correct with how to use the ArmFeedForward

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.

How do i actually use the Feedforward with a sparkmax PID controller?

You pass it in when you set the reference of the pid controller. SparkMaxPIDController (FRC-REVLib API)

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.

Thanks! so for holding id run ArmFeedForward.calculate() with my desired position and a velocity of zero?

1 Like

Could i look at your code?

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.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.