Hi,
The iMxRT1062 used in Teensy 4.x was designed by NXP to perform scalar or vector motor control.
I published the Arduino eFlexPwm library allowing to use all the features of NXP eFlexPwm timers to control motors or inverters.
It is still possible to use analogWrite() on timers that are not used by the library.
This library is available in the library managers Arduino and Platformio.
The code is published on GitHub, it is still in beta version, but the work is progressing well.
Here, for example, is the result of the generation of a sine for the control of a single-phase inverter :
and the corresponding code
I am currently working on the control of a three-phase motor.
Hope this is useful to you.
The iMxRT1062 used in Teensy 4.x was designed by NXP to perform scalar or vector motor control.
I published the Arduino eFlexPwm library allowing to use all the features of NXP eFlexPwm timers to control motors or inverters.
It is still possible to use analogWrite() on timers that are not used by the library.
This library is available in the library managers Arduino and Platformio.
The code is published on GitHub, it is still in beta version, but the work is progressing well.
Here, for example, is the result of the generation of a sine for the control of a single-phase inverter :
and the corresponding code
I am currently working on the control of a three-phase motor.
Hope this is useful to you.