Smooth commutation

A project log for Ø32 BLDC Controller

Miniature closed-loop controller for brushless DC motors

christopher-xuChristopher Xu 07/02/2023 at 23:562 Comments

A classic: using too many printf statements (over UART) that the code execution was taking too long and causing inconsistent commutation. Now it is spinning so much quieter and with more torque, at around 5200rpm. It should be able to go faster, I'm only applying about half duty cycle at the moment.


Twisted Pair in my Hair wrote 07/03/2023 at 06:34 point

Have you considered adding CAN bus interface to the next revision of this project? Out of all currently available MCUs of STSPIN series only STSPIN32G4 has it. Traditional printf-style debugging with CAN doesn't make much sense, but you can easily monitor the changing values over time with GUI software like cangaroo or just output the values that you are interested in the terminal.

  Are you sure? yes | no

Christopher Xu wrote 07/03/2023 at 12:32 point

That's a good point, I do want to use the STSPIN32G4 in the next revision because of its CAN capability and also the 170MHz clock speed (compared to 48MHz). Right now I'm printing over UART because of simplicity but it does have I2C and a differential RS485 transceiver so I plan to create a protocol that mimics CAN. Here are the beginnings of its bidirectional communication:

  Are you sure? yes | no