Hi everyone, I am struggling to figure out the F-gain usage in position close loop.
Until now I thought the F is just calculated in position mode as:
kF + (PID calculation) .
But when using it with PID values equels to 0 and F equel to 0.5 the motor output change as the setpoint is changing and its not equel to 0.5 as I would expected.
Though the arbitrary feedforward feature is working as I would expected I still like to understand what I am missing here, cause I didn’t found any docs on the F-gain using the position control mode.
Thanks in advance!
So the way linear F actually works is kF * setpoint + otherPIDResults - this is part of what makes it so useful for tuning velocity based PIDs since it gets you ‘in the ball park’ while still allowing the other terms to contribute.
What you’re describing, as you mentioned, is arbitrary feed forward (at least as implemented on the talon SRX and Spark Max) where the arbitrary feed forward value is simply added to the result of the other terms.
As a follow-on - this leaves F often not super useful when tuning a position based PID (not to say never useful, but much less so than with velocity based PIDs.
Mmm I see, that explains the behaviour I saw. Though I am not sure why they left it that way in position mode, it would make sense to make it just kF + PIDResults in this mode.
Thanks for your help!
It’s left that way for consistency. None of the PIDF logic changes between position, velocity, or current closed-loop modes. There are use cases for both feed forwards in all modes, so it makes more sense to have them always be the same.