Hello:
The following code is copied from lab02a during motor identification process in Main Run Forerver Loop. Why does it call HAL_updateAdcBias() here?
I know HAL_updateAdcBias() is used for Current Feedback Polarity, and ADC bias value is calculated in the controller offline state. After the bias calculation is completed, the state changes to CTRL_State_OnLine.
Why does it modify the ADC bias value at the beginning of CTRL_State_OnLine? Does it mean the bias value calculated in the previous offline state is not correct?
Thank you in advance.
if(flag_ctrlStateChanged)
{
.
.
.
else if(ctrlState == CTRL_State_OnLine)
{
if((estState < EST_State_LockRotor) || (estState > EST_State_MotorIdentified))
// update the ADC bias values
HAL_updateAdcBias(halHandle);
.
.
.
}
.
.
.
}