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 function of the project ahead of the forever loop. This will load all of the default values into SpinTAC Velocity Move. This step can be completed by running the functions ST_init and ST_setupVelMove that are declared in the spintac_velocity.h header file. If you do not wish to use these two functions, the code example below can be used to configure the SpinTAC Velocity Move component. This configuration of SpinTAC Velocity Move represents the typical configuration that should work for most motors.
// Initialize the SpinTAC Velocity Move Component
stVelMoveHandle = STVELMOVE_init(&stVelMove, sizeof(ST_VelMove_t));
// Instance of SpinTAC Velocity Move
STVELMOVE_setAxis(stVelMoveHandle, ST_AXIS0);
// Sample time [s], (0, 1]
STVELMOVE_setSampleTime_sec(stVelMoveHandle, _IQ24(ST_SAMPLE_TIME));
// System maximum limit for:
// speed [pu/s] [IQ24(0.001), _IQ24(1)],
// acceleration [pu/s^2] [IQ24(0.002), _IQ24(120)],
// jerk references [pu/s^3] [_IQ20(0.0005), IQ20(2000)]
STVELMOVE_setProfileMaximums(stVelMoveHandle, _IQ24(1.0), _IQ24(10.0), _IQ20(62.5));
// Acceleration limit for the profile [pu/s^2] [IQ24(0.001), _IQ24(120)]
STVELMOVE_setAccelerationLimit(stVelMoveHandle, _IQ24(0.4));
// Jerk limit for the profile [pu/s^3] [_IQ20(0.0005), _IQ20(2000)]
STVELMOVE_setJerkLimit(stVelMoveHandle, _IQ20(1.0));
// Set profile curve type { ST_MOVE_CUR_TRAP, ST_MOVE_CUR_SCRV, ST_MOVE_CUR_STCRV }
STVELMOVE_setCurveType(stVelMoveHandle, ST_MOVE_CUR_STCRV);
// ST_VelMove is not in test mode
STVELMOVE_setTest(stVelMoveHandle, FALSE);
// Initially ST_VelMove is not enabled
STVELMOVE_setEnable(stVelMoveHandle, FALSE);
// Initially ST_VelMove is not in reset
STVELMOVE_setReset(stVelMoveHandle, FALSE);