Down The VelocityTorqueCurrentFOC Road

How to tune for Velocity

We like to use MotionMagic because it makes speed changes smoother! We use MotionMagic for basically all of our motion profiles.

When using a velocity profile, you are trying to get the motor to spin at a specific velocity instead of a rotating specific amount of rotations.

The Plot

In Phoenix Tuner, plot Velocity (rotations/sec) and Acceleration (rotations/sec2).

  • You might want to turn off Acceleration because it is a very noisy signal

Then also plot Reference (rotations/sec) and ReferenceSlope (rotations/sec2).

Make sure the Reference and ReferenceSlope are from PIDVelocity (not PIDPosition)

Gain Configurations

Motion Magic

FeedForward and FeedBack

Try to minimize the amount of feedback gains while tuning, but use them if necessary

These should get you pretty close to the Reference line - change kP and kD a little bit to get to your desired accuracy!

 

Specifics for Flywheel Tuning

While tuning flywheels, we are trying to get the motor to get to its target as fast as possible. When a game piece (such as a ball) goes through it, it should take as little time as possible to ramp back up to speed.

img1forwiki.png

Remember: kP makes the motor move faster if the error is bigger, and kD resists changes to the motor's velocity

imgforwiki2.png


Revision #3
Created 7 February 2026 23:08:36 by Amit Choudhary
Updated 15 February 2026 19:13:55 by Amit Choudhary