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.

TMS320F28377D: SDFM Comparator Values and Trip Thresholds

Part Number: TMS320F28377D


I am using the SDFM1 module to measure 3-phase currents.  I have the data outputs working as expected and am successfully using the data elsewhere in the microcontroller.  However, I now need to use the comparator trip thresholds to detect over-current conditions and then shut-down the EPWM modules.  I have successfully routed the SDFM comp trip to the EPWM modules, but am confused about how the SDFM comp values correspond to input signals.

The reference manual states that the data unit translates "low" input signals to -1 and "high" input signals to +1.  But the comp unit only translates into the range 0 and +1.

How is duty cycle translated into comp values?  Which of the following two alternatives is correct?  The first biases the input signal with half of the comp range, whereas the second takes the absolute value of the input signal.  The reference manual is not clear.

Duty Cycle = 0.0 -> Data Value = -512, Comp Value = 0
Duty Cycle = 0.5 -> Data Value = 0, Comp Value = +256
Duty Cycle = 1.0 -> Data Value = +512, Comp Value = +512

OR

Duty Cycle = 0.0 -> Data Value = -512, Comp Value = +512
Duty Cycle = 0.5 -> Data Value = 0, Comp Value = 0
Duty Cycle = 1.0 -> Data Value = +512, Comp Value = +512

Thanks in advance,

Andrew

  • Andrew,

    What do you mean by duty cycle? If your question is how to calculate theoretical data filter / comparator filter  output based on the input voltage you apply to modulator. Please check the below link.

    Regards,

    Manoj

  • Hi Manoj,

    Thank you for your reply.  Sorry about the delay with my response - I was tied up with another matter.  Duty cycle means ones density in this case.

    The post you pointed me towards has answered my question - the behaviour is as per my first example above.  But the TI documentation is not at all clear, and should really be updated to make it clear how the COMP output behaves.

    Also, from the peak data values table in the reference manual, presumably the "-1" in the formula for the DATA count should only be used when the OSR is 256?  For OSRs less than that, the peak data value table shows that the maximum count is not restricted by the 16 bit data width (provided appropriate bit-shifting is performed).

    I will mark your answer as resolving my issue after the above question has been clarified.

    Regards,

    Andrew

  • Andrew,

    For a data filter, a 16-bit signed output can represent values from -32768 (0x8000 to 32767 (0x7FFF). Any value less than -32768 (or) any value greater than 32767 cannot be represented in 16-bit signed filter output unless you appropriately shift the bits based on DOSR configuration.

    If you wish to represent data filter output in 16-bit format, you need to right shift depending upon DOSR settings use table "Shift Control Bit Configuration Settings" provided in SDFM chapter. I hope this clarifies your question.

    Regards,

    Manoj

  • Manoj,

    Yes, 16-bit numbers only a have a range of -32768 to +32767.  But my point is that the bit shifting specified in the shift control configuration settings table deliberately shifts the data down BELOW this range to ensure that no overflows occur for the maximum data value.

    For a DOSR of 64, Sinc3 filter, the unshifted range is -262,144 to +262,144.  Using the specified 4-bit shift, this is shifted down to -16,384 to +16384. The highest value is not reduced by 1.  The only case where this is not true is for a DOSR of 256, where the maximum unshifted data value is 16,777,215.

    On a related matter, in one of your replies in the previous thread, you state that:

    Max_comparatorfilter_value(Sinc3, 32) = 32767

    But the maximum comp value for this condition is actually 32768.

    As I said previously, the reference manual is not at all clear.  I have to see to other things now, so will not be able to look at this again until next week.

    Regards,

    Andrew

  • Andrew,

    I have answered your first question in this thread. I made that argument for OSR = 128 in that thread, you can extend the same argument for OSR = 32, 64, 128 and 256. Since this is the second time I’m getting this question from C2000 community, I shall go and edit that table and mention users need to ensure that they need to operate in linear full scale range of SD-modulator.

    You are right about your second observation:

    Max_comparatorfilter_value(Sinc3, 32) = 32768 and not 32767

    Regards,

    Manoj

  • Manoj,

    Many thanks for the clarification, that makes sense now.  Shift values which could cause an overflow are allowed, provided that the user accepts responsibility for ensuring that the input signal never goes into those regions (i.e. remains within the linear range).  For the benefit of other engineers, please can you update the TRM to make this clear.

    Regards,

    Andrew