void updateIqRef(CTRL_Handle handle)
{
_iq iq_ref = _IQmpy(gMotorVars.IqRef_A,_IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A));
// set the speed reference so that the forced angle rotates in the correct direction for startup
if(_IQabs(gMotorVars.Speed_krpm) < _IQ(0.01))
{
if(iq_ref < _IQ(0.0))
{
CTRL_setSpd_ref_krpm(handle,_IQ(-0.01));
}
else if(iq_ref > _IQ(0.0))
{
CTRL_setSpd_ref_krpm(handle,_IQ(0.01));
}
}
// Set the Iq reference that use to come out of the PI speed control
CTRL_setIq_ref_pu(handle, iq_ref);
return;
} // end of updateIqRef() function