cancel
Showing results for 
Search instead for 
Did you mean: 

Clarification on the Hall Interrupt

STuser2
Senior II

STuser2_0-1757419669568.pngSTuser2_1-1757419688398.png

I always observe a spike when i start to run the motor which leads to audible noise or jerk when i went through the code to modify i have observed the variable hAux little confusing request to please confirm if it is intended 

__weak void *HALL_TIMx_CC_IRQHandler(void *pHandleVoid)
{
 if (pHandle->OVFCounter != 0U)
      {
        /* Adjust the capture using prescaler */
        uint16_t hAux;
        hAux = hPrscBuf + 1U;
        wCaptBuf *= hAux;

again declared
        if (pHandle->RatioDec) /* and don't decrease it again */
        {
          /* Adjust the capture using prescaler */
          uint16_t hAux;
          hAux = hPrscBuf + 2U;
          wCaptBuf *= hAux;

again declared

  else  /* If prescaler was not modified on previous capture */
        {
          /* Adjust the capture using prescaler */
          uint16_t hAux = hPrscBuf + 1U;
          wCaptBuf *= hAux;

 

 

6 REPLIES 6
STuser2
Senior II

There is always in dip in speed then adjusts itself when i start the motor 

STuser2_0-1757576949778.png

STuser2_1-1757576977481.pngspeed dip

STuser2_2-1757577649033.pngSTuser2_3-1757577666951.png

I am really not sure of the impact of this but i confirmed that it is happening due to the below transition of the code from if to else in the file hall_speed_pos_fdbk.c

if ((pHandle->BufferFilled < pHandle->SpeedBufferSize) && (wCaptBuf != 0U))
          {
            uint32_t tempReg = (pHandle->PseudoFreqConv / wCaptBuf) * (uint32_t)pHandle->Direction;
            pHandle->AvrElSpeedDpp = (int16_t)tempReg;
          }
          else
          {
            /* Average speed allow to smooth the mechanical sensors misalignement */
            pHandle->AvrElSpeedDpp = (int16_t)((int32_t)pHandle->PseudoFreqConv /
                                               (pHandle->ElPeriodSum / (int32_t)pHandle- >SpeedBufferSize)); /* Average value */

          }

Could you please confirm if that is the root cause or not, if yes request to please provide me the solution? I need to close these issues and thank you for support.

 

 

Gael A
ST Employee

Hello STuser2,

Could you please tell me which version of the MCSDK you are using for this application ?

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.

MCSDK 6.4.1

I am using MCSDK 6.4.1

Hello STuser2,

Thank you for your answer.

Before anything else, can you confirm that you profiled the Hall sensors using our Profiler tool, and that the offset is correctly computed ?

I will try to reproduce the behaviour on my side and hopefully come back to you with a definite answer.

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.
STuser2
Senior II

Hello @Gael A 

Thank you for the reply, i have not profiled the hall sensors but i have run the profiler software and compared the angles as below

STuser2_0-1758188830112.png

This is done as part of the other issue which is still in progress and not resolved (both are same setup)

Motor Jerks at start and multiple Speed Feedback f... - STMicroelectronics Community

I have followed the method documented in MCSDK to find the placement angle. Please let me know if any actions need to be done from my side.