TMS320F2800157: TMS320F2800157

Part Number: TMS320F2800157

Tool/software:

ADC SOC Triggering and Interrupt Generation for Three- Phase Interleaved Buck Converter

We are working on a hybrid EV battery charger to charge a 12V auxiliary battery from an 80V main traction battery. 

In this system, we are using a three- phase interleaved synchronous buck converter, each phase are shifted by 120 degrees from each other. Phase U pwm is applied from EPWM1 module, Phase V via EPWM2 and Phase W via EPWM5. Center aligned PWM scheme is used so to capture each phase average current we want to trigger the ADC’s at midpoint of each inductor current which gets synchronized with zero crossing or period match of corresponding PWM counter. Three phase current are measured using ADCC module. ADCA module used for input voltage, output voltage and Heat sink temperature feedback. We are triggering ADCC as follows 

  • EPWM1 SOCA at counter zero event trigger the U-phase current. 
  • EPWM2 SOCA at counter zero event triggers the V-phase current. 
  • EPWM5 SOCA at counter zero event triggers the W-phase current. 
  • Initialisation code is given below:

 

8103.init.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
static void INIT_fnEpwm1(void)
{
EPWM_setClockPrescaler(EPWM1_BASE, EPWM_CLOCK_DIVIDER_1,
EPWM_HSCLOCK_DIVIDER_1);
EPWM_setTimeBasePeriod(EPWM1_BASE, tzPWM.uiPwmperiod_ticks);
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP_DOWN);
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, 0);
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, 0);
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

measurement_h.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
static inline void ADC_readSensedSignals(void)
{
tzFOC.fIphu_Cur = ((float32_t) IPHU_CUR_FB_ADCREAD - 2266.0f)
* PhCur_ADCPU_CONS*Ibase;
tzFOC.fIphv_Cur = ((float32_t) IPHU_CUR_FB_ADCREAD - 2266.0f)
* PhCur_ADCPU_CONS*Ibase;
tzFOC.fIphw_Cur = ((float32_t) IPHU_CUR_FB_ADCREAD - 2266.0f)
* PhCur_ADCPU_CONS*Ibase;
uiHs_Temp_sense = HS_TEMP_FB_ADCREAD;
tzFOC.fVout_fbk = ((float32_t) VOUT_FB_ADCREAD * PU_VOLTAGE_CONS)*Voutbase;
tzFOC.fVin_fbk = ((float32_t) VIN_FB_ADCREAD * PU_VOLTAGE_CONS)*Vinbase;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

userconfiguration_h.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#define SysClk_Freq_MHz (120.0f)
#define PWM_Freq_kHz (40.0f)
#define DeadBand_ns (1000.0f)
#define Base_Freq_Hz (400.0f)
#define Base_Angle_Rad (6.28318531f)
#define Base_Angle_Deg (360.0f)
#define Base_Current (320.0f)
#define Tsample (1.0f/PWM_Freq_kHz*1/1000.0f)
#define Ibase (335.0f)
#define Vinbase (153.0f)
#define Voutbase (18.07f)
/*==============================================================================
Configuration Macros for PWM modules
==============================================================================*/
#define PH_U_PWM_BASE EPWM1_BASE
#define PH_V_PWM_BASE EPWM2_BASE
#define PH_W_PWM_BASE EPWM5_BASE
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

By using this INIT function and rest of the code we are getting random values for ADCC module( adc sensing values:tzFOC.fIphu_Cur,tzFOC.fIphv_Cur,tzFOC.fIphw_Cur) . Can you please help us to resolve this issue.

  • Hello,

    I see you're reading from same ADC for all three phase currents.

        tzFOC.fIphu_Cur = ((float32_t) IPHU_CUR_FB_ADCREAD - 2266.0f) * PhCur_ADCPU_CONS*Ibase;

        tzFOC.fIphv_Cur = ((float32_t) IPHU_CUR_FB_ADCREAD - 2266.0f) * PhCur_ADCPU_CONS*Ibase;

        tzFOC.fIphw_Cur = ((float32_t) IPHU_CUR_FB_ADCREAD - 2266.0f) * PhCur_ADCPU_CONS*Ibase;

    I suggest you to check TI's reference designs to get some picture in mind about the configuration.

    Best Regards,

    Masoud