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.

TMS320F280037: Startup Issues w/ FAST Estimator

Part Number: TMS320F280037

Hi TI experts,

I am experiencing some startup issues with a surface PMSM while using the FAST Estimator. I have a few questions about FAST that will hopefully help me resolve these issues. Here is my understanding of how it works. My project is based on the universal_motor_control_lab within the MotorControlSDK.

Here are the two variables that control the forceAngle.

objUser->forceAngleFreq_Hz

objUser->forceAngleAccel_Hzps

Here's the state flow of the code during startup. First, align the rotor at the align current on the d axis:

    else if(obj->motorState == MOTOR_ALIGNMENT)
    {
        obj->angleFOC_rad = 0.0f;
        obj->enableSpeedCtrl = false;

        obj->IsRef_A = 0.0f;
        obj->Idq_out_A.value[0] = obj->alignCurrent_A;
        obj->Idq_out_A.value[1] = 0.0f;

        TRAJ_setIntValue(obj->trajHandle_spd, 0.0f);

        if((obj->stateRunTimeCnt > obj->alignTimeDelay) ||
                 (obj->flagEnableAlignment == false))
        {
            obj->stateRunTimeCnt = 0;
            obj->motorState = MOTOR_OL_START;
            obj->Idq_out_A.value[0] = obj->fluxCurrent_A;

            EST_setAngle_rad(obj->estHandle, obj->angleFOC_rad);
            PI_setUi(obj->piHandle_spd, obj->alignCurrent_A);
        }

After the alignTimeDelay has transpired. Set the d axis to the fluxCurrent, and seed the speed controller with the aligncurrent. Looks like the align current is getting transferred over to the Q axis here.

Then it moves to MOTOR_OL_START where the FOC angle grabs the angle put out by the estimator. I'm guess this is the forceAngle at this point since the rotor was just aligned and is not spinning yet.

    else if(obj->motorState == MOTOR_OL_START)
    {
        obj->angleFOC_rad = obj->angleEST_rad;
        obj->motorState = MOTOR_CL_RUNNING;
    }

Now, in MOTOR_CL_RUNNING, we sit in this condition until the startupTimeDelay has passed, at which point the D axis current is set to zero and we move to MOTOR_CTRL_RUN, which is normal FOC operation. At this point the motor should have started successfully, and the FOC loops are working as expected.

                if(obj->motorState == MOTOR_CL_RUNNING)
                {
                    obj->stateRunTimeCnt++;

                    if(obj->stateRunTimeCnt == obj->startupTimeDelay)
                    {
                        obj->Idq_out_A.value[0] = 0.0f;
                        obj->motorState = MOTOR_CTRL_RUN;
                    }
                }
  1. How does the FAST Estimator use the forceAngleFreq_Hz and forceAngleAccel_Hzps variables? I'm assuming it generates an angle starting at a frequency of forceAngleFreq_Hz and it accelerates at a speed of forceAngleAccel_Hzps?
  2. How does the estimator know when to switch over from the forced angle to the estimated angle? Is there some type of error threshold that must be achieved? Is there a flag in the estimator that indicates when the switch over has occured? I haven't been able to find such a flag.
  3. At what point in this startup routine can I expect / is it desired for the estimator to switch over from ForceAngle to normal operation angle estimation? Do I need to define my own conditions and then shut off ForceAngle?

 

Regards,

Ryan

  • Hi Ryan,

    ForceAngle is an electrical angle generator used to get you out of zero or say very low speed where FAST may not yet provide a stable angle. You can enable/disable if you want to switch your own open loop start up by set/clearing this flag "flagEnableForceAngle". When ForceAngle is enabled, the angle generator produces an electrical angle that starts at an electrical frequency based on objUser->forceAngleFreq_Hz, and ramps that electrical frequency with objUser->forceAngleAccel_Hzps, then integrates to create the forced angle used by Park/iPark.

    The "forceAngleFreq_Hz" is initialized by "USER_M1_FORCE_ANGLE_FREQ_Hz". This value is used during motor startup. Typical force angle startup speed is +-1 Hz.

    If you don't see the motor spinning after alignments, you may have to increase it by "#define USER_MOTOR1_ALIGN_CURRENT_A (1.5f) // A" in "user_mtr1.h" file. this is supposed to push motor to zero reference.

    Best Regards,

    Masoud

  • Hi Masoud, thanks for your reply. What conditions cause the estimator to switch over from ForceAngle to the estimated angle? Is there any flag that indicates to the user that the transition has occurred? My issue may be at this transition. I can get the shaft to start spinning, but then it occasionally loses synchronization and stalls. This happens about once every 500 startups. 

  • Ryan,

    Force angle is only used during startup when the running frequency is lower than 1Hz (default value). After that it will use estimator angle. You can change the setting value in "user" header file.

    //! \brief Defines the forced angle frequency, Hz
    #define USER_M1_FORCE_ANGLE_FREQ_Hz (1.0f)

    Best Regards,

    Masoud

  • Hi Masoud, that doesn't answer my question. You say force angle is only used during startup when the running frequency is less than USER_M1_FORCE_ANGLE_FREQ_Hz. If that's the case, what is the point of even having forceAngleAccel_Hzps? According to your answer above, it will change from forceAngle to estimator angle immediately. Please help me understand. The key question I'd like to understand is what criteria needs to be met for the estimator to switch from force angle to the estimator angle. Thanks.

  • Ryan,

    ForceAngle does not “switch immediately” just because USER_M1_FORCE_ANGLE_FREQ_Hz = 1Hz exists, and that’s exactly why forceAngleAccel_Hzps matters.

    If electrical frequency is lower than objUser->forceAngleFreq_Hz, then it'll ramp at objUser->forceAngleAccel_Hzps acceleration rate (1 second).

    There is not dedicated switchover happened flag exposed to the user.

    To solve the stall you may try reduce forceAngleAccel_Hzps or increase USER_M1_FORCE_ANGLE_FREQ_Hz a bit if you see the stall during handover from ForceAngle to FAST.

    Best Regards,

    Masoud