Hello:
Once the offset calibration is done, the final result will be stored in the driver object (HAL_Obj).Figure 6-9 shows the final results of calibrating the offsets for the DRV8312 Revision D board(a picture of adcBias I and V values)
Once the offset calibration is done, the Main Run Forerver Loop in lab02a also called HAL_updateAdcBias() to modify "adcBias" by subtracting "offsetHandle_I" .
1. What is the relation between "adcBias" and "offsetHandle_I" ?
2. Is it mandatory to call HAL_updateAdcBias() once the offset calibration is done?
3. If HAL_updateAdcBias() is not called immediately(e.g., not called until EST_State_Rs), will there be a problem for calculation in the previous EST_State_RoverL state?
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); ... } ... } static inline void HAL_updateAdcBias(HAL_Handle handle) { ... for(cnt=0;cnt<HAL_getNumCurrentSensors(handle);cnt++) { bias = HAL_getBias(handle,HAL_SensorType_Current,cnt); bias -= OFFSET_getOffset(obj->offsetHandle_I[cnt]); HAL_setBias(handle,HAL_SensorType_Current,cnt,bias); } ... }
Thank you very much.