cancel
Showing results for 
Search instead for 
Did you mean: 

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

Sune Jensen
Associate II

 

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).

0 REPLIES 0