I currently have the no motion interrupt working fine as long as the duration is set to around 10 seconds or below, if i set the duration any higher than this there seems to be some sort of offset being applied causing a duration setting of 60 seconds to trigger at around 6 miniutes. So really im just abit confused about the maths used for the duration setting, I had a read of the data sheet and found the stuff relating to the slow/no motion duration delay equations however i couldnt really make much sense of it in all honesty.
My IMU is currently set up like:
power mode: Normal
I would greatly appreciate any help to aid my understanding of the maths involved/issue if there is one, surrounding this.
Thank you in advance!
Solved! Go to Solution.
The following suggestions hope will be helpful with your question:
1.The no motion interrupt is generated when the slope on all selected axis remains smaller than a programmable threshold for a programmable time.
so, threshold and duration time should be configured. What is the threshold in your experiment?
2. Be sure no external vibration.
3. Please upload your log file.
Thank you for your reply.
I can confim there is no external vibration and my current test consists of starting the interrupt then dropping the device on the table and leaving it until the interrupt triggers. Currently my no motion interrupt is set up like this:
// Configure interrupt
bmi160int.int_channel = BMI160_INT_CHANNEL_2;
bmi160int.int_type = BMI160_ACC_SLOW_NO_MOTION_INT;
bmi160int.int_pin_settg.output_en = BMI160_ENABLE;
bmi160int.int_pin_settg.output_mode = BMI160_DISABLE;
bmi160int.int_pin_settg.output_type = BMI160_DISABLE;
bmi160int.int_pin_settg.edge_ctrl = BMI160_ENABLE;
bmi160int.int_pin_settg.input_en = BMI160_DISABLE;
bmi160int.int_pin_settg.latch_dur = BMI160_LATCH_DUR_NONE;
bmi160int.int_type_cfg.acc_no_motion_int.no_motion_sel = BMI160_ENABLE;
bmi160int.int_type_cfg.acc_no_motion_int.no_motion_x = BMI160_ENABLE;
bmi160int.int_type_cfg.acc_no_motion_int.no_motion_y = BMI160_ENABLE;
bmi160int.int_type_cfg.acc_no_motion_int.no_motion_z = BMI160_ENABLE;
bmi160int.int_type_cfg.acc_no_motion_int.no_motion_dur = 40;
bmi160int.int_type_cfg.acc_no_motion_int.no_motion_thres = 20;
// Add interrupt
err_code = bmi160_set_int_config(&bmi160int, &sensor);
With this setting the interrupt is reliably going off after being still for around 3 minutes and 10 seconds.
Sorry to double post but i believe I have sorted my problem by having a more detailed read through of the data sheet and look through the bmi160 code hosted on github. I noticed that there are only 6 bits used for the duration and combined with the different tick times of 1.28, 5.12 and 10.24s explains why im getting weird times as a settign of 40 using a tick time of 5.12 would mean it triggering after around 3 mins. Unfortunately this means the max duration time i can have is around 7 mins, which wont work for my intended use so I will have to come up with a custom way of detecting no motion.
Many thanks for your assistance.