Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).
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 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.