Skip to main content

Tuning Avice

Tuning Advice

Try tuning using the following steps:

  1. Use MotionMagicTorqueCurrentFOC
  2. Start with all gains 0
  3. Set kA to 1
  4. Set Motion Magic cruise velocity to 1
  5. Set Motion Magic cruise acceleration to 2
  6. Slowly increase kS starting from 1, doubling as needed. Try to make your actual velocity and position match the reference as closely as possible using only kS
  7. If you are unable to close the gap, start increasing kP

Notes

  • On a real bot, we would use kG as well as kS because gravity exists. In a non-physics-based simulation, we don’t have gravity, so you can just use kS
  • Due to the lack of friction and other external effects, tuning in the sim should not be too difficult
  • According to conversations with CTRE folks, because acceleration is directly proportional to current, and TorqueCurrentFOC controls current, kA should just need to be 1. This is because it is a multiplier and you just need kS and kG to bring you up to where you need to be.