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.

TMS320F28375S: SDFM for AMC1306E25 gives sporadic erroneous resultants

Part Number: TMS320F28375S
Other Parts Discussed in Thread: AMC1303E2520, AMC1306E25, AMC1303M2520

Hi, 

I have a 3 phase PFC application. I measure 3 phase currents, 3 phase voltages, dc voltage and dc current. The 3 phase voltages are "smooth" 50Hz, the 3 phase currents have high frequency ripple on them and dc voltage/current are also smooth and slow changing.

For measuring hardware I have: 5x AMC1303E2520: Manchester coded internal clk (for phase voltages and dc) and 3x AMC1306E25: Manchester coded externally clocked together by 20 MHz oscilator(for phase current). This is so that the current that has a high rate of change is sampled together and is totally synchronised.

 I have used SDFM + AMC1303E2520 on a previews project without problems, but now I have problems with getting correct data. I have an interrupt set (like in examples) and I just read the data and save it. I'm measuring nothing (but I have resistors - shunt and voltage ladder connected) so I would expect to constantly measure 0+/-some noise. 

And for voltage I get something like that. But for current I get spikes every now and then. They are both on SDFM1 module, configured the same. As seen in attacked pictures. On the picture is IL1 and UL1. The same exact situation is for other phase currents and voltages. 

Any ideas why? 

  • MarkoAnte,

    Can you please clarify if my understanding is correct?

    1) 3-phase voltage measurement uses AMC1303E2520 modulator:

    -   50Hz signal

    -   No problem with SDFM results

    2) DC voltage measurement uses AMC1303E2520 modulator:

    -   No problem with SDFM results

    3) DC current measurement uses AMC1303E2520 modulator:

    -   No problem with SDFM results

    4)  3-phase current measurement uses AMC1306E25 modulator:

    -    Spurious erroneous filter results

    -    3 phase currents have high frequency ripple on them

     I also want you to elaborate on the high frequency ripple noise on 3 phase current? Are you saying your seeing high frequency noise coupled on the manchester input bit stream?

    Regards,

    Manoj

     

  • Hi MarkoAnte here. (From home account - forgot mail)

    Right now nothing is connected to the board. No voltage, no current. I only wanted to set up the basic program. Basically I'm trying to read zeros.

    1) Yes with AMC1203e2520 there seems to be no problem in the voltage measurement.
    2 & 3) I have not tested DC measurement in depth - but I at first glance there are no large spikes like in the current measurement - but there is more noise in that mesurment.
    4) Yes the AMC1306E25 has the Spurious erroneous filter results. I wanted to have them synchronised because the current will have additional switching ripple on it - this has far the highest rate of change. So to have better measurements I wanted to have the sampling of the SD modulator synchronised.

    Also I did some more testing and when an interrupt triggers the data ready flags are rarely all up. Even when I tried to synchronise the SDFM module the flags are almost always not all set. And some time it looks like they get set (or perhaps re-set ) in the middle of the interrupt program (that only reads the data).

    I looked at the signals and they look ok. I put AC termination on the data lines so there is no overshot or under shoot of the data singles. And the clock line is nice and clean too.

    Best regards,
    Marko Ante
  • Hi, 

    for additional clarification on the flags. I have the program, in interrupt,  now like this: 

    ...

        DELAY_US(1);
    
        FlagRegister = Sdfm_readFlagRegister(SDFM1);
        FlagRegisterstart = FlagRegister;
    
        if(CHECK_BIT(FlagRegister, 12)){
    //read data here Sdfm_clearFlagRegister(SDFM1, SET_BIT(temp, 12)); } if(CHECK_BIT(FlagRegister, 13)){
    //read data here Sdfm_clearFlagRegister(SDFM1, SET_BIT(temp, 13)); } if(CHECK_BIT(FlagRegister, 14)){
    //read data here Sdfm_clearFlagRegister(SDFM1, SET_BIT(temp, 14)); } if(CHECK_BIT(FlagRegister, 15)){
    //read data here Sdfm_clearFlagRegister(SDFM1, SET_BIT(temp, 15)); } Sdfm_clearFlagRegister(SDFM1,0x80000000); FlagRegisterend = Sdfm_readFlagRegister(SDFM1); --> brake point here

    When I stop at the break point I usually have something like: 

    FlagRegisterstart = 0x8000F000

    FlagRegisterend =  0x80008000

    Right now I'm not even trying to read the data. 

    The same happens if I run the code with out the DELAY_US(1); -> I wanted to make sure that all the filters set the flag, if there would be some difference of the clk form the internal clocks and the external clock. I also have the modulator failure interrupt enabled. 

    Best regards, 

    Marko

  • So now my program is: 

    __interrupt void Sdfm1_ISR(void)
    {
        LED_2_PIN_TOGGLE();
        Sdfm_clearFlagRegister(SDFM1,0x8000F000);
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP5;
    }

    and I only have one interrupt configured at a time. One for one AMC1306E25 and one for one AMC1303E2520. I measured the toggling led with a scope. 

    For AMC1303E2520 I had to set up a pass fail mask. I get 1 fail every 50000 - 70000 oscilloscope measurements. The sample rate seems to drop for 8 or so samples and then get back to normal. See picture: 

    The AMC1306E25 is so much worse that I had to set up an measurement with persistence on screen for 100ms because the pass/fail mask would always trigger when I pressed start. As seen here, there is a lot of jitter: 

    For refferance this is how the AMC1303E2520 looked: 

    Why would the sample rate drop on the AMC1303E2520 and why would the AMC1306E25 be so jittery? For oscilator I'm using a 50 ppm oscilator with phase and period jitter in the ps range. 

  • Marko,

    Are you using PWM synchronization feature to synchronize current measurement channels? If so, it is highly likely that you are reading the filter results before they are ready.

    Regards,
    Manoj
  • HI, 

    no I'm not using the pwm for sync.

    In my last post you can see that I'm triggering on a single filter interrupt and I'm not even reading the data and something is obviously wrong. 

    Best regards, 

    Marko 

  • Marko,

    Do you see this problem only with mode2 ? (or) Do you see this problem in other modes (say mode 0 / 1)?

    Regards,
    Manoj
  • As of now you are clocking AMC1306E25 with 20MHz oscillator. Have you measured jitter on 20MHz input clock?

    "I get 1 fail every 50000 - 70000 oscilloscope measurements" - What do you mean by this? I'm not able to understand what failure you are talking about.

    Regards,
    Manoj
  • Hi,

    1) I can not test other modes then mode 2. I only have Manchester coded chips with no clock routed to the MCU. I tried other modes just to see and the SDFM (as expected) does nothing.

    2) I have tried, but the jitter is so small that I can't measure it with my scope. Eg 500 MHz is not enough to measure jitter on a clock generator specked for ps jitter. 5 ps rms and 15 ps p-p.

    3) I set up a pass/fail mask for my toggling led. See picture with the gray region. See how normally the signal is in the white space and then it is not and that would be a fail. Because before for 50000 oscilloscope samples the signal was in the white area.

    Also I have made some head way. I'm am now pretty sure that the problem is not in MCU or layout. It has to be a ADC problem. So I have open another forum post on the ADC group.
    Link:
    e2e.ti.com/.../717467
  • Okay. Please keep me posted.

    Regards,
    Manoj
  • So I changed all my modulators for AMC1303E2520 ones. At first glance the problem was solved as there was no more heavy jitter on the sample time. But after some more testing I found out that the problem is still here. 

    And now I'm totally confused/lost. I set up a test program like this: 

    //pin set up 
        //SDFM1
        GPIO_SetupPinOptions(48, GPIO_INPUT,  GPIO_ASYNC);
        GPIO_SetupPinMux(48,GPIO_MUX_CPU1,7);
        GPIO_SetupPinOptions(50, GPIO_INPUT,  GPIO_ASYNC);
        GPIO_SetupPinMux(50,GPIO_MUX_CPU1,7);
        GPIO_SetupPinOptions(52, GPIO_INPUT,  GPIO_ASYNC);
        GPIO_SetupPinMux(52,GPIO_MUX_CPU1,7);
        GPIO_SetupPinOptions(54, GPIO_INPUT,  GPIO_ASYNC);
        GPIO_SetupPinMux(54,GPIO_MUX_CPU1,7);
        //SDFM2
        GPIO_SetupPinOptions(56, GPIO_INPUT,  GPIO_ASYNC);
        GPIO_SetupPinMux(56,GPIO_MUX_CPU1,7);
        GPIO_SetupPinOptions(58, GPIO_INPUT,  GPIO_ASYNC);
        GPIO_SetupPinMux(58,GPIO_MUX_CPU1,7);
        GPIO_SetupPinOptions(60, GPIO_INPUT,  GPIO_ASYNC);
        GPIO_SetupPinMux(60,GPIO_MUX_CPU1,7);
        GPIO_SetupPinOptions(62, GPIO_INPUT,  GPIO_ASYNC);
        GPIO_SetupPinMux(62,GPIO_MUX_CPU1,7);
    //sdfm set up 
        //nastavi mode inputov za SDFM filtre
        Sdfm_configureInputCtrl(SDFM1, FILTER1, MODE_2);
        Sdfm_configureInputCtrl(SDFM1, FILTER2, MODE_2);
        Sdfm_configureInputCtrl(SDFM1, FILTER3, MODE_2);
        Sdfm_configureInputCtrl(SDFM1, FILTER4, MODE_2);
    
        Sdfm_configureInputCtrl(SDFM2, FILTER1, MODE_2);
        Sdfm_configureInputCtrl(SDFM2, FILTER2, MODE_2);
        Sdfm_configureInputCtrl(SDFM2, FILTER3, MODE_2);
        Sdfm_configureInputCtrl(SDFM2, FILTER4, MODE_2);
    
        //nastavi filtre za uporabo pri comparatorju
        Sdfm_configureComparator(SDFM1, FILTER1, SINC2, OSR_32, 0, 0x7FFF);
        Sdfm_configureComparator(SDFM1, FILTER2, SINC2, OSR_32, 0, 0x7FFF);
        Sdfm_configureComparator(SDFM1, FILTER3, SINC2, OSR_32, 0, 0x7FFF);
        Sdfm_configureComparator(SDFM1, FILTER4, SINC2, OSR_32, 0, 0x7FFF);
    
        Sdfm_configureComparator(SDFM2, FILTER1, SINC2, OSR_32, 0, 0x7FFF);
        Sdfm_configureComparator(SDFM2, FILTER2, SINC2, OSR_32, 0, 0x7FFF);
        Sdfm_configureComparator(SDFM2, FILTER3, SINC2, OSR_32, 0, 0x7FFF);
        Sdfm_configureComparator(SDFM2, FILTER4, SINC2, OSR_32, 0, 0x7FFF);
    
        //nastavi filtre za glavne podatke
        Sdfm_configureData_filter(SDFM1, FILTER1, FILTER_ENABLE, SINC2, OSR_64, DATA_16_BIT, SHIFT_0_BITS);
        Sdfm_configureData_filter(SDFM1, FILTER2, FILTER_ENABLE, SINC2, OSR_64, DATA_16_BIT, SHIFT_0_BITS);
        Sdfm_configureData_filter(SDFM1, FILTER3, FILTER_ENABLE, SINC2, OSR_64, DATA_16_BIT, SHIFT_0_BITS);
        Sdfm_configureData_filter(SDFM1, FILTER4, FILTER_ENABLE, SINC2, OSR_64, DATA_16_BIT, SHIFT_0_BITS);
    
        Sdfm_configureData_filter(SDFM2, FILTER1, FILTER_ENABLE, SINC2, OSR_64, DATA_16_BIT, SHIFT_0_BITS);
        Sdfm_configureData_filter(SDFM2, FILTER2, FILTER_ENABLE, SINC2, OSR_64, DATA_16_BIT, SHIFT_0_BITS);
        Sdfm_configureData_filter(SDFM2, FILTER3, FILTER_ENABLE, SINC2, OSR_64, DATA_16_BIT, SHIFT_0_BITS);
        Sdfm_configureData_filter(SDFM2, FILTER4, FILTER_ENABLE, SINC2, OSR_64, DATA_16_BIT, SHIFT_0_BITS);
    
    
    
        //dissable externe resete
        Sdfm_configureExternalreset(SDFM1,0,0,0,0);
        Sdfm_configureExternalreset(SDFM2,0,0,0,0);
    
        //Nastavi interrupte samo za modulation failer in za novo dato
        Sdfm_configureInterrupt(SDFM1, FILTER1, IEH_DISABLE, IEL_DISABLE, 0, 0);
        Sdfm_configureInterrupt(SDFM1, FILTER2, IEH_DISABLE, IEL_DISABLE, 0, 0);
        Sdfm_configureInterrupt(SDFM1, FILTER3, IEH_DISABLE, IEL_DISABLE, 0, 0);
        Sdfm_configureInterrupt(SDFM1, FILTER4, IEH_DISABLE, IEL_DISABLE, 0, 0);
    
        Sdfm_configureInterrupt(SDFM2, FILTER1, IEH_DISABLE, IEL_DISABLE, MFIE_DISABLE, 0);
        Sdfm_configureInterrupt(SDFM2, FILTER2, IEH_DISABLE, IEL_DISABLE, MFIE_DISABLE, 0);
        Sdfm_configureInterrupt(SDFM2, FILTER3, IEH_DISABLE, IEL_DISABLE, MFIE_DISABLE, 0);
        Sdfm_configureInterrupt(SDFM2, FILTER4, IEH_DISABLE, IEL_DISABLE, MFIE_DISABLE, 0);
    
        DELAY_US(100);
    
        //enable glavni filter
        Sdfm_enableMFE(SDFM1);
        Sdfm_enableMFE(SDFM2);
    
        //Master interrupt enable za ta modul
        Sdfm_enableMIE(SDFM1);
        Sdfm_enableMIE(SDFM2);
    //and iterrupt 
    __interrupt void Sdfm1_ISR(void)
    {
        Uint32 FlagRegister;
    
        LED_0_PIN_TOGGLE();
    
        FlagRegister = Sdfm_readFlagRegister(SDFM1);
    
        if(FlagRegister & 0x00001000){
            U31[i1] = SDFM1_READ_FILTER1_DATA_16BIT;
            if(U31[i1]  > max){
                max = U31[i1];
                LED_7_PIN_TOGGLE();
            }
            else if(U31[i1] < min){
                min = U31[i1];
                LED_7_PIN_TOGGLE();
            }
            if(i1 < 2000){
                i1++;
            }
            Sdfm_clearFlagRegister(SDFM1, 0x00001000);
        }
    
        if(FlagRegister & 0x00002000){
            IL3[i2] = SDFM1_READ_FILTER2_DATA_16BIT;
            if(IL3[i2]  > max){
                max = IL3[i2];
                LED_7_PIN_TOGGLE();
            }
            else if(IL3[i2] < min){
                min = IL3[i2];
                LED_7_PIN_TOGGLE();
            }
            if(i2 < 2000){
                i2++;
            }
            Sdfm_clearFlagRegister(SDFM1, 0x00002000);
        }
    
        if(FlagRegister & 0x00004000){
            U23[i3] = SDFM1_READ_FILTER3_DATA_16BIT;
            if(U23[i3]  > max){
                max = U23[i3];
                LED_7_PIN_TOGGLE();
            }
            else if(U23[i3] < min){
                min = U23[i3];
                LED_7_PIN_TOGGLE();
            }
            if(i3 < 2000){
                i3++;
            }
            Sdfm_clearFlagRegister(SDFM1, 0x00004000);
        }
        if(FlagRegister & 0x00008000){
            IL2[i4] = SDFM1_READ_FILTER4_DATA_16BIT;
            if(IL2[i4]  > max){
                max = IL2[i4];
                LED_7_PIN_TOGGLE();
            }
            else if(IL2[i4] < min){
                min = IL2[i4];
                LED_7_PIN_TOGGLE();
            }
            if(i4 < 2000){
                i4++;
            }
            Sdfm_clearFlagRegister(SDFM1, 0x00008000);
        }
    
        Sdfm_clearFlagRegister(SDFM1,0x80000000);
    
    
        //Sdfm_clearFlagRegister(SDFM1,0x8000F000);
    
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP5;
    }
    
    __interrupt void Sdfm2_ISR(void)
    {
        Uint32 FlagRegister;
    
        FlagRegister = Sdfm_readFlagRegister(SDFM2);
        LED_0_PIN_TOGGLE();
        if(FlagRegister & 0x00001000){
            U12[i11] = SDFM2_READ_FILTER1_DATA_16BIT;
            if(U12[i11] > max){
                max = U12[i11];
                LED_7_PIN_TOGGLE();
            }
            else if(U12[i11] < min){
                min = U12[i11];
                LED_7_PIN_TOGGLE();
            }
            if(i11 < 2000){
                i11++;
            }
            Sdfm_clearFlagRegister(SDFM2, 0x00001000);
        }
    
        if(FlagRegister & 0x00002000){
            IL1[i12] = SDFM2_READ_FILTER2_DATA_16BIT;
            if(IL1[i12]  > max){
                max = IL1[i12];
                LED_7_PIN_TOGGLE();
            }
            else if(IL1[i12] < min){
                min = IL1[i12];
                LED_7_PIN_TOGGLE();
            }
            if(i12 < 2000){
                i12++;
            }
            Sdfm_clearFlagRegister(SDFM2, 0x00002000);
        }
    
        if(FlagRegister & 0x00004000){
            Udc[i13] = SDFM2_READ_FILTER3_DATA_16BIT;
            if(Udc[i13]  > max){
                max = Udc[i13];
                LED_7_PIN_TOGGLE();
            }
            else if(Udc[i13] < min){
                min = Udc[i13];
                LED_7_PIN_TOGGLE();
            }
            if(i13 < 2000){
                i13++;
            }
            Sdfm_clearFlagRegister(SDFM2, 0x00004000);
        }
        if(FlagRegister & 0x00008000){
            Idc[i14] = SDFM2_READ_FILTER4_DATA_16BIT;
            if(Idc[i14]  > max){
                max = Idc[i14];
                LED_7_PIN_TOGGLE();
            }
            else if(Idc[i14] < min){
                min = Idc[i14];
                LED_7_PIN_TOGGLE();
            }
            if(i14 < 2000){
                i14++;
            }
            Sdfm_clearFlagRegister(SDFM2, 0x00008000);
        }
    
        Sdfm_clearFlagRegister(SDFM2,0x80000000);
    
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP5;
    }


    Basically I set up 1 led to toggle for each interrupt of a single filter and set up another led to toggle when there was another max/min value.

    I got these results: 

    Filter What I'm measuring min/max dropped samples (lower sample frequency)
    SDFM1_F1 U31 -4096/4096 yes
    SDFM1_F2 IL3 -4/4 no
    SDFM1_F3 U23 -224/4 no
    SDFM1_F4 IL2 -4096/4096 yes
    SDFM2_F1 U12 -4/4 no
    SDFM2_F2 IL1 -4096/4096 yes
    SDFM2_F3 Udc -408/4 no
    SDFM2_F4 Idc -4096/4096 yes

    observed then when the sample rate drops for those couple of samples I get +/- saturation. Some channels are fine like IL3 and U12, but 2 also have some strange noise on them.
    All these measurement channels are the same now. Same chip and same layout, same schematic. They were all made as hierarchy blocks, so I copy and pasted them in layout.

    Also what I found extremely strange is that I also recorded the bit streams of modulators. When the pin toggled saying that I have a new min max there was nothing strange. As far as I get it sigma delta bit stream average is the value for that sample. And for something like 4096 I would exact to see all 1 or close to it. But all I saw was a bit stream of constant frequency and was like
    101010101010101100101010101010
                   and here ^(where there are 1100)
    was where the first wrong data came in

    I then also tested the chips with no clock and compared the data streams.
    I got something like:
    no internal clock: 0011101001100110100110011001101001100110011010011
    w/ internal clock: 011001010101011001010101010110010101010101010101100

    Both chips had basically average of 0.5. But one when 0101 for the most time and the other when 0011 for the most time.

    I don't know. Maybe the problem is with the MCU after all - almost like it does not like 1100 :)

    I have no idea what to think.

    Best regards, 

    Marko

  • Marko,

    All the SDFM interrupt sources are disabled in your code. I don't see how SDFM1_ISR and SDFM2_ISR would get executed.

    Also, it is difficult for me to follow multiple questions within a post. Is it right for me to say that you are reading unexpected filter results for analog input you are providing to the modulator? Are the differential analog input to modulator floating? The bit stream you show looks like the your SD modulator is in saturation.

    I would advice to disable all the filter channels and debug one filter channel at a time.

    Reards,
    manoj
  • I enable one at a time with debugger, so I'm 100% sure that I'm reading correct filter results.

    My inputs are all connected to resistors - circuit are like are shown in the datasheet (figure 55 page 29 and figure 57 page 31). So in the case of eg. SDFM1_F4 both analog pins are connected to ground via the 0.01 Ohm resistor + the 330 ohm resistors marked R_flt (Figure 58, page 32). But I also have tired to solder bridge pins 2,3 and 4. Exact same performance.

    How does my bit stream show saturation? As per figure 46 on page 23 saturation would be if I had decoded Manchester to all 0 or all 1. But I just have different patters both averaging out to 0.5 or as analog 0V. Right?

    The table I have shown was made by only having 1 filter active at a time and taking a look at the results.

    datasheet I'm referring too:
    www.ti.com/.../amc1303e2520.pdf

    Regards,
    Marko

  • Marko,

    This is more SD-modulator question. I will leave that to AMC1303 engineers to answer.

    Regards,
    Manoj

  • Marko,

    I know you have a seperate thread with SD-modulator team regarding the same problem. Were they able to provide some inputs why device is going into saturation?

    Any other updates from your side?

    Regards,
    Manoj
  • Is this issue resolved? Can I close this thread?
  • No this problem is not resolved. 

  • Any updates from SD-modulators folks on root cause? I get a feeling this should most likely be hardware setup issue (some layout / schematic problem)

    Can you post the thread you are working with SD-modulator folks for future reference?

    Regards,
    Manoj
  • I haven't heard back from you for a while. Were you able to resolve this issue?

    -Manoj
  • No the issue is still not resolved.

    It look like the MCUs Manchester decoder is not working correctly.

    What would cause the MCU to not decode the Manchester coding correctly? I though maybe it is a MCU clock problem. How could I test that? I probed the crystal and it seems to oscillate fine.

    If I remade the board and used non Manchester coded chips is there a different mechanisem that samples the data going into the SDFM module?

  • Marko,

    The oscilloscope snapshots of SD-Cx shows that your modulator is in saturation. If you feed in saturated SD-Cx, SDFM filter result will max out showing SD-Cx in saturation. This is not unexpected behavior. Did you get any feedback from SD-modulator team? Did you ask them why SD-modulator is in saturation?

    SDFM supports four different modes, mode 0 and mode 2 are by far the most popular modes. Different clocking schemes supported by SDFM in mentioned in both DS / TRM. Please follow the guidelines provided there.

    Regards,
    Manoj
  • Can you please show me how data is in saturation? The SD-modulator team says that it is not.
  • Marko,

    In mode2, when the modulator is saturation, modulated bit stream looks like a clock signal. This is what I saw in one of your previous post which had oscilloscope snapshot.

    Regards,
    Manoj
  • Ok, yes what you say is right. But if you look at the scope shots, the periode of the modulated stream is not 50 ns but 100 ns. Because it is 101010101 decoded not 000000 or 111111 decoded. It can be batter seen on the 2 scope shot where the data is zoomed in.
  • Marko,

    I don't have any reason to believe that manchester mode is not working. This mode was validated thoroughly. If anything it should be either your hardware / software issue.

    So, I would suggest you to take a closer look at the differential voltage applied at input to the SD-modulator. I would suggest you to apply three differential voltages (-20mv, 0mv and +20mv), capture the zoomed in version of the oscilloscope snapshot and check the corresponding SDFM filter results. For this experiment case, I would also recommend you to configure SDFM (With Sinc3, DOSR = 256, 32-bit format filter result representation)

    Regards,
    Manoj
  • Apparently it was not validated thoroughly enough. The Manchester decoding block is broken and sporadically stop working.

    I have tried replacing my chips, my MCU, terminating data lines, soldering the Agnd, V+, V- pins together, changing SINC and DOSR, any many other thigs and I was getting the same results.

    Then I replaced my chips with AMC1303M2520 and soldered 0.1 mm copper wire form ClkOUT of the modulator to ClkIN of the SDFM and first try everything worked. With existing code I only changed the SDFM mode and muxed the ClkIN pins.

    The modulators seem to work fine with Manchester coding. The data is correct and the timings is all correct. Just the MCU decoder block is broken.