Hi,
Can anyone help to explain why MOTOR_ALIGNMENT section called once only ?
If enable the onboard POT and use it to change speedRef_Hz as throttle, when system start :
1. set flagEnableRunAndIdentify to 1
2. motorState changed to MOTOR_ALIGNMENT and run motor alignment codes
3. motorState changed to MOTOR_CL_RUNNING
4. motor spin
5. throttle up, speedRef_Hz increase, speed_Hz increase
6. throttle release, speedRef_Hz set to 0, speed_Hz down to zero as well
7. motorState still remain on MOTOR_CL_RUNNING, that's mean motor alignment didn't call even motor at station position
for high load application such as for e-bike I think both current can help right ?
obj->Idq_out_A.value[0] = obj->alignCurrent_A
obj->Idq_out_A.value[0] = obj->fluxCurrent_A;
estimatorMode = ESTIMATOR_MODE_FAST
elseif(obj->motorState == MOTOR_ALIGNMENT)
{
obj->angleFOC_rad = 0.0f;
obj->enableSpeedCtrl = false;
obj->stateRunTimeCnt++;
obj->IsRef_A = 0.0f;
obj->Idq_out_A.value[0] = obj->alignCurrent_A;
obj->Idq_out_A.value[1] = 0.0f;
TRAJ_setIntValue(obj->trajHandle_spd, 0.0f);
EST_setAngle_rad(obj->estHandle, obj->angleFOC_rad);
HALL_setForceAngleAndIndex(obj->hallHandle, obj->speedRef_Hz);
if((obj->stateRunTimeCnt> obj->alignTimeDelay) || (obj->flagEnableAlignment == false))
{
obj->stateRunTimeCnt = 0;
obj->motorState = MOTOR_OL_START;
obj->Idq_out_A.value[0] = obj->fluxCurrent_A;
PI_setUi(obj->piHandle_spd, 0.0f);
}
}
thanks,
tiger







