Volume Flow Rate Calibration
============================

Volume Flow Rate (VFR) calibration functionality in the library is enabled by providing Meter VFR calibration data via the ``USS_config\USSMeterVFRCalib.h`` file. For more details regarding recommended procedure to obtain Volume Flow Rate calibration data please refer to the `Ultrasonic Desing Center Quick Start Guide <http://www.ti.com/lit/pdf/slau720>`__

The image below shows which slope and offset will be applied to each calibration zone. If alphaMin (pre-calibrated volume/ default volumeScaleFactor) falls outside the calibrated regions. The library will not run the calibration and the non-calibrated volume computation will be returned by the library. In addition, the library will report an error to let the user know there was a valu that fell outside the calibration zones.

.. figure:: images/MC_VFR_Calibration_Concept.png
   :alt: MC\_VFR\_Calibration\_Concept

   MC\_VFR\_Calibration\_Concept

Enabling VFR calibration on USS SW Library configuration file 2\_20 and later
-----------------------------------------------------------------------------

-  In ``USS_Config\USS_userConfig.h``

   -  Set

      -  ``#define USS_ENABLE_VFR_METER_CALIB                true``

-  In ``USS_Config\USSMeterVFRCalib.h``

   -  Define USS\_VFR\_METER\_CALIB\_RANGES

      -  Min: 1
      -  Max: 16

   -  Define USS\_VFR\_METER\_CALIB\_DATA

      -  alphaMin must be sorted from lowest to highest value
      -  Number of entries for USS\_VFR\_METER\_CALIB\_DATA must match USS\_VFR\_METER\_CALIB\_RANGES

Enabling VFR calibration on USS SW Library configuration file earlier than 2\_20
--------------------------------------------------------------------------------

-  Replace your projects ``USS\_Config\USS\_userConfig.c`` with the ``<USS_SW_LIB_2_20_xx_xx_INSTALL_DIR>\examples\USSSWLib_template_example\USS_Config\USS_userConfig.c``
-  In your ``USS_Config\USS_userConfig.h``

   -  Define under "LIBRARY METER CONFIGURATION" section

      -  ``#define USS_ENABLE_VFR_METER_CALIB                true``

-  Copy ``<USS_SW_LIB_2_20_xx_xx_INSTALL_DIR>\examples\USSSWLib_template_example\USS_Config\USSMeterVFRCalib.h`` in your project USS\_Config directory.
