SLYA076 july   2023 TMAG5273

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Liquid Level Sensing Implementations
    1. 2.1 Capacitive
    2. 2.2 Ultrasonic
    3. 2.3 Magnetic Hall-Effect Implementations
      1. 2.3.1 Different Types of Hall-Effect Sensors
      2. 2.3.2 Implementation Option 1: Floating Magnet with Linear Hall
      3. 2.3.3 Implementation Option 2: Floating Magnet with Array of Latches or Switches
      4. 2.3.4 Flotation Device on Axial Arm
  6. 3Functional Demo Design
    1. 3.1 Float Arm
    2. 3.2 GUI Operation
    3. 3.3 3D Printing Part Orientations and Settings
  7. 4Summary
  8. 5References
    1. 5.1 Device Support
    2. 5.2 Related Documentation

GUI Operation

The web GUI for this demo can be found at https://dev.ti.com/gallery/info/PositionSensing/TMAG5x73_LiquidLevelDemo/. You must be logged into your account on dev.ti.com to access the GUI. Click white space anywhere to launch the GUI. The demo can be downloaded for offline use by clicking the download button and selecting the appropriate downloads.

Open the GUI and connect the TI-SCB with the TMAG5273 A1. Navigate to the Registers page and set the following items:

  • (Optional) Set DEVICE_CONFIG_1→CONV_AVG to "101b= 32x Average ..."
  • Set SENSOR_CONFIG_1 → MAG_CH_EN to "0011b = X, Y Channel Enabled"
  • Set SENSOR_CONFIG_2 → ANGLE_EN to "01b = X 1st - Y 2nd" angle calculation
  • Confirm that SENSOR_CONFIG_2 → X_Y_RANGE to ±40mT for A1 EVM/device version.

Then set Auto Read to As fast as possible at the top of the register map page.

GUID-20230501-SS0I-PSG2-HHRW-BTRT8LLJ2KGN-low.pngFigure 3-10 GUI Overview

Next, navigate to the Plots page. The "Liquid Level Demo" tab opens as shown in Figure 3-10.

Below the first plot the window displays the Calculated Angle and Device Angle. The Device Angle is the angle reported by the TMAG5273 device itself which is in increments of 0.25°. The Calculated Angle is the angle calculated from the magnetic field strength of the selected two axis, which for the magnet orientation in the demo is X and Y.

The GUI values are initially configured for our demo setup which used a 4" × 4" × 4" acrylic cube. The 3D printed parts sit over the edge of the water tank so that the magnet and sensor are 39.0 mm from the bottom of the tank. The radius of our float arms are 62.8 mm. For the magnet glued into our float arm, the true angle read by the TMAG5273 is 120°, and it changes by 66 degrees (to 54°) from 0% full to 100% full. All of these parameters can be adjusted to match the end system to account for any size of tank or arm radius. These parameters are illustrated in Figure 3-11. These parameters are used to calculate the tank full percentage as the float rises. It calculates the vertical distance change of the arc the float arm follows as the liquid level rises.

GUID-20230501-SS0I-VVCG-HPVL-JTT9W38F6SCQ-low.pngFigure 3-11 GUI Preset Configurable Parameters

There are configuration controls for the R and Q values of a Kalman filter that is being applied to the data. This is effectively a moving average, and helps account for liquid sloshing in the tank. By default these values are 0.01 for R and 10 for Q, but these can be tweaked as designed for each application. There is a toggle at the bottom to disable the Kalman Filter completely.

Click the ZERO LEVEL button when there is no water in the tank to set the zero location of the float arm. The zero level from one float arm to another can be different depending on how the magnet was installed - the position of the magnet when the system is at the empty liquid level.

Both plots display the liquid level as you add or remove liquid from the tank. Both charts display the same data, but the thermometer-based chart on the right updates slightly quicker and has a large readout of the fill percentage. The GUI can also work as the standard TMAG5273 EVM GUI if you navigate to the Plots tab.