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
这应该在死循环之前的项目主函数中完成。这样会将所有的默认值加载到 SpinTAC 速度识别中。该步骤可通过运行已在 spintac_velocity.h 头文件中声明的函数 ST_init 和 ST_setupVelId 来完成。如果不希望使用这两个函数,可使用下方的代码示例配置 SpinTAC 速度识别组件。SpinTAC 速度识别配置是典型配置的代表,适用于大部分电机。
// 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);