Add the Derivative Portion to the PI Loop Controller

I have been using the velocity control, and to my understanding, it uses a PI controller. I was wondering if there is a way to add the D portion and make it a PID controller. How can I make it happen?

Thank you in advance

Hi! From a control theory standpoint there’s actually no need for a derivative term, and it would actually only hurt performance. If you’re seeing velocity overshoot, then that’s likely a result of velocity integrator windup as an effect of commanding infeasible velocity setpoints – e.g. a rapid step change. You can try using the VEL_RAMP input mode to limit acceleration to a feasible value for your system, which will greatly increase tracking accuracy.

ODrive has a nested velocity PI inside position loop. Multiplied together it forms a classic position PID loop, and is equivalent.