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.

TDC7201: TDC7201 average algorithm

Part Number: TDC7201

Hello

Please tell me the average algorithm.
Which of the following?

Add all and divide at the end.    (Simple average)
(data 1 + data 2 + data 3 +_ _ _ _ _ _ _ _+ data n) / n = average n

Average with previous data each time new data arrives.   (Moving average)
(((data 1 + data 2) / 2 + data 3) / 2 + data 4)_ _ _ _ _ _ _ _+ data n) / 2 = average n

regard

  • Hi, 

    I will look at how this is implemented in the GUI LabView source and get back to you tomorrow. 

    Thanks for your patience.

    Regards,

    Gabriel

  • Please see thread 3387537

    In both measurement mode 1 and 2 multi-cycle averaging measurements, TIMEn register values are computed and stored as a simple mean in the TDC720x. The GUI performs the averaging of the CLOCK_COUNTn register values accumulated from measurement mode 2 multi-cycle average measurements, to compute the ToF displayed. 

    Regards,

    Gabriel

  • Thank you for your reply.

    I set the average number of times to 8. It is used in the operation of mode1.
    And I set the start pulse interval to "1 second" and confirmed the operation.
    The interval between the start pulse and the stop pulse is 100nsec.

    After confirmation, Time1-Register was added 8 times.
    It was divided by 8. I think that is, a simple averaging was done.
    The average operation took 8 seconds. It's understandable that it takes an average of 8 seconds, as there are 8 Start pulses at 1 second intervals.

    On the other hand, the "TDC AVG VALUE" displayed on the GUI GRAPH is updated every 1 second instead of every 8 seconds, so is it an instantaneous value?

    Therefore, when logging using the GUI with "mode1, ave = 8", the average of 8 times is not recorded in the log, but the instantaneous value is recorded each time, isn't it?

     

    regards,

  • Hi, 

    If the device is operating with 8-cycle averaging, each individual measurement triggered and displayed in the GUI is an average measurement. 

    You mention "8 start pulses at one second intervals", were you able to verify this with a scope? I recommend probing START, STOP, TRIGGx, and INTBx during the individual measurements for further confirmation.

    Regards,

    Gabriel

  • Thank you for your reply.

    The figure below shows the result of observing the INT1 signal while setting the average number of times to 8 and inputting 8 pairs of Start pulse and Stop pulse pairs in 1 second.

    The INT1 signal goes low every second and is operating normally.
    In contrast, the GUI graph display is updated without waiting for 1 second. In other words, it doesn't seem to be waiting for the average to complete.

    For example, even if "Trigger update freq" is set to 1 sec, the graph update and INT1 signal are not synchronized.
    At 200msec, the graph will be updated without waiting for MESUERMENT COMPLETE FLAG to take effect.

    So, the GUI display value doesn't seem to reflect the average?

  • Hi,

    I would not count on the graph being synchronized with your measurements. It will average the data points that are available at the time it updates based on the AVG/STDEV NUM_ELEMENTS GUI input on the graph tab. However, the data points it uses to display graph data should be the N-cycle average value if you are taking measurements with multi-cycle averaging, as the mode 1 data is already averaged, and mode 2 data is averaged by the GUI. No individual data points of the N measurements taken in multi-cycle average mode will appear in the graph. 

    Regards,

    Gabriel

  • Thank you for your reply.

    In mode1, it is said that the average value is displayed on the GUI, but even if “MEAS_COMPLETE_FLAG” at address 02h remains “0: Measurement has not completed”, the result is displayed on the GUI.

    Here, “DG-645” from “Stanford Research Systems” is used to generate START pulse and STOP pulse.
    https://www.thinksrs.com/products/dg645.html

    The DG645 outputs a pair of start/stop pulses every second for 8 seconds in response to an input from the TDC7201-EVM.
    For 8 seconds, “MEAS_COMPLETE_FLAG” was “0: Measurement has not completed”, but it changed to “1:Measurement has completed” after 8 seconds
    Therefore, I think there is no problem in the experimental environment.

    However, the number on the GUI is continuously changing for 8 seconds.
    Furthermore, the average value displayed has a larger deviation than the value calculated manually. It seems to display a value that has nothing to do with the average.

     
    Could you tell me how to get the average value after “1: Measurement has completed”?


    regards,

  • In this experiment, is the measurement taken over 8 seconds a single 8-cycle average measurement or 8 separate measurements?

    If it is a multi-cycle average measurement, it is not expected to complete until all start and stop pairs are received. i.e. 8 seconds if that is the case. 

    Since reading the data registers is not recommended until after a measurement is complete, I'm not sure how the GUI would handle this case where the measurement is taking longer to complete than the GUI update period. 

    In this case, I would not rely on the GUI graph for averaging your data. For viewing a single measurement in multi-cycle averaging mode, the TOF_ONE_SHOT tab can be used. The information on computing the average with multi-cycle averaging mode is in section 7.4.4 of the TDC7201 datasheet, and for advanced/specific evaluation of the TDC7201-ZAX-EVM, modifying the MSP430F5529LP firmware may be necessary. 

    Regards,

    Gabriel

  • Thank you for your reply.

    It turned out that the values ​​displayed in the graph are not the average values ​​when the low-speed operation is performed in this way.
    When I operated as follows, I was able to read the average value.

    [1] Set "DG-645" that generates Start pulse and Stop pulse to single trigger. Force trigger generated by PC through GPIB.

    [2] Click the "TOF" button

    [3] Read the register values ​​of 10h, 1Bh, 1Ch from the debug tab.
       The initial value is 0

    [4] Add a force trigger from PC for DG-645. One pair of Start and Stop pulses are sent for TDC-7201 EVA.

    [5] Read the register values ​​of 10h, 1Bh, 1Ch from the debug tab.
       The value for one shot is set.

    [6] Add force trigger and send 1 pair of Start and Stop pulses

    [7] Read the register values ​​of 10h, 1Bh, 1Ch from the debug tab.
       The numerical value of the second shot is added.

    [8]    Repeat [6],[7] average times.(8 times)

    [9] "measurement completed" can be confirmed in this state.

    Thank you very much!

  • You are welcome!