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.

TMS320F280049C: TIDM-02002 : IPRIM_TANK / ISEC_TANK ADC Samples

Part Number: TMS320F280049C
Other Parts Discussed in Thread: TIDM-02002, C2000WARE

Hello,

In TIDM-02002, it seems that IPRIM_TANK/ISEC_TANK are not measured by ADC, they are just used as CMPSS trip inputs. However it appears some code already exists to implement ADC readings but it appears incomplete/inconsistent. I'd like to understand the designer's intention assuming ADC readings are implemented because our design does require ADC readings for IPRIM_TANK and SEC_TANK so I'm trying to activate and augment the existing code.

Q1:

C:\ti\c2000\C2000Ware_DigitalPower_SDK_4_01_00_00\solutions\tidm_02002\f28004x\drivers\source\clllc_hal.c, lines 1170 to 1187:

    //
    // for the faster signals such as shunt current sense, the PWM time base of
    // the module used to control the power stage must be used.
    // Also as we are interested in the peak value we must sample close to the
    // falling edge of the leg1 H PWM
    // Select SOC from counter at ctr =CMPA
    //
    EPWM_setADCTriggerSource(CLLLC_PRIM_LEG1_PWM_BASE,
                             EPWM_SOC_A, EPWM_SOC_TBCTR_U_CMPD);
    //
    // CMPA is updated in the ISR so nothing to do here
    // pre-scale the trigger of the ADC conversion
    //
    EPWM_setADCTriggerEventPrescale(CLLLC_PRIM_LEG1_PWM_BASE,
                                        EPWM_SOC_A, 6);

    EPWM_enableADCTrigger(CLLLC_PRIM_LEG1_PWM_BASE,
                          EPWM_SOC_A);

Lines 1173 and 1174 say that "we are interested in the peak value we must sample close to the falling edge of the leg1 H PWM Select SOC from counter at ctr =CMPA".

Assuming that is the case, shouldn't the 3rd argument to EPWM_setADCTriggerSource() refer to i) CMPA and ii) when CTR is counting down? In other words shouldn't it be:

    EPWM_setADCTriggerSource(CLLLC_PRIM_LEG1_PWM_BASE,
                             EPWM_SOC_A, EPWM_SOC_TBCTR_D_CMPA);

Q2:

Lines 1287 and 1288 generate an SOC on every 6th event:

    EPWM_setADCTriggerEventPrescale(CLLLC_PRIM_LEG1_PWM_BASE,
                                        EPWM_SOC_A, 6);

Why is the SOCA triggered once every six PWM cycles? Where does 6 come from please?

Q3:

C:\ti\c2000\C2000Ware_DigitalPower_SDK_4_01_00_00\solutions\tidm_02002\f28004x\clllc\clllc_user_settings.h, line 200:

#define CLLLC_IPRIM_TANK_ADC_TRIG_SOURCE CLLLC_ADC_TRIG_FAST_SOURCE

CLLLC_ADC_TRIG_FAST_SOURCE is undefined. If it was defined, I assume it would be ADC_TRIGGER_EPWM1_SOCA, is that correct?

Thank you.

  • I don't have great answers here.

    Q1 There are a number of things that make this confusing, including the ability to swap the A and B outputs of the module. I would recommend testing and verifying your assumption is infact correct. I don't believe the sampled value would be very valid if this were the case.

    Q2 I don't have any rhyme or reason here, It appears that sampling every period was too much so the scaled it down. depending on your operating frequency you can increase or decrease this as you see fit.

    Q3 That does seem to not be defined. I would recommend that you think though what event you would like this to be synchronous to and use that. Obviously ePWM 1 is going to be very fast being that it runs at the carrier frequency of the CLLLC. 

    Regards,
    Cody 

  • OK, thanks for replying. I guess only definitive answers are available from the author, Manish Bhardwaj. Reading between the lines, I take it that he is not available to comment on this reference design anymore?

  • Q1 can be determined by running the code and verifying which event is actually causing the falling edge. Should be simple enough, will just take you some time to verify.

    Q2's answer does probably lay with Manish.

    Q3 may be able to be dug out of the code base, as we do have it under source control. But would likely take a couple hours of digging for a feature which is not relevant to the algorithm running on the design. In this case it would be a feature enhancement that you were making, and I would suggest you reevaluate the feature in its entirety.

    Finally, I believe you have correctly determined the answer to your last question. :) A LinkedIn search may provide further answers as to why he would not be motivated to answer such questions.

    Regards,
    Cody 

  • Thanks for the response and LinkedIn pointer. Yes I think I'll just have to try it out.