TIDA-010243: Calibrator source code

Part Number: TIDA-010243

Tool/software:

Hello dear members of the staff,

i am trying to porting metrology library in my own board, which should be a 3 phases energy meter, i have integrated the metrology library into my code, and now i am using the default calibration values that are embedded in metrology library. I have seen that there is a software that comes with this library, specifically designed for some reference design, that performs calibration of some internal values. It is possible to have source code of this calibrator, to better understand how the calibration process for energy metrology library works?? The documentation doesn't go so deep, so i would like to give a look to the code.

Thanks

Kind Regards

Emanuele Peruzzi

  • Hi Emanuele,

    The GUI is taken from here (https://www.ti.com/tool/ADC-ENERGY-METROLOGY-LIB-SW), unfortunately I can't provide the source code for the GUI.

    For the process flow, it will take the user inputs to the calibration parameters from the GUI and send it to the device via UART. For different calibration statistics it will apply a different mathematical function based on a linear relationship.

    Offset is the Y-intercept, a direct addition or subtraction is applied to the measurements.

    Gain (values in Red) is the slope, a multiplication scaling factor is applied to the measurements.

    Phase calibration is a time constant added to the phase between your current and voltage measurements.

    Energy Metrology User's Guide

    Regards,
    Luke

  • Ok,

    thank you, just to speed up my porting of the metrology library to my f280049 device, while i am trying to better understand the source code, can you confirm that all the calibration performed by this calibrator, are relative to, and only to:

    - offset

    - phase

    - gain

    of each channel?? And that no other calibration is done by the calibrator through GUI?

    If i want to reset all calibration factors to zero, not default values, can i set all parameters in "metrology-calibration-template.h" to 0 ??

    Thank You

  • Hi Emanuele,

    The template.h has the default values. 0 would work for offsets, but if you do 0 for scaling factor you will get 0 for your readings.

    Regards,,
    Luke

  • Hello Luke,

    that makes perfectly sense, just to clarify, an example of manual calibration of 2 signals:

    According to TIDA-010243 manual, paragraph 4.2.5, i should use an accurate AC test source and a reference meter to perform calibration.

    For example, for a single phase, i have noticed that changing inside nv_parms struct the variable V_rms_scale_factor, it has effect on working_data.phases[0].readings.fundamental_V_rms. Should i adjust V_rms_scale_factor until the value in fundamental_V_rms matches the one reported in the metering instrument?

    I have another question: why the variable V_rms_scale_factor makes effect on fundamental_V_rms, and the variable I_rms_scale_factor has effect only on I_rms variable (and not on fundamental_I_rms)

    Should this be the correct method, or am i completely wrong?

    Kind Regards

    Emanuele Peruzzi

  • Hi Emanuele,

    In the DLT645 file is where the communication with the GUI happens. In here there is a "DLT645_setPhaseCalibrationData" function which updates all the relevant variables with the calibration data. You can get a full list of the changed parameters as calibration is a per-phase change.

    Fundamental Current is being calculated in the inverse of the power function with the equation I = P/V. It uses fundamental voltage and fundamental apparent power.

    A accurate AC source needs to be used as your reference for calibration because your accuracy can only be as good as your input. If your input is 5% off then you can't guarantee to be better than the 5%.

    Unsolicited Code Composer Studio Tip: CTRL+H can help you search the whole project, useful for finding instances of variables when they span multiple files.

  • I have finished questions for now, thanks for supports and clarifications, they really helped me avoiding headaches.

    Thanks

    Kind Regards

    Emanuele Peruzzi