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
This should be done in the main ISR. This function needs to be called at the proper decimation rate for this component. The decimation rate is established by ST_ISR_TICKS_PER_SPINTAC_TICK; for more information, see Section 5.7.1.4. Before calling SpinTAC Velocity Move function the speed target, acceleration limit, jerk limit, and curve type need to be updated.
// If we are not in reset, and the SpeedRef_krpm has been modified
if((STVELMOVE_getReset(stVelMoveHandle) == FALSE)
&& (_IQmpy(gMotorVars.SpeedRef_krpm, _IQ24(ST_SPEED_PU_PER_KRPM))
!= STVELMOVE_getVelocityEnd(stVelMoveHandle)))
{
// Get the configuration for SpinTAC Velocity Move
STVELMOVE_setCurveType(stVelMoveHandle, gMotorVars.SpinTAC.VelMoveCurveType);
STVELMOVE_setVelocityEnd(stVelMoveHandle,
_IQmpy(gMotorVars.SpeedRef_krpm, _IQ24(ST_SPEED_PU_PER_KRPM)));
STVELMOVE_setAccelerationLimit(stVelMoveHandle,
_IQmpy(gMotorVars.MaxAccel_krpmps, _IQ24(ST_SPEED_PU_PER_KRPM)));
STVELMOVE_setJerkLimit(stVelMoveHandle,
_IQ20mpy(gMotorVars.MaxJrk_krpmps2, _IQ20(ST_SPEED_PU_PER_KRPM)));
// Enable SpinTAC Move
STVELMOVE_setEnable(stVelMoveHandle, TRUE);
//If starting from zero speed, enable ForceAngle, otherwise disable ForceAngle
if(_IQabs(STVELMOVE_getVelocityStart(stVelMoveHandle)) < _IQ24(ST_MIN_ID_SPEED_PU))
{
EST_setFlag_enableForceAngle(ctrlObj->estHandle, TRUE);
gMotorVars.Flag_enableForceAngle = TRUE;
}
else
{
EST_setFlag_enableForceAngle(ctrlObj->estHandle, FALSE);
gMotorVars.Flag_enableForceAngle = FALSE;
}
}
// Run SpinTAC Move
STVELMOVE_run(stVelMoveHandle);