2021-05-24 03:24 AM
Hi,
I am trying to perform a 6-point tumble calibration for my LSM9DS1 accelerometer. The returned output data from the MotionAC_Update is always as follows:
The "is_calibrated" parameter is always 0, indicating the accelerometer is not calibrated.
The initialization is done the following way:
void cal_init(MAC_output_t start_accel_bias){
/*** Initialization ***/
char lib_version[VERSION_STR_LENG];
MAC_knobs_t Knobs;
/* Accelerometer calibration API initialization function */
uint8_t enable = 1;
MotionAC_Initialize(enable);
MotionAC_GetKnobs(&Knobs);
Knobs.Run6PointCal = 1;
Knobs.Sample_ms = REPORT_INTERVAL; //REPORT_INTERVAL=20 [ms]
Knobs.MoveThresh_g = 0.15;
(void)MotionAC_SetKnobs(&Knobs);
/* Optional: Get version */
MotionAC_GetLibVersion(lib_version);
}
To perform the calibration, the following is executed at a frequency of 50 Hz (every 20 ms):
MAC_input_t data_in;
MAC_output_t data_out;
float acc_cal_x, acc_cal_y, acc_cal_z;
/* Get acceleration X/Y/Z in g */
//MEMS_Read_AccValue(data_in.Acc[0], data_in.Acc[1], data_in.Acc[2]);
IMU_getData(&imu, &data, 1);
data_in.Acc[0] = data.x_acc;
data_in.Acc[1] = data.y_acc;
data_in.Acc[2] = data.z_acc;
data_in.TimeStamp = timestamp * REPORT_INTERVAL;
/* Accelerometer calibration algorithm update */
uint8_t is_calibrated;
MotionAC_Update(&data_in, &is_calibrated);
/* Get Calibration coeficients */
MotionAC_GetCalParams(&data_out);
Also, I have attached a csv file with several readings of timestamp and each axis. Have in mind it was done for one of the points, with the Z-axis pointing upwards.
What might be the problem? Thanks in advance.
2021-05-31 12:49 PM
Hi Pedro,
Your attached ACC data and time stamp seems reasonable so what I need from you now is the data recorded from one of your complete 6-position calibration trials to replicate/analyze your issue and find the root cause.
Best regards,
Petr
2021-05-31 12:57 PM
During the calibration make sure you always hold your device on the table in each of the 6 positions for at least 2 seconds without any movement (almost stop breathing :smiling_face_with_smiling_eyes:). Never hold it in your hand in the air only because the movements are too high even if not visible.
2021-06-07 08:56 AM
Hi, Petr,
I guess that I misinterpreted the instructions on the MotionAC User Manual. It turns out that each calibration needs the six positions of the IMU.
What I was doing was calibrating each point separately. Now I can get the bias values.
Thank you for your answer.
2021-06-07 08:46 PM
I'm glad you solved it, Pedro.
2024-04-24 04:43 AM
Can you make it clear ! I'm also not getting it. Did you get both bias and scale factor?