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: Some issues when configuring the CMPSS module when using the MotorContorl_SDK

Part Number: TMS320F280025
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Tool/software:

Hello, expert:

When I was using the MotorControl_SDK, I found a problem related to the configuration of the CMPSS module:

We routed both CMPSS1 and CMPSS3 to TRIP7 via ePWM x-bar, and routed TRIP7 to DCAH and DCBH through the DC sub-module of ePWM, as shown in the following code:

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

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

Based on the previous relevant configurations of CMPSS1 and CMPSS3, it can be known that if there is an overcurrent situation in the U/V/W three-phase (where the U phase only detects positive overcurrent, the W phase only detects negative overcurrent, and the V phase detects both positive and negative bidirectional overcurrent), then the outputs of CMPSS1 and CMPSS3, CTRIPH and CTRIPL, will both output high levels. This means that both DCAH and DCBH will obtain a high level. (Question 1: Is this point correct?)

Then, the next step is to configure the event of ePWMxA at this time, that is, when DCAH shows a high level, trigger DCAEVT1 (as shown in the following figure).

The code at this time is:

        EPWM_setTripZoneDigitalCompareEventCondition(obj->pwmHandle[cnt],
                                                     EPWM_TZ_DC_OUTPUT_A1,
                                                     EPWM_TZ_EVENT_DCXH_HIGH);

In this way, the macro definition EPWM_TZ_EVENT_DCXH_HIGH means that when DCAH is at a high level, DCAEVT1 is triggered, thereby generating a protection signal. (Question 2: Is this point correct?)

However, the problem lies in the configuration of ePWMxB, as we have previously routed TRIP7 to DCBH. According to the same logic, when DCBH is at a high level, should DCBEVT1 be triggered (as shown in the following figure)?

However, the code at this time is indeed represented as:

        EPWM_setTripZoneDigitalCompareEventCondition(obj->pwmHandle[cnt],
                                                     EPWM_TZ_DC_OUTPUT_B1,
                                                     EPWM_TZ_EVENT_DCXL_HIGH);

The macro definition EPWM_TZ_EVENT_DCXL_HIGH seems to imply that when DCHL is at a high level, the DCBEVT1 event is generated. Unfortunately, we didn't route TRIP7 to DCHL.

Question 3: Where does the problem occur here? Is the macro definition EPWM_TZ_EVENT_DCXL_HIGH used wrongly in the routine?

In addition:

I checked the sysconfig version of the F280025 routine and found the same configuration, as shown in the following figure:

If configured according to the sysconfig version, Digital Compare B Low is routed to TRIP1, and TRIP1 is the same as TZ1. TZ1 is routed to INPUTXBAR1, which is the nFAULT pin.

However, the nFAULT pin is valid at a low level, which means it is at a high level under normal circumstances. Therefore, according to the configuration in sysconfig, DCBL will always be at a high level. Is this reasonable?

  • Hello,

    Question 1: Yes, this point is correct.

    - CMPSS1 is configured to detect overcurrent in the U phase (positive only) and V phase (bidirectional).
    - CMPSS3 is configured to detect overcurrent in the W phase (negative only) and V phase (bidirectional).
    - If there is an overcurrent situation in the U/V/W three-phase, both CMPSS1 and CMPSS3 will detect the overcurrent and output a high level on their respective outputs, CTRIPH   and CTRIPL.
    Since both CTRIPH and CTRIPL are routed to TRIP7, and TRIP7 is routed to DCAH and DCBH, both DCAH and DCBH will receive a high level signal.
    Therefore, if there is an overcurrent situation in the U/V/W three-phase, both DCAH and DCBH will indeed obtain a high level signal, as you described.

    Question 2: YES, this point is correct.

    - The macro definition EPWM_TZ_EVENT_DCXH_HIGH is used to configure the ePWMxA module to trigger an event when the DCAH signal is at a high level.
    - In the code, EPWM_TZ_EVENT_DCXH_HIGH is used to set the event trigger for DCAEVT1, which means that when DCAH is high, DCAEVT1 will be triggered.

    Question 3: 

    Based on the information you provided, it seems that you have configured the ePWMxB module to trigger an event when DCBH is at a high level. However, the code uses the macro definition EPWM_TZ_EVENT_DCXL_HIGH, which implies that the event is triggered when DCHL is at a high level, not DCBH. To fix this issue, you should use the correct macro definition that corresponds to DCBH, not DCHL.

  • Hello, expert
    Thank you very much for your patient answers.
    The code mentioned earlier was copied by me from the MotorControl_SDK and no modifications were made. Does this mean that there is an error in the configuration in the routine?


    by the way:

            EPWM_setTripZoneDigitalCompareEventCondition(obj->pwmHandle[cnt],
                                                         EPWM_TZ_DC_OUTPUT_B1,
                                                         EPWM_TZ_EVENT_DCXL_HIGH);

    This code doesn't seem to work because in the previous configuration, TRIP7 was connected to DCBH instead of DCBL. Therefore, configuring the trigger event of DCBEVT1 as DCBL also has no effect. Is this understanding correct?

  • Hello Yan,

    Could you provide me with repo or name of Motor Control SDK example, please? 

  • hi Stevan,

    The path of the example is:

    D:\ti\c2000\C2000Ware_MotorControl_SDK_5_04_00_00\solutions\universal_motorcontrol_lab\f28002x

  • Thanks for your reply, Yan. Let me loop in the relevant expert on that lab and see if they provide more details on Digital Compare configuration.

    Best regards,

  • Thank you for your reply as well. Please let me know if there is any latest progress

  • hi Stevan,

    May I ask if there is any latest progress regarding this related issue of MotorControl_SDK?

  • Hi Yan,

    You can reference project below which has syscfg support and uses the same scheme as the universal motor lab for over-current (CMPSS based) trips.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_5_04_00_00\solutions\universal_servo_drive

    ePWM Config:

    EPWMXBAR:

    Best,

    Kevin