Follow

Converting raw 16-bit ADC values to physical values

To calculate the physical quantity from the 16-bit decimal values, please refer to the MTi User Manual (https://documentation.xsens.com/mti_user_manual), section entitled "Physical sensor model".
 
Please note that the basic model is missing some higher order modeling, including g-sensitivity and temperature dependent gain. These higher order terms are proprietary to Xsens and done on-board the sensor or with the Xsens API on the host processor. In addition, the simple model does not include the coning and sculling compensation done by the sensor. It is preferable to use the processed and calibrated data from the sensor or made available in Xsens Device API (XDA) processing on a host processor.  However if you understand the drawbacks of only using this simple model and wish to proceed, the following MATLAB example demonstrates the use of the simple model to obtain physical values from raw data.
 
First, the calibration parameters for the accelerometers is shown on a MTi-30 sensor:
 
 
These parameters can be accessed in MT Manager by clicking the MT Settings button and clicking the Modeling Parameters page.
 
For the purposes of this example, this particular MTi-30 sensor was placed level and at rest, and a single data point of raw acceleration and gyro 16-bit ADC values were measured. These raw 16-bit ADC values were are stored in the vectors acc_raw and gyr_raw. The code follows the equations given in the MTi User Manual section entitled "Physical sensor model" to convert the raw data points to physical values:
 
% Convert a single measurement of raw 16-bit ADC values to physical values
 
% Misalignment matrix
A_acc = [1.00001 0.00661655 0.00826223; -0.0050806 1.00003 0.00670856; 7.98614e-5 0.0118734 0.999999]
A_gyr = [0.999992 0.00869692 -0.00666423; 0.00577428 0.999916 -0.0154321; 0.00163453 0.00685233 1.00003]
 
% Bias vector
b_acc = [32807.1; 32827.1; 32715.6]
b_gyr = [32486; 32556.8; 32632.3]
 
% Gain matrix
G_acc = [134.474 0 0; 0 134.547 0; 0 0 134.096]
G_gyr = [2992.69 0 0; 0 3002.62 0; 0 0 2976.02] 
 
Kinv_acc = inv(G_acc*A_acc);
Kinv_gyr = inv(G_gyr*A_gyr);
 
% Measurements while sensor sitting still
acc_raw = [32812; 32824; 34034]
gyr_raw = [32540; 32568; 32711]
 
% Convert to physical quantities
acc_phys = Kinv_acc*(acc_raw - b_acc)
gyr_phys = Kinv_gyr*(gyr_raw - b_gyr)
 
 
The resulting physical accel values (in m/s^2) are:
   -0.0442
   -0.0892
    9.8328
 
And the resulting gyroscope values (in rad/s) are:
    0.0182
    0.0040
    0.0264
Was this article helpful?
0 out of 0 found this helpful
Do you have a question? Please post your question in our Community Forum