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.

LAUNCHXL-F280049C: Forced angle SDK(FOC)

Guru 56308 points

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: BOOSTXL-DRV8320RS

It seem there may be incorrect interpretation lab 5 as to what change in (speed direction) means. It would seem FAST forced angle enable true, All states motor ID. Yet Rated Flux technically is considered a sudden speed reversal (decelerate) as are other tests in lab 5. Text SPRUHJ1H states FAST does not require forced angle enable after rotor is moving and magnetic Nth pole was found by slow speed observer. It can be observed motor current spikes suddenly during start of rated flux and other speed transitions leading to OC trip conditions of ePWM DC zone actions. 

1. Why has forced angle not been disabled prior to current ramp up as slow speed observer transitions into high speed FAST estimator?

2. What slow speed observer flag is set to indicate it no longer enabled and FAST entered high speed observer mode? 

For smooth transitions when changing speed direction, turn the forced angle off the following code example enables forced angle prior to enabling the controller.

// enable the forced angle
EST_setFlag_enableForceAngle(obj->estHandle,TRUE);

FAST configuration different for best start-up performance: enable forced angle. Right but what to do next?

  • 1. The motor identification process doesn't care about the force angle enable flag, it will enable/disable the force angle in estimator according to the identification state. The force angle flag is only used in the normal running state (EST_State_OnLine).

    2. No flag to indicate this. The angle will use the value from the estimator if the estimated speed is great than the USER_FORCE_ANGLE_FREQ_Hz. 

  • Yanming Luo said:
    1. The motor identification process doesn't care about the force angle enable flag, it will enable/disable the force angle in estimator according to the identification state.

    Forced state is not ever changing, flag always stay forced enabled (0x01) in every test state. This forced state is invalid FAST observer mode according to SPRUHJ1H–January 2013–Revised June 2019. Somebody not read this revised technical brief, write SDK code without caution to obey the rules or write nonsense text about slow speed observer, doubtful.

    Yanming Luo said:
    The force angle flag is only used in the normal running state (EST_State_OnLine).

    Again this is not true since lab.h has set forced initial state true (detect Nth pole) and it only is valid first few slow speed observer cycles. Fast estimator angle is forced true the entire ID process when flag should be changed to false after first few cycles. This also seems to effect state LC (motorVars.Ls_d_H, motorVars.Ls_q_H) mostly updates incorrect bogus values (9.99999997e-07) real time watch window way before LC state time ever finish. That alone seems very wrong just like a lot of this code seems very rushed and does not do what SPRUHJ1H states it should be doing.

    #define MOTOR_VARS_INIT {                                                      \
        false, /* flagEnableSys */                                                 \
        false, /* flagEnableRunAndIdentify */                                      \
        false, /* flagRunIdentAndOnLine */                                         \
        false, /* flagMotorIdentified */                                           \
        false, /* flagSetupController */                                           \
        true,  /* flagEnableForceAngle */ 

  • This FAST estimator force angle flag is not a constraint, it is a directive. SpinTAC sets force angle flag shown below snip. So USER_FORCE_ANGLE_FREQ_Hz constraint (value) is tested by slow speed observer but we must set flag FALSE for rotor speed >1Hz.

    Who knows what the FAST estimator ROM code will do if the slow speed observer flag is left enabled >1Hz rotor speed. Does FAST ignore flag >1Hz and why/how  Off line any different from Online mode is not apparent in lab5 code.  Perhpas LC Ld/Lq issues are result of ADC saturation, low user voltage filter pole value (298.603)? Or the SOC window (280ns) is to wide even with 10nF voltage filters versus typical 100nF, same issue with BoostXL-drv8320rs more often post incorrect flux values.   

    // Enable SpinTAC Move
    STVELMOVE_setEnable(stVelMoveHandle, TRUE);
    //If starting from zero speed, enable ForceAngle, otherwise disable ForceAngle
    if(_IQabs(STVELMOVE_getVelocityStart(stVelMoveHandle)) < _IQ24(ST_MIN_ID_SPEED_PU))
    {
        EST_setFlag_enableForceAngle(ctrlObj->estHandle, TRUE);
        gMotorVars.Flag_enableForceAngle = TRUE;
    }
    else
    {
       EST_setFlag_enableForceAngle(ctrlObj->estHandle, FALSE);
       gMotorVars.Flag_enableForceAngle = FALSE;
    }

     

  • Code snip checks rotor speed >1Hz of FAST slow speed observer, need to test for specific state change. The problem is R/L state frequency >1Hz easily disables flag. So it must assert prior to current ramp up to disable forced angle >1Hz rotor speed. How to check for [EST_STATE_RAMPUP] seems the real?

     /* Check rotor speed >1Hz, disable ForceAngle */
     if((motorVars.speed_Hz > USER_FORCE_ANGLE_FREQ_Hz) &&
         		(motorVars.flagEnableForceAngle == true))
     {
         EST_setFlag_enableForceAngle(estHandle, false);
    
         motorVars.flagEnableForceAngle = false;
     }

  • Yet there is estimator object for checking ForceAngle flag. When state changes to RampUp the Angle flag can be enabled then. Leaving the Angle flag enabled >1Hz may produce odd current ramifications (vibrations)? The PWM wave form during state LC looks horrible very distorted SNR occurs.   

    extern bool EST_getFlag_enableForceAngle(EST_Handle handle);

    Gets the enable force angle flag value from the estimator.

    EST_getFlag_enableForceAngle(estHandle);

  • This is estimator definition seems to counter slow speed observer requirement or it simply does not mention it.

    EST_setFlag_enableForceAngle ()
    void EST_setFlag_enableForceAngle (EST_Handle handle,const bool_t state)
    Sets the enable force angle flag in the estimator Enable or disable the DC measurement of Rs at startup of the motor
    Handle: The estimator (EST) handle
    State: The desired flag state, on (1) or off (0)
    • TRUE: Enable forced angle. The estimated angle will be bypassed if the flux frequency falls below a threshold defined by:
    #define USER_ZEROSPEEDLIMIT (0.001)

    in user.h. A typical value of this frequency is 0.001 of the full scale frequency defined
    in: #define USER_IQ_FULL_SCALE_FREQ_Hz (500.0)

    Forced angle algorithm, when active, that is, when the rotor flux electrical frequency
    falls below the threshold, will be forcing a rotating angle at a frequency set by the
    following define: #define USER_FORCE_ANGLE_FREQ_Hz (1.0)

    • FALSE: Disable forced angle. The estimator will never be bypassed by any forced
    angle algorithm.

  • Seemingly missing code piece (zero speed limit) so estimator controls Force Angle.

    //! \brief Defines the forced angle frequency, Hz
    //!
    #define USER_FORCE_ANGLE_FREQ_Hz            ((float32_t)(1.0))
    
    //! \brief The estimated angle will be bypassed if the flux
    //!        frequency falls below zero speed threshold, 1Hz
    #define USER_ZEROSPEEDLIMIT       ((float32_t)(0.001 * USER_MAXIMUM_SCALE_FREQ_Hz))

  • Don't need to add the code as you mentioned, the USER_ZEROSPEEDLIMIT is set to a default value (equals to 0) in the FAST estimator and is for the flux integrator, so the flux, speed, and angle estimator is always enabled in FAST. The active angle will be dependent on the force angle flag and USER_FORCE_ANGLE_FREQ_Hz. The active angle will be always from the FAST estimator if the force angle flag is disabled, and the active angle will from the force angle if the force angle flag is enabled and the estimated speed is lower than USER_FORCE_ANGLE_FREQ_Hz.