Skip to main content
jovijuan
Associate III
September 17, 2025
Question

Wrong 6-step commutation from Hall sensors not 60° aligned since v6.4.0

  • September 17, 2025
  • 1 reply
  • 959 views

I have a custom board with a STM32G491 with a single-shunt driver for 6-step with hall effect sensors.

One of the motors I have has a hall sensor placement close to 120°. I followed the process described in documentation (section 3. "Setting up the system when using Hall-effect sensors" in "Hall sensor feedback processing" page) and the Hall delay, described as "the delay in electrical degrees between the maximum of the B-emf induced on phase A and the first rising edge of signal H1" was approximately 108°.

I used that value with v6.3.2 and I confirmed that current through motor phases was cleaner with 108° than with 120° (with both values rotating correctly)

When v6.4.0 came out I tried the same configuration. The motor only vibrated violently with either 120° or 108° for hall delay. I reported it in this forum and a code modification was suggested that eventually was included in v6.4.1. But that solution only fixed when Hall delay is aligned with 60° steps.

With v6.4.1:

  • If I set 120° (it results, in the code, in a STEP_SHIFT of 2 and PHASE_SHIFT_DEG of 0) the motor rotates ok.
  • If I set 108° (it results, in the code, in a STEP_SHIFT of 1 and PHASE_SHIFT_DEG of 48) the motor vibrates violently again.
  • If I set 130° (it results, in the code, in a STEP_SHIFT of 2 and PHASE_SHIFT_DEG of 10), the motor rotates ok, but I don't know if the delay is ok. Same happens with other values above 120.

There seems to be an issue with the way that STEP_SHIFT and PHASE_SHIFT_DEG are used.

If I understood hall sensor delay definition correctly, in a motor where hall delay is 130° instead of 120°, the step commutation should have been advanced 10 electrical degrees in forward direction and delayed 10 electrical degrees in backwards direction versus the 120° version, but in both of them it seems delayed.
I added a toggle to an output pin during the CC2 ISR handling (used when PHASE_SHIFT_DEG is not 0 to call SixStep_StepCommution()) and captured hall signals and that pin signal both in forward and backward:

Forward:

jovijuan_0-1758130538901.png


Backward:

jovijuan_1-1758130563640.png

In both directions the toggles are always approximately 10 electrical degrees from hall changes, but delayed in both cases.

I also confirmed that, instead of STEP_SHIFT = 1 and PHASE_SHIFT_DEG = 50, I manually set STEP_SHIFT = 3 and PHASE_SHIFT_DEG = 50, the motor rotates in forward direction with no vibration, with commutation 10 degrees below the commutation it would show with 120 (STEP_SHIFT = 2 and PHASE_SHIFT_DEG = 0)

This is why I think that the logic for the conversion from hall status to steps and that sets commutation and sets CC2 ISR is wrong, but I have not figured out how to fix it.

 

1 reply

Associate II
September 18, 2025

I have a similar problem.
Sadly, I didn’t get any reply from the official side after I reported it.


https://community.st.com/t5/stm32-mcus-motor-control/open-loop-control-in-mcsdk-6-4-1-cw-and-ccw-have-huge-difference/td-p/837018

Fabrice LOUBEYRE
ST Employee
September 26, 2025

Hi @jovijuanfirst, I apologize for the delay.

First, I remind you that:

The Hall sensor placement, which refers to the electrical angle shift between each position of the Hall sensor with two possible configurations (60 or 120 electrical degrees), and the phase shift, which is the electrical angle shift between the H1 Hall sensor and the actual 0-degree electrical angle, are static.

Do you use different types of motors or only one motor while trying different phase shift values (120, 108, 130) because the actual value is unknown?

We do not have a motor with, for example, a phase shift value of 108 degrees. Can you provide us with the reference of your motor, please?

I am concerned that the MCSDK firmware supports only motors with a phase shift value equal to (modulo 60) + [0..30] degrees.

Below, you will find an updated version of the Hall management for MCSDK 6.4.1, which I hope will resolve your issue.

Please feel free to test it and provide your feedback.

Best regards

Fabrice

 

 

Senior III
September 26, 2025

@Fabrice LOUBEYRE wrote:

I am concerned that the MCSDK firmware supports only motors with a phase shift value equal to (modulo 60) + [0..30] degrees.

 

Could you please confirm if it is only for 6 step communication or FOC as well? For one of my motor the phase shift value is 300.