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 中完成。该组件需要在适当的抽取率下调用此函数。抽取率由 ISR_TICKS_PER_SPINTAC_TICK 确定;有关详细信息,请参阅Topic Link Label5.8.1.4。在调用 SpinTAC 速度控制函数之前,必须更新速度参考、加速度参考和速度反馈。本示例使用 SpinTAC 速度移动为 SpinTAC 速度控制提供参考。有关 SpinTAC 速度移动的详细信息,请参阅Chapter14。
CTRL_Obj *obj = (CTRL_Obj *)ctrlHandle; // Get pointer to CTRL object
// Get the mechanical speed in pu/s
_iq speedFeedback = EST_getFm_pu(obj->estHandle); // Get the mechanical speed in pu/s
// Update the Velocity Reference
STVELCTL_setVelocityReference(stVelCtlHandle,
STVELMOVE_getVelocityReference(stVelMoveHandle));
//Update the Acceleration Reference
STVELCTL_setAccelerationReference(stVelCtlHandle,
STVELMOVE_getAccelerationReference(stVelMoveHandle));
//Update the Velocity Feedback
STVELCTL_setVelocityFeedback(stVelCtlHandle, speedFeedback);
// Run the SpinTAC Speed Controller
STVELCTL_run(stVelCtlHandle);
// Get the Torque Reference from the SpinTAC Speed Controller
iqReference = STVELCTL_getTorqueReference(stVelCtlHandle);
// Set the Iq reference that came out of SpinTAC Velocity Control
CTRL_setIq_ref_pu(ctrlHandle, iqReference);