Reasonable PID Values for Arm

Hi,

I am new to PID tuning, and want to receive a bit of closure that my values are reasonable for an arm. My values are attached below:

It depends highly on your arm mass, gear ratio, motors, encoder units. We have an 8 lbs arm, 24in long, on a 160:1 gear ratio running on 2 Spark Max’s and NEO’s. Our PIDF values are:

P: 5e-5
I: 0
D: 0.001
F:0.00017

We are also running in smart motion with a max V of 5500 and max A of 9000.

1 Like

While I don’t have our PID values off the bat, as @sthump correctly said, your PID values will most likely be different from almost every other team’s. in terms of actually tuning, the best way I’ve found is to set everything to 0, and increase kP until there is perfect, constant oscillation. Then cut kP in half, and go from there. Formally, the best method I’ve found is the Zeigler-Nichols method.

1 Like

I would also say that these values are dependant on the pid algorithm you are using and closed loop mode you are using. SparkMax vs Falcon and Velocity vs position vs smart motion.

Last arms can beifit greatly from arbitrary f values. Which are measured by deterining the raw motor output required to hold the arm horizontal. Then doing trig based on the currently measured angle toget the value for that moment in time.

1 Like

There’s no one size fits all solution to pid gains, but there is a way to calculate a starting point before you tune so you’re at least starting from somewhere.

CTRE’s website says you can do the following:
kF = (x% * 1032) / [velocity at x%]
Essentially, take the percent output that you are wanting to run your arm at multiply by 1023, then divide by what velocity (in units/100ms) you’re expecting that demand to produce.

kP is essentially saying at what point are you going to respond, and with how much. The website says you can calculate a starting point like this:
kP = ([adjustment %] * 1023) / [how much error before your start correcting]
say you want to adjust by 10% once the motor falls 2048 ticks behind, your formula would be
kP = (0.1 * 1023) / 2048

if you want to read up more, I’d recommend this page, it’s CTRE’s guide to close-loop control with PID, as well as going into MotionMagic, which you most likely won’t be needing.

I think you may be mistaking this heuristic as a definition…

2 Likes