Skip to main content
Sune Jensen
Associate II
September 25, 2024
Solved

[Bug report] SPD_GetInstElSpeedDpp only works when using STO+PLL as speed sensing method

  • September 25, 2024
  • 2 replies
  • 1039 views

 

SPD_GetInstElSpeedDpp is implemented in speed_pos_fdbk.h

 

 

static inline int16_t SPD_GetInstElSpeedDpp(const SpeednPosFdbk_Handle_t *pHandle)
{
#ifdef NULL_PTR_CHECK_SPD_POS_FBK
 return ((MC_NULL == pHandle) ? 0 : pHandle->InstantaneousElSpeedDpp);
#else
 return (pHandle->InstantaneousElSpeedDpp);
#endif
}

 

 

The returned variable pHandle->InstantaneousElSpeedDpp is however only updated when using STO+PLL as speed sensing method (see sto_pll_speed_pos_fdbk.c). For any other method (sensored or sensorless) InstantaneousElSpeedDpp is never updated.

SPD_GetInstElSpeedDpp is used in mc_tasks_foc.c (mc_tasks.c before version 6.3.0) to do do reverse park angle compensation. This means that REV_PARK_ANGLE_COMPENSATION_FACTOR does not work as expected for any other speed sensing method than STO+PLL.

 

 

hElAngle += SPD_GetInstElSpeedDpp(speedHandle)*REV_PARK_ANGLE_COMPENSATION_FACTOR;

 

 

As far as I can figure out, SPD_GetInstElSpeedDpp should actually return pHandle->hElSpeedDpp when using any other method than STO+PLL (or rather the different speed sensing methods ought to be refactored to use the variables in a consistent manner).

Best answer by GMA

Hello @Sune Jensen,

Thank you for your problem report. You are fully right; a ticket has been entered on our side and notification will be done once corrected in further delivery.

2 replies

GMA
GMABest answer
Technical Moderator
October 4, 2024

Hello @Sune Jensen,

Thank you for your problem report. You are fully right; a ticket has been entered on our side and notification will be done once corrected in further delivery.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
ST Employee
May 20, 2025

Hello @Sune Jensen ,

This issue has been fixed with the solution proposed above in our new MCSDK 6.4.0 release,
so feel free to download it and try if it solved correctly your issue reported in this post.

Kind Regards.