cancel
Showing results for 
Search instead for 
Did you mean: 

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

jovijuan
Associate III

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.

 

0 REPLIES 0