Also, how can we run our PIDF loops at higher frequency then base command based robot frequency? (we program in c++ and would appreciate examples if relevant)
How about motion profiles for velocity closed loop? I saw that I can calibraet Kf for the talonSRX but I couldn’t understand how does the constant translate to output.
Do you know how can I run high frequency PID loops in c++?
Why do you think you need motion profile to control the speed of your flywheel? Most teams using the SRX built-in PIDF for that application just use simple setpoint commands. If you are concerned about high current draw at initial spinup, just use the voltage ramping or closed-loop rate control of the SRX PIDF.
Do you know how can I run high frequency PID loops in c++?
How high is “high frequency” in this context? The PIDF in the SRX runs at 1KHz.
…drive distance…
You can use motion profile for that. Use v(t) from the profile as your feedforward input, and x(t) as your setpoint input. i.e. closed-loop position control with velocity feedforward.