cancel
Showing results for 
Search instead for 
Did you mean: 

Hall sensor not working on 6.4

jovijuan
Associate III

I have a custom board (G491) with a 1-shunt driver and Hall sensors I have been using with MCSDK 6.3.2 with no issue.
When I saw the Release Notes of 6.4.0 I decided to give it a try, I wanted to try out the current monitoring.

The workspace project was created from scratch with the same configuration as it worked on 6.3.2 (6-step, hall sensor as speed sensor), but, when I tried to start the motor, it didn't start. When I manually moved the shaft, speed control got crazy and started spinning at max speed.

In idle, I realized that the UI reports 30 rpm when not in movement. I can move the motor forward and it reports some speed but, if I turn it backwards, speed is reported as 30 rpm. HALL_EL_ANGLE register is stuck at 0, when it should change.

I went back to a nucleo-G431 with a IHM08M1 and a different motor, and the behavior is exactly the same.

It looks like the logic for the Hall sensor is broken.

Has anybody experienced anything like that?

 

3 REPLIES 3
JGrap.1
Associate II

Hi,

Same issue with me. Tested with NUCLEO-G431+IHM16M1+ PMSM with HALL.

Work perfectly with X-CUBE-MCSDK v6.3.2 but not working with the latest version.

Can't control the speed through GUI. When start, motor spin at full speed.

Hi All, one of the changes made into the new MCSDK WB 6.4.0, is the ability to choose the timer number used to catch the HALL inputs
By default, the timer selected is the Timer 2, that could be different of the one used into MCSDK WB 6.3.2.
Naturally, another timer choice will generate different PINs for the H1, H2 and H3 signals, and in consequence a problem of connection if boards have been modified in desoldering access to the unused HALL signal connections for example.

 

MCSDK WB 6.4.0 HALL timer setection

FabriceLOUBEYRE_0-1749141195027.png

 

i.e IHM16M1 HALL possible connections

FabriceLOUBEYRE_1-1749141442947.png

Best regards.

Fabrice

 

jovijuan
Associate III

I checked and that's not the issue for me. In either my custom board or IHM08M1 the Hall inputs can only be connected to a timer so there is no choice.
In fact, I compared TIM3 initialization code (in my custom board Hall sensors are connected to TIM3) from the previous working project v6.3.2 and the new using v6.4.0 and there is no difference.

There is a minor difference in TIM3 initialization inside HALL_Init(, this might be a bug in v6.4.0 but I doubt it has relevance, ICF1 filter seems wrong:

/* Set IC filter for Channel 1 (ICF1). */
LL_TIM_IC_SetFilter(TIMx, LL_TIM_CHANNEL_CH1, (uint32_t)(pHandle->ICx_Filter) << 20U);

vs the old code in v6.3.2:

/* Set IC filter for Channel 1 (ICF1) */
LL_TIM_IC_SetFilter(TIMx, LL_TIM_CHANNEL_CH1, (uint32_t)(pHandle->ICx_Filter));

 

But mayor difference is the ISR management:

  1. No more TSK_HighFrequencyTask() from PWM timer. This was mentioned in Release notes. This high frequency task was in charge of rotor estimation to change hall step when HALL_OFFSET was not exactly in 60° steps. It looks like this functionality is now handled using CC2. To be confirmed
  2. Hall logic has changed, HALL_TIMx_CC_IRQHandler() is quite different. There is a significant change in HALL_Handle_t HALL_M1:
    1. HALL_Handle_t HALL_M1 containied .SensorPlacement = HALL_SENSORS_PLACEMENT and .PhaseShift = (int16_t)(HALL_PHASE_SHIFT * 65536 / 360)
    2. In v6.4.0, .SensorPlacement is the same, but now we have .PhaseShift = PHASE_SHIFT_DEG and .StepShift = STEP_SHIFT
      HALL_SENSORS_PLACEMENT (and former HALL_PHASE_SHIFT) are in pmsm_motor_parameters.h, but that phase shift is no more used.
      Instead, now we have HALL_PHASE_SHIFT and PHASE_SHIFT_DEG defined in drive_parameters.h
      This might be part of the problem, as HALL_PHASE_SHIFT is always 5 and PHASE_SHIFT_DEG is always 0 no matter what "
      Placement electrical angle" I define in the Workbench wizard. Maybe this is ok for a default 300 degrees angle? I'm just guessing.

What should be the values of HALL_PHASE_SHIFT and PHASE_SHIFT_DEG when Hall sensor placement electrical angle (measured as described in the documentation) is 108 or 120 degrees?