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.

TMS320F280025: Regarding the issue of the HAL_setupMtrFaults function when using the MotorControl_SDK

Part Number: TMS320F280025

Tool/software:

Hello, expert:
During the process of using the MotorControl_SDK, when I read void HAL_setupMtrFaults(HAL_MTR_Handle handle), the following questions arose:

//enable DC TRIP combinational input
EPWM_enableDigitalCompareTripCombinationInput(obj->pwmHandle[cnt],
MTR1_DCTRIPIN, EPWM_DC_TYPE_DCAH);

EPWM_enableDigitalCompareTripCombinationInput(obj->pwmHandle[cnt],
MTR1_DCTRIPIN, EPWM_DC_TYPE_DCBH);

The above code enables the DC module, uses DCAH and DCBH, and is connected to the TRIP7 channel. However:

// Trigger event when DCAH is High
EPWM_setTripZoneDigitalCompareEventCondition(obj->pwmHandle[cnt],
EPWM_TZ_DC_OUTPUT_A1,
EPWM_TZ_EVENT_DCXH_HIGH);

// Trigger event when DCBH is High
EPWM_setTripZoneDigitalCompareEventCondition(obj->pwmHandle[cnt],
EPWM_TZ_DC_OUTPUT_B1,
EPWM_TZ_EVENT_DCXL_HIGH);


Although the comment part of the above code shows that events are generated when DCAH and DCBH are set to High respectively, the macro definition used in the second function is indeed EPWM_TZ_EVENT_DCXL_HIGH. Is this a typo here?

  • the second function is indeed EPWM_TZ_EVENT_DCXL_HIGH. Is this a typo here?

    No, L means low side of PWM DACnL, H is high side of the PWM DACnH, seemingly 2-DAC 4 inputs each PWM module. Both trip zone events are OneShot (H/L) type (1) or CBC type 2 events reacting to specific signal states from CMPSS or PWM xBAR GPIO inputs also depending on xBAR MUX configuration/s. Agree need to keep consistent naming conventions. After months go by and you look at the code again, it's like what on earth is going on here. Users can add to existing notes, TRM page numbers too remind you later (:-).

    Even your added notes can be confusing have to actually open TRM refreshing memory.

  • hi, Genatco
    Thank you very much for your answer, but I'm even more confused. I don't know if I didn't express myself clearly.
    // Trigger event when DCBH is High
    EPWM_setTripZoneDigitalCompareEventCondition(obj->pwmHandle[cnt],
    EPWM_TZ_DC_OUTPUT_B1,
    EPWM_TZ_EVENT_DCXL_HIGH);
    In the above code, it is mentioned in the comments
    // Trigger event when DCBH is High
    But what is called in the function is EPWM_TZ_EVENT_DCXL_HIGH. Is this correct? Shouldn't it be EPWM_TZ_EVENT_DCXH_HIGH?

  • OUTPUT_B1

    Hi Yan Liu,

    This is the output under A1 and the Tz event happens when the B1(L) output state is high, versus when it is low. You can choose which state to set the trip event, H or L. The high and low reference (H/L) is also easy way to visualize the circuit. The inverter high side or low side gate drivers for power MOSFETS. The placement logic in the macro syntax reads from left to right and final Tz event state being last.

    So DCXH_ to set PWMx register Tz binary bits for A1(XH_) for high state _HIGH.  EVENT_DCXL is binary register bits for B1 low side of generator. To check register bits are correct, enter CCS debug after LaunchXL is connected via XDS110 probe application has loaded into flash memory.

    Check DC submodule for x25 TRM. Below x49c though should be very similar. Events: 1=OneShot, 2= cycle by cycle 

                       B1 Low DC                                                       A1 High DC

      

  • i am sorry, i cannot understand what are you talking about.  I think you are absolutely donot understand what i ask too

  • // Trigger event when DCBH is High

    The diagrams above were to give perspective on what is happening in the DC EVENT circuits. Seemingly it should be DCXH, not DCXL. They really should change the macro name 1A/1B or 2A/2B for DCA_EVENT1 or DCB_EVENT2 trip zones. The DC-A/B directly relate to the PWM A/B outputs action qualifiers. The other point being force DC_EVENT_1A for high side and DCEVENT_1B low side are OneShot  or CBC depending on what part of the above circuits you setup in action qualifiers. 

  • Thank you for your patient explanation. My understanding aligns with yours: Although the DCBEVT2 triggered by the DCBH channel might appear improperly configured, as long as DCAEVT1 can ensure ePWAxA is properly deactivated (or held low), and given that ePWMxB is configured to remain complementary to ePWAxA, this would result in the upper arm of the inverter being turned off while the lower arm is activated. Such behavior seems functionally reasonable in practical applications.

    In any case, I appreciate your detailed response!

  • this would result in the upper arm of the inverter being turned off while the lower arm is activated. Such behavior seems functionally reasonable in practical applications.

    Seems the motor becomes a brake in that condition. Perhaps better to select high impedance and let the half bridge input resistors pull down the gate signals to both sides. Then you have generator to recharge batteries coasting down to zero speed, Thanks for your patients, that macro name is even more confusing setting CMPSS MUX selections H/L.