Initial implementation of the teesny4 low-side current sensing support for 6pwm and 3pwm drivers.
The implmentation is limited to one motor and the moment and uses only one ADC (ADC1).
The 6pwm driver is supported by defalut.
The 3pwm driver is not supported by defualt.
This is due to preserve the backward compatibility because, in order to use low-side current sensing with 3pwm drivers they need to be center aligned and using flexpwm timers. In the current simplefoc implementation we allow for using any combination of flexpwm timers and quadtimers. If the user wants to use low-side current sensing he needs to include TEENSY4_FORCE_CENTER_ALIGNED_3PWM build flag. By either
adding it in the platformio.ini file -DTEENSY4_FORCE_CENTER_ALIGNED_3PWM
uncommenting the line 13 in the src\drivers\hardware_specific\teensy\teensy4_mcu.cpp file.
Additionally, make sure to use all three phases on flexpwm timers and on their A or B channels (it they are not simplefoc will show an error message).
In the next versions of the SimpleFOC we will make sure to make the usage of the 3pwm drivers with low-side current sensing a bit more straight forward.
Initial implementation of the teesny4 low-side current sensing support for 6pwm and 3pwm drivers. The implmentation is limited to one motor and the moment and uses only one ADC (ADC1).
TEENSY4_FORCE_CENTER_ALIGNED_3PWM
build flag. By eitherplatformio.ini
file-DTEENSY4_FORCE_CENTER_ALIGNED_3PWM
src\drivers\hardware_specific\teensy\teensy4_mcu.cpp
file. Additionally, make sure to use all three phases on flexpwm timers and on their A or B channels (it they are not simplefoc will show an error message).In the next versions of the SimpleFOC we will make sure to make the usage of the 3pwm drivers with low-side current sensing a bit more straight forward.