Hello,this question is about the function GFLIB_ControllerPIpFAsm in the example application AN5014SW. In the description of function GFLIB_ControllerPIpFAsm, the parameters : i16PropGainShift and i16IntegGainShift are defined as positive number, but in the file PMSM_appconfig.h ,they are defined as negative number. Can you explain it for me? Thank you.

Hi,

Regarding your question, in general, proportional and integer shift parameter: i16IntegGainShift and i16PropGainShift should be positive,for example for proportional value, the actual proportional value is f16PropGain_Ksc =Ksc*2**(–i16PropGainShift), Ksc is proportioinal gain, i16PropGainShift is the proportional shift. From the formula, the i16PropGainShift parameter is used to increase the valid bits of the actual parameter if the i16PropGainShift is a positive. But If the i16PropGainShift is a negative, it can represent the value greater than 1. For example, the Ksc=0.5, it is represented as 0x4000, if you want to represent the value as 2, you can set the i16PropGainShift as 2, 0.5<<2=0.5*4=2

In conclusion, the shift can be positive and negative, in general, it is positive.

Hope it can help you.

BR

XiangJun Rong