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.

TMS320F28374S: (SDFM+) CLA gives strange result

Part Number: TMS320F28374S

Hi, 

I'm using this uP to control a 10 kw 3 phase buck. I get strange Udc value on power off of the converter. 

I measure current and voltage in this way: 

SDFM is free running -> CLA gets data via SDFM data ready interrupt-> CLA computes running average of current and voltage for 3 switching periods -> gives result to uP. 

The running average code is: 

        Sum = Sum - Buffer[Pointer];
        Buffer[Pointer] = DataFormSDFM * Scale;
        Sum = Sum + Buffer[Pointer];
        Result = Sum / (NrOfSamples +1);
        if(Pointer >= NrOfSamples){
            Pointer = 0;
        }
        else{
            Pointer = Pointer +1;
        }
(I'm using float32 for Sum,Buffer,Result,Scale and Uint for pointer)

Now this gives correct result when I use it to measure current (all current measurements are on SDFM1). 

But for voltage (measured with SDFM2 ) I get result -600V (or other random big negative number) when I turn off my converter. So I addded 

if( Result< -10){
 __mdebugstop(); 
}

 

at the end of the task that is triggered by SDFM2. And sure enough the second I stop my converter it brakes here.

I get all normal values in Buffer, in it I have 33.8 +/- 0.5V. But the values of Sum is -4614.4. And then it slowly in a couple of minutes goes back to 0 +/-0.5v. 

As there is no strange big number in Buffer I thing SDFM is ok, measures ok when the converter is running. My question is now: 

1) Why does the large negative value of Add suddenly happen?

2) Why does it go down to 0? Floating point error in calculation?

3) How to fix this?

Best regards, 

Marko Ante

  • Marko,

    Here is what I understand from your previous post. SDFM1 filter results doesn't happen. SDFM2 filter results suddenly provide negative value. Am I correct?

    Also, more importantly, are you using PWM to synchronize SDFM2 filter channels?

    Regards,
    Manoj
  • Marko,

    It is Thanksgiving week in US. Most of the TI engineers are on vacation. Please expect delay in response.

    I would realistically expect a response back from TI early next week.

    Regards,
    Manoj
  • Yes it only happens on SDFM2. Non of the channels are PWM synchronize they are free running all the time.

    But I don't think it SDFM problem because:
    1) There was no problem when I used the c28 core to do the averaging.
    2) There is no large negative value in the Buffer, where all the measurements go. As you can see form the example, the SDFM data goes directly into Buffer. 

    Edit

    3) If instead of SDFM data I write a constant into buffer. E.g. 150, I have the same problem. 

    Also I would redefine the problem. The Sum is always slowly going to 0. If I write to buffer a value form sdfm (or a constant positive) it goes slowly down to 0. And in the case of when I'm using SDFM and turn off the converter and write 0 to buffer, the Sum goes to a large negative number and then slowly goes up to 0. 

    Why?

    /Edit

    Aslo happy Thanksgiving.

    Best regards,
    Marko

  • Got it.
    It was MSETFLG RNDF32 fault.
    Read more in :
    e2e.ti.com/.../1815777
    e2e.ti.com/.../487649

    And I may make a suggestion. A lot of people and ti staff link to:
    processors.wiki.ti.com/.../Control_Law_Accelerator_(C2000_CLA)_FAQ
    In it there is a section: CLA Compared to C28x+FPU (C28x plus floating-point unit). WHY IS THIS NOT IN THERE!!!!! Put it in there.

    Best regards,
    Marko