Is my intention to do SPWM on BLDC using 32bit MCU with 6PWM. To do this I will be using 512 point sine LTU. I already do this by just feeding the PWM outputs of the MCU and I'm able to move the BLDC without any problems. But this is done in open loop, so my question is regarding close loop. As I understand If I wanna close the loop by sensing Bemf I will need to put the sine wave in phase with the Bemf. I need to implement a PLL between the sine wave and the Bemf and then accordinng to the difference update the PWM (incrementing or decrementing the position of the pointer to the LTU).
My questions are:
How do I perform this PLL in code?
In a close loop do I need to send the duty cycle to the motor like in the commutation control? Sense Bemf, PLL and send duty cicle to PWM, sense again bemf...and so on? Open loop is not a problem to do, but close the loop sensing the Bemf and how to do that inn code without example code is difficult. Is there a reference to read about SPWM? I know that most people use FOC, but first I wanna understand SPWM close loop.