How to improve step count or pedometer accuracy?
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);
}
