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.

CCS/TMS320F28027F: Can I get the source code for the CTRL_setUserMotorParams() fucntion

Part Number: TMS320F28027F
Other Parts Discussed in Thread: MOTORWARE

Tool/software: Code Composer Studio

I am working to save and read the motor parameters in flash memory.
If only the Flag_enableUserParams flag is set to "true", it always calls CTRL_setUserMotorParams, which is why the motor rotation is not smooth.

So I'm trying to analyze the source, can I get it?

  • All open-source codes have been included in motorWare.  Exceed those codes, unfortunately, we can't provide the source code. 

    That's right, you must call both CTRL_setParams() and CTRL_setUserMotorParams() to update the parameters for FAST estimator if you changed any motor parameters.

     

  • The comments in the source code say that the motor parameters in user.h are used.

    ctrl.c

                  if(flag_enableUserMotorParams)
                    {
                      // initialize the motor parameters using values from the user.h file
                      CTRL_setUserMotorParams(handle);
                    }


    But I don't use these but I want to do motor parameter identification and then save them in flash and then refer to them.
    As the comment says, I can't use that method.

    Anyway,

    Does it mean to call in the if conditional statement in ctrl.c like below?

    ctrl.c

                  if(flag_enableUserMotorParams)
                    {
                      // initialize the motor parameters using values from the user.h file

                      CTRL_setParams(handle, ????);
                      CTRL_setUserMotorParams(handle);
                    }

     If so, doesn't CTRL_setUserMotorParams (handle) apply the motor-related macros in user.h?

  • You just need to change the motor parameters variables in gUserParams struct and call the following functions if you don't change the hardware board parameters.

    CTRL_setFlag_enableUserMotorParams(handle, true);

    CTRL_setParams(ctrlHandle,&gUserParams);