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.

FAST Estimator state conversion

After call CTRL_setParams(), CTRL_setUserMotorParams() and CTRL_setupEstIdleState() function, the estimator state can change from EST_State_Idle to EST_State_OnLine. But then if CTRL_setParams() and CTRL_setupEstIdleState() function are called again, the estimator state will change from EST_State_Idle to EST_State_RoverL. Why ?

Through debugging, the function CTRL_setUserMotorParams( ) should be called again to solve this problem. But I do not know why it is.

  • are you trying to modify the state based logic in a particular lab?
  • I just use FAST to control my motor without motor identification based on lab 11/11a, motor can work well, but once system disabled, then try to start up motor again, the estimator state will run into motor identification process, but I do not hope so, I want the estimator runs into online state when restart motor after system re-enabled.
  • Please call below function to enable the use of motor parameters being loaded from user.h, which disable the identification process.
    CTRL_setFlag_enableUserMotorParams(ctrlHandle, true);
  • But I do not use the CTRL module, like lab 11, so CTRL_setFlag_enableUserMotorParams(ctrlHandle, true) function has no influence on the estimator state.
  • Ok, did you call below lines code to initialize the estimator using the parameters in user.h without identification when you reset your system.
    CTRL_setParams(ctrlHandle,&gUserParams);
    CTRL_setUserMotorParams(ctrlHandle);
    CTRL_setupEstIdleState(ctrlHandle);
  • The three functions you mentioned are called at the beginning of codes. Why these functions should be called again after system reset?
  • Don't need call these functions again if you only stop motor by run flag. Don't know what's your system reset.  Please refer to lab11/11a, or add yourself code based on both projects.

  • Hi,

    so if I call these functions in the beginning of my program but want to start the identification later, how should I tell the estimator to "forget" the parameters it already has?

  • Embed below line codes in the beginning of your program if you were working on the project which refers to lab10a or previous .

    gMotorVars.Flag_enableUserParams = true; //false->enable the use of motor parameters
    //true->disable the use of motor parameters

    // enable/disable the use of motor parameters being loaded from user.h
    CTRL_setFlag_enableUserMotorParams(ctrlHandle,gMotorVars.Flag_enableUserParams);

    // set the default controller parameters
    CTRL_setParams(ctrlHandle,&gUserParams);
  • If flag_enableUserMotorParams is set then the motor parameters in ctrlhandle->motorParams are set in the Estimator and EST_isMotorIdentified() returns 1.
    This is what I do in the begining of my program, however I want to be able to re-identify the motor when requested by the user. I tried calling CTRL_setEstParams() and this seems to "reset" the estimator so that EST_isMotorIdentified() returns 0. Then if I enable the controller using CTRL_setFlag_enableCtrl() the identification process seems to start but it does not finish correctly. Rs and RampUp states seem to work correctly however as soon as the Estimator goes into EST_State_RampUp_OL the motor stops spinning and the flux value (which is correct up to this moment) increases and Ls is incorrectly identified.
  • Follow below steps for re-identification, and try again.
    gMotorVars.Flag_MotorIdentified= FALSE;
    gMotorVars.Flag_enableUserParams = FALSE;
    // initialize the user parameters
    USER_setParams(&gUserParams);
    // set the default controller parameters
    CTRL_setParams(ctrlHandle,&gUserParams);
    gMotorVars.Flag_MotorIdentified= TRUE;