Hi,
I think you should capture this image when motor is coasting to find the hall sensor errors or you can capture by sniping motor freely with hand (without commutation).
To find the commutation point, in zero crossing event, start a timer with period value equals to half the time between two zero crossing (half the time between previous and current zero crossing event). In timer period match ISR do the commutation. Adjust offset if any due to software latency etc.
At higher speed make sure zero crossing detection is proper to avoid the speed oscillation. Because at higher speed number of PWM in one commutation will be less and during PWM off time you will not get zero crossing, it will lead to position (commutation) error. If number of PWM cycles is very few (< 2 or 3) in one commutation, increase the PWM switching frequency.
Thanks
Abhishek
I think you should capture this image when motor is coasting to find the hall sensor errors or you can capture by sniping motor freely with hand (without commutation).
To find the commutation point, in zero crossing event, start a timer with period value equals to half the time between two zero crossing (half the time between previous and current zero crossing event). In timer period match ISR do the commutation. Adjust offset if any due to software latency etc.
At higher speed make sure zero crossing detection is proper to avoid the speed oscillation. Because at higher speed number of PWM in one commutation will be less and during PWM off time you will not get zero crossing, it will lead to position (commutation) error. If number of PWM cycles is very few (< 2 or 3) in one commutation, increase the PWM switching frequency.
Thanks
Abhishek