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_getMaxAccel_est_pu(EST_Handle handle);
Gets the maximum estimation acceleration value used in the estimator in per unit (pu), IQ24
The maximum acceleration is a setting of the trajectory module, which sets the speed reference. The acceleration returned by this function call is used during the motor identification process. This value represents how the speed reference is increased or decreased from an initial value to a target value. The following example shows how convert the returned value of this function to kilo Hertz per Second (kHz/s) and kilo RPM per second (kRPM/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_FREQ_Hz (500.0)
#define USER_MOTOR_NUM_POLE_PAIRS (4)
_iq pu_to_khzps_sf = _IQ((float_t)USER_TRAJ_FREQ_Hz * USER_IQ_FULL_SCALE_FREQ_Hz / 1000.0);
_iq khzps_to_krpmps_sf = _IQ(60.0 / (float_t)USER_MOTOR_NUM_POLE_PAIRS);
_iq est_Accel_pu = EST_getMaxAccel_est_pu(handle);
_iq est_Accel_kilo_hz_per_sec = _IQmpy(est_Accel_pu, pu_to_khzps_sf);
_iq est_Accel_kilo_rpm_per_sec = _IQmpy(est_Accel_kilo_hz_per_sec, khzps_to_krpmps_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_FREQ_Hz (500.0)
#define USER_MAX_ACCEL_EST_Hzps (2.0)
_iq hzps_to_pu_sf = _IQ(1.0 / ((float_t)USER_TRAJ_FREQ_Hz * USER_IQ_FULL_SCALE_FREQ_Hz));
_iq est_Accel_hertz_per_sec = _IQ(USER_MAX_ACCEL_EST_Hzps);
_iq est_Accel_pu = _IQmpy(est_Accel_hertz_per_sec, hzps_to_pu_sf);
The estimator (EST) handle
The maximum estimation acceleration value, pu