This firmware implements FOC motor control on a STM32F103 microcontroller. The code was written from scratch and is relatively simple to understand for developers.
The purpose of this repository FOC motor control code is to be included as a library / git submodule on your project!!
See the example folder. In that example, a throttle is used to define the motor target current. Here a video showing this example driving a Xiaomi EScooter M365 motor:
Here a video showing this example driving a TSDZ2 Ebike mid drive motor: