How to learn FOC in C?

Greetings everyone,
I hope all of you are doing well!

I want to learn how to implement FOC in C.

I have a DRV8312EVM development kit and TMS320F28069M (C2000) Launchpad at my workplace and I have gone through most of the PMSM-FOC code that TI provides for it.

I have been going through the VESC codebase as well, and I see how the TI code lacks considerably compared to it.

I have modelled an induction motor and developed FOC for it previously in Simulink (model-based design) during an internship, and well couldn’t go past tuning the two PI regulators in the inner current-loop.

I have come across simpleFOC and this seems like a good way to build intuition, with a top-down approach. Arduino is the simplest way to get started, and given how I have some beginner experience with launchpads and nucleo boards and crazy c-code, it would be nice to not worry about the code for a while and focus on implementing just the FOC with the arduino. And then I can delve deeper into the library, play around, and draw parallels with the other more production-ready code-bases I am dealing with.

Is this a good approach?

I have read a lot of theory and it just never ends. There’s non-linear control and what not. I wanna take a break from that and just get my hands dirty and get some general working knowledge of FOC implementation.

Also I am planning to get a TI DRV8301 driver board, as it would be compatible with both Arduino and the C2000 Launchpad, what do you think? It’s a good choice right?

Thank you for taking the time to read! Do give your suggestions!

Warm Regards

Hi @elemoman welcome to SimpleFOC!

Sorry for the slow response. Your suggested approach sounds very reasonable.

Using Arduino makes many things easy and allows you to focus on the parts you’re interested in. A principal advantage is also that it is cross platform, allowing you to reuse code across different projects.

However, the PWM drivers needed to support advanced motor control (like SimpleFOC or the products you mentioned) are not native to Arduino. Our library implements them for each MCU family we support, and unfortunately TI MCUs are at the moment not among the supported ones.