Current control bandwidth

Hi,

ODrive has been working great for our project and I plan to do some bandwidth analysis of our system in terms of current, velocity, and position. Similar topic to this discussion.

I have a few question about the control frequency of ODrive.

As mentioned in the documentation, the ODrive control architecture is a cascaded structure, (inner->outer loops: current, velocity, and position). From this discussion and this post, it seems the innermost current control loop is running at 8kHz. Although @madcowswe mentioned that all three loops are running at 8kHz, it is little difficult for me to believe outer loops running at the same frequency as the inner loop, as @raggot pointed out in his post. Has anyone tested or can anyone confirm that all three loops running at 8kHz?

A follow-up question. In odrv0,axis0.motor.config.current_control_bandwidth, we can change the current control bandwidth and it has a default value of 1000Hz. If I leave it as default, does that mean all three loops on my controller is running at 1kHz? Similar if I change it to 2000Hz, will all loops running at 2kHz?

Also, there are audible high frequency noise when I increased the current control bandwidth beyond 1000Hz. Has anyone else experienced this issue? Maybe it’s a gain problem, since I changed the current controller gains?

Any comment, suggestion, and opinion are welcome!

Thank you!

You have to be careful to separate update rate from bandwidth.
All loops have an update rate of 8kHz.
If you set the current control loop bandwidth to “1000”, it will have a bandwidth of 1000/s (sometimes also called 1000rad/s or 160Hz), also interpreted as a time constant of 1 millisecond.
The velocity and position control bandwidth will be a function of the encoder bandwidth, your load mass/inertia, and your velocity and position gains.

Thank you very much for this information! It makes much more sense now.

Just to understand things a little bit more clearly, when I increase/decrease the current control loop bandwidth setting in ODrive, what’s essentially I’m changing? PWM carrier frequency? The 8kHz update rate?

I hope this may help me understand why the audible current noise starts to become more and more noticable when I increased the current control loop bandwidth from 1000 to 4000.

Thanks again!

Neither of those. You are changing how fast it tries to correct for errors seen on the current sense feedback. You are trading noise vs reaction time.

Thanks again for explanation. Is the current control bandwidth here essentially the desired crossover frequency in the current controller? Once I choose a current control bandwidth, the P and I gains of the current control will be calculated based on this value, along with the identified motor electrical parameters (resistance and inductance)? Is this understanding correct?

Side question, if ignore the audible noise, what is the theoretically maximum achievable current control bandwidth of ODrive? Have you guys done this test?

Yes, exactly.

I’m not exactly sure. I’m not sure anyone’s just fed it a current-control-mode sine wave. It maxes out at about 550 eRPM though, just as a reference

Thank you very much for confirming!