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: Current Sensor update for LAUNCHXL-F280049C with BOOSTXL-DRV8320S EVM

Part Number: TMS320F280049C
Other Parts Discussed in Thread: LAUNCHXL-F280049C, BOOSTXL-DRV8320S

We are using LAUNCHXL-F280049C with BOOSTXL-DRV8320S EVM.  We replaced the shunt current sensors with LEM sensors and made modifications in our code, we are UNABLE to get the motor to spin.  We are requesting support on this.  Here is what we have done so far.:

1) In hal.c, we have removed the original ISENA, ISENB, ISENC PGA setup

//2026_04_06 // ISENA - PGA5->A14->RA0
//2026_04_06 ADC_setupSOC(obj->adcHandle[0], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
//2026_04_06 ADC_CH_ADCIN14, HAL_ADC_SAMPLE_WINDOW);
//2026_04_06
//2026_04_06 // ISENB - PGA3->C7->RC0
//2026_04_06 ADC_setupSOC(obj->adcHandle[2], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
//2026_04_06 ADC_CH_ADCIN7, HAL_ADC_SAMPLE_WINDOW);
//2026_04_06
//2026_04_06 // ISENC - PGA1->B7->RB0
//2026_04_06 ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
//2026_04_06 ADC_CH_ADCIN7, HAL_ADC_SAMPLE_WINDOW);

and set up LEM sensors (which are centered around 1.65v) on ISENA, ISENB, and ISENC to A/D inputs A8, A4, B4

// ISENA - A8
ADC_setupSOC(obj->adcHandle[0], ADC_SOC_NUMBER3, ADC_TRIGGER_EPWM6_SOCA,
ADC_CH_ADCIN8, HAL_ADC_SAMPLE_WINDOW);

// ISENB - A4
ADC_setupSOC(obj->adcHandle[0], ADC_SOC_NUMBER4, ADC_TRIGGER_EPWM6_SOCA,
ADC_CH_ADCIN4, HAL_ADC_SAMPLE_WINDOW);

// ISENC - B4
ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER5, ADC_TRIGGER_EPWM6_SOCA,
ADC_CH_ADCIN4, HAL_ADC_SAMPLE_WINDOW);

 

2) We have tried removing the PGA setup in hal.c, since we are not using the shunt PGA inputs and we moved to LEM A/D inputs

// HAL_setupPGAs(handle);

 

3) in user.h, we have tried setting various #defines for the following

#define USER_ADC_FULL_SCALE_CURRENT_A ((float32_t)(xxx.x))

#define IA_OFFSET_A (-xx.x) // ~=0.5*USER_ADC_FULL_SCALE_CURRENT_A
#define IB_OFFSET_A (-xx.x) // ~=0.5*USER_ADC_FULL_SCALE_CURRENT_A
#define IC_OFFSET_A (-xx.x) // ~=0.5*USER_ADC_FULL_SCALE_CURRENT_A

 

We are just replacing the current sensor type and sensing location and it is not working.  We are requesting support for this effort.

  • Hello,

    You are likely very close, but this is usually not a “change the ADC channel and update USER_ADC_FULL_SCALE_CURRENT_A only” modification.

    The first thing I would check is that the software is still reading the same ADC result registers / SOC indices that the current-control code expects.
    In the original code, current channels were on SOC0, while the new LEM channels were moved to SOC3/4/5. ADC1_SoC 3 is used for dc bus voltage so there will be a conflict. Normally we try to capture all three current in same SoC with three different ADCs. Since in your code ISENA - A8 and ISENB - A4 connected to one ADC, you have to tune the ADC SoCs for all reading to avoid conflict.
    Also, do not forget to verify current polarity for each phase. A swapped polarity on one phase will usually prevent startup.

    Best Regards,

    Masoud

  • We moved the LEM channels to:  ISENA - A8;  ISENB - C14;  ISENC - B4 and moved them all back to SoC0.  I also removed the set-up of the PGA in hal.c, since these were for the shunt sensors.  We verified current polarity for each phase.  There are very few modifications between the TI example code which spins the motor using the shunt sensors and the modified current sensors, which does not spin (or attempt to spin the motor).  Please, what else can we try?

  • If I would to debug this, I will start with forcing a small open-loop test (you can try a constant Vd and Vq) and watch the three raw phase-current ADC readings in real time. The whole measurement signal chain can be debugged. 

    Best Regards,

    Masoud