Tuning Avice
Tuning Advice
Try tuning using the following steps:
- Use MotionMagicTorqueCurrentFOC
- Start with all gains 0
- Set kA to 1
- Set Motion Magic cruise velocity to 1
- Set Motion Magic cruise acceleration to 2
- 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
- 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.
No Comments