Greetings! I`ve noticed that the motor parameters are hard stuck to the code(as defines). Is there a simple way to change them to variables without reworking the entire user.c file?
Thanks!
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.
Greetings! I`ve noticed that the motor parameters are hard stuck to the code(as defines). Is there a simple way to change them to variables without reworking the entire user.c file?
Thanks!
Yes. You don't need to change the variables in "gUserParams" object and call the functions to update the motor parameters for the InstaSPIN FAST estimators as below.
gUserParams.motor_numPolePairs = New_motor_numPolePairs;
gUserParams.motor_Rs = New_motor_Rs; // USER_MOTOR_Rs;
gUserParams.motor_Ls_d = New_motor_Ls_d; // USER_MOTOR_Ls_d;
gUserParams.motor_Ls_q = New_motor_Ls_q; // USER_MOTOR_Ls_q;
gUserParams.motor_ratedFlux = New_motor_ratedFlux; // USER_MOTOR_RATED_FLUX;
// Update the controller parameters
CTRL_setParams(ctrlHandle, &gUserParams);
CTRL_setUserMotorParams(ctrlHandle);