在main主循环中:
HAL_disablePwm(halHandle);
// set the default controller parameters (Reset the control to re-identify the motor)
CTRL_setParams(ctrlHandle,&gUserParams);
gMotorVars.Flag_Run_Identify = false;
应该说是不可能执行到的,为什么还要写在这里?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在main主循环中:
HAL_disablePwm(halHandle);
// set the default controller parameters (Reset the control to re-identify the motor)
CTRL_setParams(ctrlHandle,&gUserParams);
gMotorVars.Flag_Run_Identify = false;
应该说是不可能执行到的,为什么还要写在这里?
Jesse
for循环开始的时候是有这个while,当这个变量没有置1的时候,会一直等待在这里。只有置1的时候,状态机方面才会开始执行。当这个变量置1后,就会进入下面另外一个while循环。while(gMotorVars.Flag_enableSys)
// Waiting for enable system flag to be set
while(!(gMotorVars.Flag_enableSys));
Flag_Latch_softwareUpdate = true;
// Dis-able the Library internal PI. Iq has no reference now
CTRL_setFlag_enableSpeedCtrl(ctrlHandle, true);
// loop while the enable system flag is true
while(gMotorVars.Flag_enableSys)
while(!(gMotorVars.Flag_enableSys));————————(1)
while(gMotorVars.Flag_enableSys)————————(2)
{
……
}
HAL_disablePwm(halHandle);——————(3)
CTRL_setParams(ctrlHandle,&gUserParams);
gMotorVars.Flag_Run_Identify = false;
gMotorVars.Flag_enableSys=0时,一直等待在(1)行;
gMotorVars.Flag_enableSys=1时,那么执行(2)行中的状态机
(3)就没有执行啊?