ZHCU083I 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
该步骤应在主 ISR 中完成。该组件需要在适当的抽取率下调用此函数。抽取率由 ST_ISR_TICKS_PER_SPINTAC_TICK 确定;有关详细信息,请参见Topic Link Label5.8.1.4。在调用 SpinTAC 位置移动函数之前,必须更新目标速度、加速度限制、急动限制和曲线类型。
// If we are not running a profile, and the PosStep_MRev has been modified
if((STPOSMOVE_getStatus(stObj->posMoveHandle) == ST_MOVE_IDLE)
&& (gMotorVars.PosStepInt_MRev != 0 || gMotorVars.PosStepFrac_MRev != 0)) {
// Get the configuration for SpinTAC Position Move
STPOSMOVE_setCurveType(stObj->posMoveHandle, gMotorVars.SpinTAC.PosMoveCurveType);
STPOSMOVE_setPositionStep_mrev(stObj->posMoveHandle, gMotorVars.PosStepInt_MRev,
gMotorVars.PosStepFrac_MRev);
STPOSMOVE_setVelocityLimit(stObj->posMoveHandle,
_IQmpy(gMotorVars.MaxVel_krpm, _IQ24(ST_SPEED_PU_PER_KRPM)));
STPOSMOVE_setAccelerationLimit(stObj->posMoveHandle,
_IQmpy(gMotorVars.MaxAccel_krpmps, _IQ24(ST_SPEED_PU_PER_KRPM)));
STPOSMOVE_setDecelerationLimit(stObj->posMoveHandle,
_IQmpy(gMotorVars.MaxDecel_krpmps, _IQ24(ST_SPEED_PU_PER_KRPM)));
STPOSMOVE_setJerkLimit(stObj->posMoveHandle,
_IQ20mpy(gMotorVars.MaxJrk_krpmps2, _IQ20(ST_SPEED_PU_PER_KRPM)));
// Enable the SpinTAC Position Profile Generator
STPOSMOVE_setEnable(stObj->posMoveHandle, true);
// clear the position step command
gMotorVars.PosStepInt_MRev = 0;
gMotorVars.PosStepFrac_MRev = 0;
}
STPOSMOVE_run(stObj->posMoveHandle);