Dear all,
I am using lab3a as reference in my custom board for my code.
I make a one function like below for interface my display board, so user can modify some motor parameter and also other parameter after initialization of void USER_setParams(USER_Params *pUserParams) function.
void USER_setParams_amt(USER_Params *pUserParams)
{
pUserParams->motor_numPolePairs = (float)act.mtr_poles * 0.5 ;//
pUserParams->motor_ratedFlux = (0.8165 * (float)x24.mtr_vlt)/((float)x24.mtr_frq*0.1);//
pUserParams->motor_Rs = foc.Rs;
pUserParams->motor_Rr = foc.Rr;
pUserParams->motor_Ls_d = foc.Ls_d;
pUserParams->motor_Ls_q = foc.Ls_d;
// assign the motor type
CTRL_setMotorParams(ctrlHandle,pUserParams->motor_type,
pUserParams->motor_numPolePairs,
pUserParams->motor_ratedFlux,
pUserParams->motor_Ls_d,
pUserParams->motor_Ls_q,
pUserParams->motor_Rr,
pUserParams->motor_Rs);
}
now I set pUserParams.motor_Ls_d and pUserParams.motor_Ls_d = 0.00651 value but when I debug the code I see in gUserParams.motor_Ls_d and gUserParams.motor_Ls_d = 0.00651 but in gMotorVars.Lsd_H and gMotorVars.Lsq_H = 0.01379426.
Why it is differ from user define value? Or still I miss any function to set after pUserParams modified parameters.