2024-12-20 06:54 AM
Hello Team ST and Community,
I have following code for step count for our wrist-based device. We use LSM6DSO IMU.
The step debounce threshold has improved the step count accuracy. It is currently set to 20. But, I could not get rid of the false positives. It also counts steps when I am typing on a keyboard and other minor movement when it exceeds step debounce threshold (e.g. typing more than 20 characters will start step count).
I tried setting delta time period to mitigate this issue but it does not help a lot.
Therefore, I have two question.
1. Am I programming delta time period correctly? My understanding is that a step interrupt would be generated if a step movement happens between 256ms and 512ms as shown in the code. Please correct me if I wrong.
2. How can I reduce false positives from minor movements? The false rejection advanced mode option is not that accurate to reject minor movement.
Thank you,
Aakash.
//Step counter interrupt
lsm6dso_pin_int1_route_get(&imu_dev_ctx, &int1_route);
int1_route.fsm_int1_a.int1_fsm1 = PROPERTY_ENABLE;
int1_route.emb_func_int1.int1_step_detector = PROPERTY_ENABLE;
lsm6dso_pin_int1_route_set(&imu_dev_ctx, &int1_route);
//Enable step counter
lsm6dso_pedo_sens_set(&imu_dev_ctx, LSM6DSO_FALSE_STEP_REJ_ADV_MODE);
//Get Steps
void GetImuSteps(uint16_t *steps)
{
lsm6dso_number_of_steps_get(&imu_dev_ctx, steps);
}
//Set the sesitivity
void lsm6dso_sensitivity(void)
{
//Set the debounce steps
uint8_t deb_step = 0x14U; //corresponds to 20 steps
lsm6dso_pedo_debounce_steps_set(&imu_dev_ctx, &deb_step);
uint8_t delay_time[2] = {0x28U, 0x50U};
//Lower Limit is 40(28 in Hex) and Upper Limit is 80(50 in Hex) [40*6.4ms = 256ms] [80*6.4ms = 512ms]
lsm6dso_pedo_steps_period_set(&imu_dev_ctx, &delay_time);
}
2025-01-03 05:15 AM
Hi @ASoni.2 ,
You can find more details in section 6.1 of AN5192.
If you want to use “LSM6DSO_FALSE_STEP_REJ” or “LSM6DSO_FALSE_STEP_REJ_ADV_MODE,” you also need to enable the “PEDO_ADV_EN” bit, otherwise the mode is not active, as indicated in AN5192 and shown in the example at the end of the section.
I suggest using “LSM6DSO_FALSE_STEP_REJ” instead of “LSM6DSO_FALSE_STEP_REJ_ADV_MODE.”
The pedo_sc_deltat feature acts only on the interrupt generation and not on the number of steps counted. It actually is used to reduce the number of interrupt signals, since they are generated only if at least one step has been detected in a certain amount of time: