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 _iq EST_getMaxCurrentSlope_pu(EST_Handle handle);
Gets the maximum current slope value used in the estimator in per unit (pu), IQ24
Gets the slope of Id reference. The following example shows how to convert the returned value into kilo Amperes per second (kA/s):
#define USER_NUM_ISR_TICKS_PER_CTRL_TICK (1)
#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (10)
#define USER_PWM_FREQ_kHz (15.0)
#define USER_ISR_FREQ_Hz (USER_PWM_FREQ_kHz * 1000.0)
#define USER_CTRL_FREQ_Hz (uint_least32_t)(USER_ISR_FREQ_Hz/USER_NUM_ISR_TICKS_PER_CTRL_TICK)
#define USER_TRAJ_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_TRAJ_TICK)
#define USER_IQ_FULL_SCALE_CURRENT_A (10.0)
_iq pu_to_kA_per_sec_sf = _IQ((float_t)USER_TRAJ_FREQ_Hz * USER_IQ_FULL_SCALE_CURRENT_A / 1000.0);
_iq currentSlope_pu = EST_getMaxCurrentSlope_pu(handle);
_iq currentSlope_kAps = _IQmpy(currentSlope_pu, pu_to_kA_per_sec_sf);
The default value is set by a user's defined value in user.h, and the default value in per units is calculated internally as follows:
#define USER_NUM_ISR_TICKS_PER_CTRL_TICK (1)
#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (10)
#define USER_PWM_FREQ_kHz (15.0)
#define USER_ISR_FREQ_Hz (USER_PWM_FREQ_kHz * 1000.0)
#define USER_CTRL_FREQ_Hz (uint_least32_t)(USER_ISR_FREQ_Hz/USER_NUM_ISR_TICKS_PER_CTRL_TICK)
#define USER_TRAJ_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_TRAJ_TICK)
#define USER_IQ_FULL_SCALE_CURRENT_A (10.0)
#define USER_MOTOR_RES_EST_CURRENT (1.0)
_iq A_per_sec_to_pu_sf = _IQ(1.0 / ((float_t)USER_TRAJ_FREQ_Hz * USER_IQ_FULL_SCALE_CURRENT_A));
_iq currentSlope_Aps = _IQ(USER_MOTOR_RES_EST_CURRENT);
_iq currentSlope_pu = _IQmpy(currentSlope_Aps, A_per_sec_to_pu_sf);
The estimator (EST) handle
The maximum current slope value, pu