SPRUHJ1I January 2013 – October 2021 TMS320F2802-Q1 , TMS320F28026-Q1 , TMS320F28026F , TMS320F28027-Q1 , TMS320F28027F , TMS320F28027F-Q1 , TMS320F28052-Q1 , TMS320F28052F , TMS320F28052F-Q1 , TMS320F28052M , TMS320F28052M-Q1 , TMS320F28054-Q1 , TMS320F28054F , TMS320F28054F-Q1 , TMS320F28054M , TMS320F28054M-Q1 , TMS320F2806-Q1 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1
extern void EST_setLs_qFmt(EST_Handle handle,const uint_least8_t Ls_qFmt);
Sets the stator inductance Q format in the estimator in 8 bit unsigned integer (uint_least8_t)
Updating the internal inductance also requires to update the Q format variable, which is used to extend the covered range. This qFmt (Q Format) variable creates a floating point using fixed point math. It is important to notice that the inductance Q Format set by calling EST_setLs_qFmt() will be used by both per unit inductance calculations Ls_d and Ls_q. An example showing how this Q Format is set is shown below:
#define USER_MOTOR_Ls_d (0.012)
#define USER_MOTOR_Ls_q (0.027)
float_t fullScaleInductance = EST_getFullScaleInductance(handle);
float_t Ls_coarse_max = _IQ30toF(EST_getLs_coarse_max_pu(handle));
int_least8_t lShift = ceil(log(USER_MOTOR_Ls_d/(Ls_coarse_max*fullScaleInductance))/log(2.0));
uint_least8_t Ls_qFmt = 30 - lShift;
float_t L_max = fullScaleInductance * pow(2.0,lShift);
MATH_vec2 Ls_dq_pu;
Ls_dq_pu.value[0] = _IQ30(USER_MOTOR_Ls_d / L_max);
Ls_dq_pu.value[1] = _IQ30(USER_MOTOR_Ls_q / L_max);
EST_setLs_dq_pu(handle, &Ls_dq_pu);
EST_setLs_qFmt(handle, Ls_qFmt);
The estimator (EST) handle
The stator inductance Q format