Some ACI motors can't have their shaft locked for proper Motor ID.
Here is a solution, though it requires more effort / tuning.
Start Running lab 2b Motor ID like normal: calculate the offsets, R over L, Rs, rated magnetizing current and finally rated flux.
Once the state changes to lock rotor (gMotorVars.EstState == EST_State_LockRotor), you can just halt CPU execution and update user.h with the following parameters:
#define USER_MOTOR_Rr: gMotorVars.Rs_Ohm
#define USER_MOTOR_Rs: gMotorVars.Rs_Ohm
#define USER_MOTOR_Ls_d: controller_obj->Lhf (for 06x) or ctrl.Lhf (for 02x)
#define USER_MOTOR_Ls_q: (USER_MOTOR_Ls_d)
#define USER_MOTOR_RATED_FLUX: This should have already been populated with the rated flux of the motor, ex: 220 VAC and 60 Hz (0.8165*220.0/60.0)
#define USER_MOTOR_MAGNETIZING_CURRENT: gMotorVars.MagnCurr_A
Up until now, it is assumed that Rr = Rs, which is not true, but it is a starting point.
What you need to do next, is to
- run the motor at some speed, say 20% of rated speed. For example, use proj_lab5b
- load the motor
- Measure the speed with a sensor
-
- Ex: with an RPM meter
- or if you have a speed sensor already mounted, etc.
- Compare that against gMotorVars.Speed_krpm.
- Adjust Rr (lower) until both speeds (from tachometer and gMotorVars.Speed_krpm) match.
For this you need to set the Rr value in pu. You can call this function in the updateGlobalVariables_motor() function.
EST_setRr_pu(obj->estHandle, Rr_pu + RrDelta_pu);
But first you need to create the variable:
volatile _iq RrDelta = _IQ30(0.0); // Delta to adjust the internal Rr, note that it is an IQ30 value. Start with _IQ30(0.0) and lower the delta, _IQ30(-0.05), _IQ30(-0.1), _IQ30(-0.15), etc.
and you will need to initialize the starting Rr_pu. This needs to be done once AFTER you load the gUserParams and the motor is running, but not in a continous background loop like in updateGlobalVariables_motor().
Ex, to initialize this logic and interface to the RrDelta tuning you can create the following state in the for loop:
If(flag_tune_Rr == false)
{
Rr_pu = EST_getRr_pu(obj->estHandle);
RrDelta_pu = _IQ30(0.0);
}
Else
{
EST_setRr_pu(obj->estHandle, Rr_pu + RrDelta_pu);
}
And the procedure would be, run motor with flag_tune_Rr = false. Then set the flag to true and start tuning RrDelta_pu in the watch window.
Once both speeds match, record the value in user.h USER_MOTOR:
#define USER_MOTOR_Rr: Use EST_getRr_Ohm(obj->estHandle);