- Adjust or fine-tune the sensor hardware to ensure accuracy and minimize the errors.
- Compare the expected output based on the theoretical models or standards with the actual measured output from the sensor.
- Enhance performance, accuracy, and reliability, which ensures that the sensor provides reliable data.
ver registry item increments. For example, if the bias offset in registry item has ver value of 0, then on a successful calibration and registry update, the registry item is updated with the new bias offset and the ver value increments to 1.
The
<registry_path> referred in the following sections should be considered as one of the existing paths on the device: /etc/sensors/registry/registry/ or /var/cache/sensors/registry/registry/.Perform factory sensor calibration
The factory sensor calibration is a process to adjust or fine-tune the sensors during the manufacturing phase.Accelerometer factory calibration
To calibrate the accelerometer sensor:- Run the command while keeping the device stationary on a flat surface.
A test result (
PASS or FAIL) indicates only the test execution status whether the test is completed or not.- The
<registry_path>/qcs6490_rbx_icm4x6xx_0.json.icm4x6xx_0_platform.accel.fac_cal.biasfile is created or updated automatically, and stores the bias offset after the calibration.
Magnetometer factory calibration
To calibrate the magnetometer:-
Obtain the correction matrix (
corr_matrix) and bias scale values (if applicable) for your device from the sensor vendor. -
Set these values in the
corr_matrixsection of the sensor’s platform-specific magnetometer JSON file.
- The
<registry_path>/qcs6490_rbx_navmez_ak991x_0.json.ak0991x_0_platform.mag.fac_cal.corr_matfile is created or updated automatically, and stores the bias offset after the calibration.
Proximity factory calibration
To calibrate the proximity sensor:- Keep an obstacle/object at a required distance (for example, 5 cm or as per the specification shared by the vendor) from the proximity sensor and run the command.
-
Ensure that the test returns a
PASSresult. - This procedure uses 5 cm as the threshold and the distance within the threshold is considered as near and the distance more than the threshold is considered as far.
- The
<registry_path>/tmd3702_platform.prox.fac_calfile is created or updated automatically, and stores the bias offset after the calibration.
Ambient light factory calibration
To calibrate the ambient light sensor:- Confirm the test procedure specified by the sensor vendor and run the command.
- The
<registry_path>/tmd3702_platform.als.fac_calfile is created or updated automatically, and stores the bias offset after the calibration.
Perform runtime sensor calibration
Runtime sensor calibration adjusts or fine-tunes the sensors during their operational phase, rather than during the manufacturing phase. It occurs dynamically while the sensor actively collects the data in the real-world scenarios.Gyroscope runtime calibration
The gyroscope calibration sensorgyro_cal calibrates the gyroscope at runtime.
To calibrate the gyroscope sensor:
-
While keeping the device stationary, request the gyroscope calibration sensor
gyro_caldata for more than 120 sec and then stop. - After executing the command, check the status field in the received event for the calibration accuracy status.
see_workhorse to enable a gyroscope calibration sensor (gyro_cal).
<registry_path>/sns_gyro_cal_persist_sX.bias file (where, X = sensor index) is created or updated automatically, and stores the bias offset after the calibration:
Gyroscope calibration runs approximately for every 60 sec. The gyroscope bias is stored into the registry only after the existing streaming clients for the gyroscope are disabled.
gyro_cal sensor to generate and provide calibration offset/bias. The bias received from the gyro_cal sensor can then be subtracted as shown in the following pseudocode:
Magnetometer runtime calibration
The magnetometer calibration sensormag_cal calibrates the magnetometer at runtime.
To calibrate the magnetometer sensor:
- Bring the device to an open area where there is no magnetic field interference.
- Stream the magnetometer data and move the device in a figure-8 motion for more than 60 sec. Moving the device in a figure-8 motion is mandatory.
- Check the status field in the received event for the calibration accuracy status.
see_workhorse to enable the magnetometer calibration sensor mag_cal.
<registry_path>/sns_mag_cal_persist_sXmY.bias file (where, X = sensor index and Y = device mode index) is created/updated automatically, and stores the bias offset after the calibration.
