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 Identify. This step can be completed by running the functions ST_init and ST_setupVelId 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 Identify component. This configuration of SpinTAC Velocity Identify represents the typical configuration that should work for most motors.
// Initialize the SpinTAC Velocity Identify Component
stVelIdHandle = STVELID_init(&stVelId, sizeof(stVelId));
// Setup SpinTAC Velocity Identify Component
// Sample time [s]
STVELID_setSampleTime_sec(stVelIdHandle, _IQ(ST_SPEED_SAMPLE_TIME));
// System speed limit [pu/s], (0, 1]
STVELID_setVelocityMax(stVelIdHandle, _IQ(1.0));
// System maximum (0,1] & minimum [-1,0) control signal [PU]
STVELID_setOutputMaximums(stVelIdHandle, maxCurrent_PU, -maxCurrent_PU);
// Goal Speed of the inertia identification process [pu/s], (0, 1]
STVELID_setVelocityPositive(stVelIdHandle, _IQmpy(_IQ(0.4), _IQ(1.0)));
// System control signal high (0, OutMax] & low [OutMin, 0) limit [PU]
STVELID_setOutputLimits(stVelIdHandle, maxCurrent_PU, -maxCurrent_PU);
// Low pass filter constant to smooth the speed feedback signal [tick], [1, 100]
STVELID_setLowPassFilterTime_tick(stVelIdHandle, 1);
// Configure the time out for inertia identification process [s], [100*T, 10.0]
STVELID_setTimeOut_sec(stVelIdHandle, _IQ(10.0));// Rate at which torque is applied to the
motor [s], [T, 25.0]
STVELID_setTorqueRampTime_sec(stVelIdHandle, _IQ(5.0));
// Initially ST_VelId is not in reset
STVELID_setReset(stVelIdHandle, false);
// Initially ST_VelId is not enabled
STVELID_setEnable(stVelIdHandle, false);