Hi, this is a very interesting topic an I actually stumbled upon the same part of the code a few days ago. Is there any specific reason you chose the same update frequency for the 3 control loops? Correct me, but I thought a common practice is to have a cascade control scheme with the inner loop(s) always being faster than the outer one(s).
We could split it up to have say the current controller run much faster update rate than the position loop. The reason people usually do this is because it can be wasteful of the CPU resources to update the position loop much faster than the bandwidth. The reason we haven’t done this is because we have enough CPU resources even though we run the position loop so fast.
Though in the future we wish to run the PWM switching frequency faster, then we might split up the frequency of the current controller to run faster.
Something like that. Though I think we will keep the pos and vel loop together. But the same concept between the current loop and the pos/vel loops yes.