Custom FOC control: Current measurement / DMA Timer interrupt needs review
Hello,
We are working on implementing a custom FOC control for hoveboards on the stock boards that feature an STM32F103RCT6 with 2 phase current measurement.
However, we encounter issues when measuring the Phase currents. They appear to be noisy with high peaks (see attached picture).
https://user-images.githubusercontent.com/24780745/60458354-b0d27a00-9c3e-11e9-99ca-e87e29aa17ed.png
The problem could be that we do not trigger the current measurement at the right moment, when the lower MOSFET is conducting.
Thus, I am asking if you can review the settings for the DMA interrupt by the timer?
More exactly, to review the following files:
master/Src/setup.c
master/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h
All the files can be found on github (along with the full project) here:
https://github.com/EmanuelFeru/hoverboard-firmware-hack
EDIT: For more details, there is an open issue on this topic on github:
https://github.com/bipropellant/bipropellant-hoverboard-firmware/issues/41
We would greatly appreciate it.
Thank you in advance!
