2025-09-09 5:15 AM
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;
2025-09-11 1:03 AM - edited 2025-09-11 1:05 AM
There is always in dip in speed then adjusts itself when i start the motor
speed dip
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.
2025-09-12 5:32 AM
Hello STuser2,
Could you please tell me which version of the MCSDK you are using for this application ?
2025-09-12 5:53 AM
MCSDK 6.4.1
2025-09-12 5:55 AM
I am using MCSDK 6.4.1
2025-09-18 2:19 AM
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.
2025-09-18 2:51 AM
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
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.