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: UMCSDK over current OST DACA/B status build level 2

Guru 56418 points

Part Number: LAUNCHXL-F280049C

Hello,

There seems to be a bug somewhere in the over current detection auto clearing OST status ePWM action qualifiers for DACA-VALH and DACB-VALL filtered OR'd latches.

The same basic CMPSS, ePWM faults code verified working in SDK4.0 LAB is07 does not auto clear ePWM OST registers latched conditions as seemingly does MCSDK no matter USER_M1_OVER_CURRENT_TIMES_SET value being reduced 2. This has me baffled as the ePWM OST registers latched conditions are all cleared at RUN and remain cleared other than OST 6 never being set.

Oddly enough I recently reported similar issue SDK4.0 (enable/disable PWM in hal..h). Case of MCSDK the OST bits when enabled for DACA/B OR'd filtered are never being reset after the code (motor1_drive.c) seems to clear set flags only Tz6 remains set. Note the DMC build level 2 my motor runs open loop with no issues and we test TzDACS for OVC condition by reducing the trip current level shown below captures. Both MOTOR1_FAST and MOTOR1_ESMO symbols are in the build level 2. What is clearing the OST flag register bits never resets them enable PWM hal.h?  

#if defined(MOTOR1_FAST)
    // enable or disable bypassLockRotor flag
    if(objUser->motor_type == MOTOR_TYPE_INDUCTION)
    {
        EST_setFlag_bypassLockRotor(obj->estHandle,
                                    obj->flagBypassLockRotor);
    }
#endif // MOTOR1_FAST

    if(obj->flagClearFaults == true)
    {
        HAL_clearMtrFaultStatus(obj->halMtrHandle);

        obj->faultMtrNow.all &= MTR_FAULT_CLEAR;
        obj->flagClearFaults = false;
    }

    if(obj->flagRunIdentAndOnLine == true)
    {
        if(HAL_getPwmEnableStatus(obj->halMtrHandle) == false)
        {
#if defined(MOTOR1_FAST)
            // enable the estimator
            EST_enable(obj->estHandle);

            // enable the trajectory generator
            EST_enableTraj(obj->estHandle);
#endif // MOTOR1_FAST

            // enable the PWM
            HAL_enablePWM(obj->halMtrHandle);
        }

  • Somehow the get PWM faut status is clearing the flag register. So the DACA1 DACB1 OST events are being disabled. Perhaps reading EPWM FLGCLR register causes the flag bits to be cleared when the PWM enabled is true. Hence the ePWM action qualifiers setup for DACA1 DACB1 are never asserted! That is major difference between SDK4.01 and UMCSDK how the OVC status is detected.

    Motor1_drive.c

  • Now that I found the root cause of the OVC not tripping action qualifiers, CMPSS DACS remain 0x0 until an OVC condition. To stop PWM from gating during clear faults and disable PWM we must SW force action qualifiers one shots before clearing CMPSS DAC-L/H latches. That was sort of the reverse as the default code SW forced the trip zone (EPWM_TZ_FORCE_EVENT_OST) rather than clearing the one shots and after DAC-H/L via HAL_clearMtrFaultStatus() and HAL_disablePWM(). The DAC register defines have different symbol names SDK4.0 to MCSDK making it even more time consuming and confusing to debug issues.

    The other not so obvious setting is to also Enable any OR'd combination Tz's 5,7,9. For some reason the action qualifier ePWMA set for async filtered DACL does not like to include PWM action qualifier set for Low OVC fault detection with High action set too. Both DAC-H/L had to be set to detect High action state. Logically each phase should be capable to detect both high and low OVC conditions via 6 DAC's.

    Oddly enough USER_M1_ADC_FULL_SCALE_CURRENT_A  seems to be P2P current MCSDK versus SDK as the OVC trip point had to be set 50% higher user_mtr1.h even though the OVC function checks peak current. However the INA240A1 20V/V does not produce 50% error via 2mΩ shunt so something needs to be tweaked since the motor lists peak of 1.3 amps 20VDC 18 watts.

    Oddly the Offset calculation was tripping the OVC fault at 2.5 amps and every first time the motor is run. I have to set USER_MOTOR1_OVER_CURRENT_A  to 3.5 amps even with CMPSS hysteresis level 2 or it will trip OVC every run time.