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 int32_t EST_getFullScaleResistance(EST_Handle handle);
Gets the full scale resistance value used in the estimator in Ohms There are different ways of getting the resistance used by the estimator. This function helps when converting resistance from per units to Ohms. However, the returned value is in floating point format, so utilizing this full scale value to convert per units to Ohms is not the most efficient way. Two examples are provided below, showing a floating point per units to Ohms conversion, and a fixed point per units to Ohms conversion for faster execution. Floating point example:
uint_least8_t Rs_qFmt = EST_getRs_qFmt(handle);
float_t fullScaleResistance = EST_getFullScaleResistance(handle);
float_t Rs_pu = _IQ30toF(EST_getRs_pu(handle));
float_t pu_to_ohms_sf = fullScaleResistance * pow(2.0, 30 - Rs_qFmt);
float_t Rs_Ohms = Rs_pu * pu_to_ohms_sf;
Another example is to avoid using floating point math for faster execution. In this example the full scale resistance value is calculated using pre-compiler math based on user's parameters in user.h:
#define VarShift(var,nshift) (((nshift) < 0) ? ((var)>>(-(nshift))) : ((var)<<(nshift)))
#define USER_IQ_FULL_SCALE_VOLTAGE_V (300.0)
#define USER_IQ_FULL_SCALE_CURRENT_A (10.0)
uint_least8_t Rs_qFmt = EST_getRs_qFmt(handle);
_iq fullScaleResistance = _IQ(USER_IQ_FULL_SCALE_VOLTAGE_V/USER_IQ_FULL_SCALE_CURRENT_A);
_iq Rs_pu = _IQ30toIQ(EST_getRs_pu(handle));
_iq pu_to_ohms_sf = VarShift(fullScaleResistance, 30 - Rs_qFmt);
_iq Rs_Ohms = _IQmpy(Rs_pu, pu_to_ohms_sf);
The estimator (EST) handle
The full scale resistance value, Ohm