We discussed about Deadtime compensation in the other thread.
I received the boards and tried running in openloop with a hoverboard motor but I wasn’t successful yet, bear with me it’s the first time I use simplefoc.
As I wasn’t sure the serial monitoring is fast enough to visualize the phase current, I used another approach that worked well for me in the past with STM chips.
In platformio.ini, I added -g -ggdb in the build flags.
I declared a variable outside the loop
PhaseCurrent_s current;
I populated this variable in the loop
current = currentSense.getPhaseCurrents();
I am then able to visualize the phase current in STM STUDIO:
What it does is parsing the elf file to find where the variables are stored in memory.
Then it reads or writes the memory with SWIM protocol (STLINK protocol) I think.
I was even thinking about rebuilding this tool in web in a more user friendly way after seing this
I also tried the STM32CubeMonitor in the past, I think it’s the replacement for STM Studio, it has more features but I couldn’t get it to acquire data as fast as STM Studio.
Hey Candas1, I want to try this, but I don’t know how to set up current sense, not quite. I have some idea but am painfully aware of how things can get complicated.
Can you post the exact code you used? I can extract the critical elements and make some elemental code to monitor current with this board.
I want to monitor current to do stall detection. The best thing for me is to watch the combined current of all three phases. That way I can take a single measurement and see what the current draw is, no need to average out a bunch of measurements on a single phase.