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/TMS320F28377D: Current measurement using SDFM unit

Part Number: TMS320F28377D
Other Parts Discussed in Thread: AMC1305L25, C2000WARE

Tool/software: Code Composer Studio

Hi community

- Could anyone please help me in determining the accuracy of my sensor board?

In this board, AMC1305L25 IC is used with a shunt resistor (0.0015 ohm). I wonder if somebody please let me know what is the lowest value of current variation that this sensor could detect if I use Sinc3 and OSR=X with ENOB=Y bits.

- Is it possible to increase the accuracy by using higher value shunt resistor? 

- In order to increase the accuracy, if i'm sure that my current is such small that the input voltage of AMC would stay in its linear range, could I use lower bit shifts than the one proposed in table 12-5 TRM ? for example is it possible to use 3 shifted bits for OSR=63 instead of 4-bit shift? Is it an effective way to increase the lowest value of the current variation detected by the sensor?

regards

  • Messi,

    SDFM available in F28377D is only a digital filter. By choosing filter type and OSR setting you can effectively control the effective resolution (ENOB) of signal for SD-modulator operating at a specific frequency not not its accuracy. Accuracy depends on SD-modulator. You need to check DC Accuracy and AC accuracy specs of AMC1305L25 (Pg: 10 www.ti.com/.../amc1305l25.pdf)

    When you chose Sinc3, OSR = 63, you don't need to shift by 4 bits. It is only 3. That is what is mentioned in TRM.

    Regards,
    Manoj
  • Hello Manoj and thank you for reply

    - I am not so familiar with the digital filters. could you please explain in brief what is the difference between "resolution" and "the lowest value of current variation that could be detected and read by DSP" ?

    - Furthermore, when I read the filter results, in the debug windows and in "expression" tab, I am observing the current. for a DC current, the value read by DSP always have a little variation. e.g. 1.223 , 1.230, 1.225, 1.228 ,.... what is the reason of these oscillations while the current is a DC current generated by a DC power supply?

    - about the "Sinc3, OSR = 63," yes it was my mistake in typing, I meant OSR=64 which needs 4-bit shifting. is it possible to use 3 shifted bits for OSR=64 instead of 4-bit shift?

    regards

  • Messi,

    Below link provides good explanation of resolution / DC accuracy / AC accuracy etc.

    www.embedded.com/.../Understanding-analog-to-digital-converter-specifications

    The variations you see doesn't seem abnormal. If you want to see very little variation you may consider increasing OSR which would provide better resolution reducing these variations.

    Yes, if you are sure if can maintain SD-modulator in linear range, you can use shift by 3 instead of 4 when you use Sinc3, OSR =64.

    Regards,
    Manoj
  • Thank you Manoj for useful information

    As I noticed from TIDU499A, using Sinc3 and OSR=256 and clk=20MHz, the SDFM generates data every 12.8us:

    "Using the Sinc3 decimation filter architecture, the output signal update rate depends on the modulator clock frequency and the decimation ratio. Using a 20-MHz modulator in conjunction with a decimation ratio of 256, the current signal will be updated every 12.8 μs."

    Now assume that the SDFM generates the data at t=12.8us , 25.6us , ....

    - what is the output of the filter between these two time? I mean if my code reads the data of SDFM for example at t= 15us, what is it? does it the data generated at t=12.8us or it is other inappropriate data?

    - If I want to read the current of t=0s, or another exact time, is it possible? in other words, to which time the data generated at t=12.8us belongs?  In my desired application it is important to read the current of specific times (for example t=5s). Is it possible?

    Regards

     

  • Messi,

    "what is the output of the filter between these two time? I mean if my code reads the data of SDFM for example at t= 15us, what is it? does it the data generated at t=12.8us or it is other inappropriate data?"

                    If you read the data at say 15us, you will read data generated at t = 12.8us.

    "If I want to read the current of t=0s, or another exact time, is it possible? in other words, to which time the data generated at t=12.8us belongs?  In my desired application it is important to read the current of specific times (for example t=5s). Is it possible?"

                   You can use SDSYNC feature to synchronize (or) time the SDFM filter reads. You need to configure PWM to provide SDSYNC pulse with respect to PWM cycle and achieve synchronization and timing of SDFM filter reads.

    Check the example code below to does PWM synchronization of SDFM.

    <C2000Ware>\device_support\f2837xd\examples\cpu1\sdfm_pwm_sync_cpu\cpu01\

    Regards.

    Manoj

  • Hello again Manoj and thank you for reply

    I have already seen "sdfm_pwm_sync_cpu" example. But does SDSYNC useful in reading the current data of a specific time? If the SDFM is retested by Sync signal at for example t=1s, the data of SDFM should be read after latency of filter + 2~3 clk, to what time does this data belong? is it the value of current at t=1s? or t=1+(latancy of filter)/2 or something else?

    regards

  • Yes, you should be able to time SDFM data filter read with respect to a PWM cycle. t = 0 is considered when PWM provides SDSYNC event to SDFM filter channels. On a SDSYNC event, you need to wait for atleast latency of Sinc filter + 5 SD-Cx cycles inorder to read correct filter data.

    regards,
    Manoj
  • Thanks for reply

    So for reading the current at t=3us after switching happens in inverter, I should do the following(is it correct)?

       SyncSocRegs.SYNCSELECT.bit.EPWM10SYNCIN = 0;     //EPwm1SyncOut

       EPwm10Regs.TBCTL.bit.SYNCOSEL= TB_SYNC_IN;

       EPwm11Regs.TBCTL.bit.PHSEN  = TB_ENABLE;

       EPwm11Regs.TBPHS.bit.TBPHS  = 2;

       EPwm11Regs.TBCTL.bit.PHSDIR = TB_UP;

    this results in synchronizing pwm11 with my switching pwms (pwm 1,2, and 3)

    then I have to set an SDSYNC event for t=5us to reset the SDFM as follows:

        EPwm11Regs.CMPD =TS_PWM_TICKS*0.003;  // This results in an SDSYNC event at t=3us

    then for the following SDFM settings, I have to set another event for reading the filter by setting an interrupt using "EPwm11Regs.CMPA.bit.CMPA" at t=11us  (latency of filter + some SD clocks)

    SD clk=20Mhz , OSR=67, SINC3   ===> latency=10.05 us

    According to your reply, if I am sure that my current is in linear range of modulator, I can use 3 bit shift to increase the resolution instead of 4 bit.

    - Is the above procedure correct?

    - Does it give me the current of t=3us ? Because I thought measuring current using delta-sigma wont give me the current of an exact time and it gives an average of current data which it has collected during a period. (?!)

    Best regards

  • Lio,

    If your DOSR = 67, then the actual OSR setting is 68. Latency of Sinc3 filter, DOSR = 67 is 10.2us. Then you need to add 5 SD-Cx clock period, so add 250ns which means you can read filter result only after 10.2us + 250ns = 10.45us after SDSYNC event.

    Now, if your CMPD event is at 3us, you have to wait for another 10.45us before you trigger CMPA event to read SDFM filter result.

    Digital value observed after 10.45us after SDSYNC event is average of SD-modulated bitstream as it takes into 3 times DOSR samples to provide filtered current data.

    Regards,
    Manoj
  • Thank you Manoj

    That is a bad news that I can't measure the current of an exact instance using SDFM. So, is the averaging process a weighted average? for example if I want to measure the current of t=1s, which instance is the best choice for triggering SDSYNC event and restarting SDFM? Is it t=1-(latency of filter)/2 ? Or t=1 ? which one gives more gain to the data of 1s in the averaging process?

    regards
  • Messi,

    Yes, Sinc filter by its architecture is weighted average filter. Even a regular ADC has acquisition time, so you can't measure exactly at 1s even with ADCs.

    Regards,
    Manoj
  • Dear Manoj,

    What is the routine value for "acquisition time of ADC" ? if I use a "Highly Dynamic MagnetoResistive Current Sensor" which has a very high bandwidth, can I read the current using ADC with a maximum period of 1~2 us?

    regards
  • Hi Lio,

    The minimum total acquisition and conversion latency of the F2837x ADC in 12-bit mode is about 285ns, so it is definitely possible to sample with a period of 1us.

    You may need to increase the S+H portion of that time (minimum 75ns) depending on the impedance and BW of whatever is driving the ADC. Higher impedance and/or lower BW of the driving buffer may require increased S+H time.

    You should also note that the ADC SNR and THD are specified for an ADC input of 100kHz. If the input is moving faster, aperture jitter in the ADC S+H clock (really SYSCLK of the device) will start to noticeably degrade the noise performance of the ADC. You may be able to use a higher BW input if you bypass the PLL and provide a very low jitter clock.