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.

CCS/TMS320F28069: noise on ADCs

Part Number: TMS320F28069

Tool/software: Code Composer Studio

Hi,

My team and i have developed a 3-phase motor controller, using the F28069 DSP.  We have some issues with approximately 1kHz periodic noise signal, which appears on the measured phase currents even if all mosfets are fully off (0% duty cycle) or fully on (100% duty cycle). To investigate this event further, we have tried measuring the phase currents with some external in-line hall effect sensors instead of the on-board low-side shunt-resistors. The 1kHz appears here as well - however not when the external sensors are connected to the ADC B group instead of the A group on the DSP.

When i sample signals using the external sensors, which are connected to ADC A4, A5 and A6 channels, an approximately 1kHz periodic noise appear.

When i connect the exact same sensors to the ADC B3, B4, B5 the problem seems to disappear.

Any ideas what could be the problem?

This is my ADC configuration (initADC()) and how i read from the sensors (readPhaseCurrentsExtern()):

#define ACQPS_VALUE 6

void InitADC() {

    InitAdc();
    InitAdcAio();
    //AdcOffsetSelfCal();
    // Configure ADC
    EALLOW;
    AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1;   //Enable non-overlap mode
    AdcRegs.ADCSOC0CTL.bit.CHSEL  = 0;       //Set SOC0 channel select to ADCINA0
    AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5;
    AdcRegs.ADCSOC0CTL.bit.ACQPS  = ACQPS_VALUE;      //Set SOC0 acquisition period to 26 ADCCLK

    AdcRegs.ADCSOC1CTL.bit.CHSEL  = 1;       //Set SOC0 channel select to ADCINA1
    AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 5;
    AdcRegs.ADCSOC1CTL.bit.ACQPS  = ACQPS_VALUE;      //Set SOC0 acquisition period to 26 ADCCLK

    AdcRegs.ADCSOC2CTL.bit.CHSEL  = 2;       //Set SOC0 channel select to ADCINA2
    AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 5;
    AdcRegs.ADCSOC2CTL.bit.ACQPS  = ACQPS_VALUE;      //Set SOC0 acquisition period to 26 ADCCLK

    AdcRegs.ADCSOC9CTL.bit.CHSEL  = 4;       //Set SOC0 channel select to ADCINA3
    AdcRegs.ADCSOC9CTL.bit.TRIGSEL = 5;
    AdcRegs.ADCSOC9CTL.bit.ACQPS  = ACQPS_VALUE;      //Set SOC0 acquisition period to 26 ADCCLK

    AdcRegs.ADCSOC10CTL.bit.CHSEL  = 5;       //Set SOC0 channel select to ADCINA3
    AdcRegs.ADCSOC10CTL.bit.TRIGSEL = 5;
    AdcRegs.ADCSOC10CTL.bit.ACQPS  = ACQPS_VALUE;      //Set SOC0 acquisition period to 26 ADCCLK

    AdcRegs.ADCSOC11CTL.bit.CHSEL  = 6;       //Set SOC0 channel select to ADCINA3
    AdcRegs.ADCSOC11CTL.bit.TRIGSEL = 5;
    AdcRegs.ADCSOC11CTL.bit.ACQPS  = ACQPS_VALUE;      //Set SOC0 acquisition period to 26 ADCCLK

    EDIS;

    /* Set up Event Trigger with CNT_zero enable for Time-base of EPWM1 */                      \
    EPwm1Regs.ETSEL.bit.SOCAEN = 1;     /* Enable SOCA */                                       \
    EPwm1Regs.ETSEL.bit.SOCASEL = 1;    /* Enable CNT_zero event for SOCA */                    \
    EPwm1Regs.ETPS.bit.SOCAPRD = 1;     /* Generate SOCA on the 1st event */                    \
    EPwm1Regs.ETCLR.bit.SOCA = 1;       /* Clear SOCA flag */
}

Phase readPhaseCurrentsExtern() {
    Phase current;

    //Fetch ADC values from data registers
    current.a = AdcResult.ADCRESULT9;
    current.b = AdcResult.ADCRESULT10;
    current.c = AdcResult.ADCRESULT11;

    return current;
}

where the InitAdc() and InitAdcAio() is:

void InitAdc(void)
{
    extern void DSP28x_usDelay(Uint32 Count);

    // *IMPORTANT*
    // The Device_cal function, which copies the ADC calibration values from TI reserved
    // OTP into the ADCREFSEL and ADCOFFTRIM registers, occurs automatically in the
    // Boot ROM. If the boot ROM code is bypassed during the debug process, the
    // following function MUST be called for the ADC to function according
    // to specification. The clocks to the ADC MUST be enabled before calling this
    // function.
    // See the device data manual and/or the ADC Reference
    // Manual for more information.

        EALLOW;
        SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1;
        (*Device_cal)();
        EDIS;

        DELAY_US(ADC_usDELAY);
        AdcRegs.ADCCTL1.all=ADC_RESET_FLAG;
        asm(" NOP ");
        asm(" NOP ");

        EALLOW;
        AdcRegs.ADCCTL1.bit.ADCBGPWD   = 1;    /* Power up band gap */

        DELAY_US(ADC_usDELAY);                  /* Delay before powering up rest of ADC */

        AdcRegs.ADCCTL1.bit.ADCREFSEL   = 0;
        AdcRegs.ADCCTL1.bit.ADCREFPWD   = 1;    /* Power up reference */
        AdcRegs.ADCCTL1.bit.ADCPWDN     = 1;    /* Power up rest of ADC */
        AdcRegs.ADCCTL1.bit.ADCENABLE   = 1;    /* Enable ADC */

        asm(" RPT#100 || NOP");

        AdcRegs.ADCCTL1.bit.INTPULSEPOS=1;
        AdcRegs.ADCCTL1.bit.TEMPCONV=0;

        DELAY_US(ADC_usDELAY);
}

void InitAdcAio()
{

   EALLOW;
   GpioCtrlRegs.AIODIR.all = 0x0000;
/* Configure ADC pins using AIO regs*/
// This specifies which of the possible AIO pins will be Analog input pins.
// NOTE: AIO1,3,5,7-9,11,13,15 are analog inputs in all AIOMUX1 configurations.
// Comment out other unwanted lines.

    GpioCtrlRegs.AIOMUX1.bit.AIO2 = 2;    // Configure AIO2 for A2 (analog input) operation
    GpioCtrlRegs.AIOMUX1.bit.AIO4 = 2;    // Configure AIO4 for A4 (analog input) operation
    GpioCtrlRegs.AIOMUX1.bit.AIO6 = 2;    // Configure AIO6 for A6 (analog input) operation
    GpioCtrlRegs.AIOMUX1.bit.AIO10 = 2;   // Configure AIO10 for B2 (analog input) operation
    GpioCtrlRegs.AIOMUX1.bit.AIO12 = 2;   // Configure AIO12 for B4 (analog input) operation
    GpioCtrlRegs.AIOMUX1.bit.AIO14 = 2;   // Configure AIO14 for B6 (analog input) operation

    EDIS;
}

  • Simon,

    Can you elaborate on your setup? Is this a custom board with traces routed to the ADC channels? When you say that you are measuring the hall effect sensors, are you using a scope or sampling with the ADC? How are the sensors connected to the ADC pins? Do you detect the 1kHz disturbance on the signals when using a scope?

    Do you have any ideas of why 1kHz is present? Is there some periodic event or task in your system that coincides with 1kHz?

    I noticed that you have added an ADC reset instruction to the InitAdc() function. Keep in mind that the ADC trims that are populated by Device_cal() will be cleared out when the ADC is reset.

    -Tommy
  • Hi Tommy,

    Thank you for answering and Sorry for missing out some important factors!

    The motor controller PCB is a custom board on which the TMS320F28069 is deployet. The in-line Hall effect sensors are located on another PCB and are connected to the DSP through a flat cable (and additional routing on the motor controller PCB)

    When i say i’m measuring the Hall effect sensors i mean that the currents are sampled from the Hall sensors using the ADC within the DSP (not a scope).

    I have not been able to detect the 1kHz by a scope as i was not able to measure that low voltages with my scope. But as the noise is not appearing when i use the ADC B’s instead of ADC A’s i figured that it must be related to the sampling and thus it should’nt occur on the analog circuits?

    The 1kHz should not have any relation to anything that i have configured in the DSP or are running on the PCB.

    The waveforms i showed in the main post was each 2000 data points stored within the DSP at a rate of 25kHz and afterwards send to my laptop and plot in Matlab where the x-axis is time and the y-axis is bits.

    Aarh okay - i’ll remove the reset, then.

  • Simon,

    Thanks for the additional information. I do not expect to see any significant performance differences between the A and B channels. They have different sample capacitors, but the converter core is the same.

    We may have to go through process of elimination to isolate the noise source. The fact that the B channels are clean means that the ADC core and supporting resources (like power and reference voltage) are ok.

    The next components outward would be the sample capacitors (by way of residual charge carryover between conversions), and then the PCB routing or cabling.

    Is there noise on any of the other A channels? Is the 1kHz noise still present if you replace all other ADC conversions with a single A channel like only A4 for enabled SOCs? This would reduce the residual charge impact.

    Are there any differences in signal conditioning between the A and B channels? For example RC filters on the A, but not on B?

    Can you short the A and B channels together (ex: A4 to B3, A5 to B4, A6 to B5) to see if the B channels start to pick up noise?

    -Tommy
  • Hi Tommy,

    Is there noise on any of the other A channels?

    When i sample from the on-board low-side shunt resistors (using ADC A0, A1 and A2), i as well get the 1kHz noise, though it looks a bit different from when i sample from the in-line hall effect sensors (using ADC A4, A5 and A6):

     The top figure shows the phase A, phase B and phase C currents sampled from the hall effect sensor, while the bottom figure shows the phase A, phase B and phase C currents sampled from the low-side shunt resistors. The data sets entirely the same way as mentioned earlier (duty-cycle = 0%).

    So yes - i have the same problem using other of the ADC A channels.

    Is the 1kHz noise still present if you replace all other ADC conversions with a single A channel like only A4 for enabled SOCs? This would reduce the residual charge impact.


    I have commented out all the lines that configured the ADCs (in initADC() showed earlier) besides from the channel A0, so that my configuration now only is:

    void InitADC() {    
        InitAdc();
    
        // Configure ADC
        EALLOW;
        AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1;   //Enable non-overlap mode
        AdcRegs.ADCSOC0CTL.bit.CHSEL  = 0;       //Set SOC0 channel select to ADCINA0
        AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5;
        AdcRegs.ADCSOC0CTL.bit.ACQPS  = ACQPS_VALUE;      //Set SOC0 acquisition period to 26 ADCCLK
        EDIS;
    }

    The results again shows approx. 1kHz noise:

     


    And i have also tried only with A6 while leaving the ADC channel floating (nothing connected to it) which showed an approx. 1kHz noise, though not as bad:

    Are there any differences in signal conditioning between the A and B channels? For example RC filters on the A, but not on B?


    No the signal path is entirely the same between the two groups of channels. The channels are routed directly up to the external board including the in-line sensors, on which the signal conditioning is performed, so i'm sure that the hardware is the same.

    Can you short the A and B channels together (ex: A4 to B3, A5 to B4, A6 to B5) to see if the B channels start to pick up noise?


    Shorting is not easy on my configuration. Any other way that i can demonstrate if the B channel may pick up noise?

     

  • Simon,

    Your floating A6 experiment makes me think that the noise might be coming in through the PCB.  If it was originating from inside the device, it most likely would have created large disturbances on the floating A6 conversions.

    Was a switch, header, or 0Ω resistor used to isolate A6 near the device pin?  If so, is there some digital or power trace on the PCB that runs near the A-channels after the isolation, but not near the B-channels?

    -Tommy

  • Simon,

    Were you able to make progress in identifying the root cause?

    -Tommy
  • Hi,

    Unfortunately, i have not been able to figure it out yet. By now, i'm using the B channels. I did not really use anything to isolate A6 - i only disconnected the external board, which was connected through a header on the PCB, so there is still a trace on the PCB connected to the A6 pin, which is floating. I do not know, if there's a digital or power trace near to the A channel pins. However, i just found out that the unused ADC channels are floating as well, altough i think they should have been tied to ground. Can that maybe be the reason?

    Br, Simon
  • Simon,

    I would not expect the floating pins to cause any problems like this. The recommendation to tie them to ground is more of a best practice rather than a way to compensate for a known issue.

    If you don't plan to investigate the A-channel noise for a while, I will close this thread until you are ready to look into it again.

    -Tommy
  • I’m going to postpone the investigation of the A-channel, so yes - just close the thread.

    Thank you much for helping

    Br, simon