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 ISR_TICKS_PER_SPINTAC_TICK; for more information, see Section 5.7.1.4. Before calling the SpinTAC Velocity Control function the speed reference, acceleration reference and speed feedback must be updated. This example uses SpinTAC Velocity Move to provide the references to SpinTAC Velocity Control. For more information on SpinTAC Velocity Move, see Section 14.
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);