Brushed Motor Control?

Thanks @Wetmelon and @madcowswe in the discord chat the other day. After we talked it finally dawned on me that I just needed to find which variables provide measured current, and then I just make a normal current controller based on that feedback. All the magic in FOC_Current apparently distracted me from realizing I just didn’t know where measured current comes from.

1 Like

Okay! Brushed motor current control is working great on my branch. I can use the trapezoidal position control which is great. Some of the command implementations are a bit hacky, but if anyone (@Wetmelon?) wants to merge this somewhere I can clean up anything. I wasn’t sure whether I should add new command values to control some of the things or just hijack some existing ones.

But the Odrive is great for brushed motor control. I still need precise feedback and some of the other motors on our robot are brushless, so sticking with one controller is great. Some day I may want to control three brushed motors from one Odrive but that’s code for another time!

For completeness I’ve uploaded my config and startup script as well.