@HughB do we actually have a minimum threshold for triggering steps, or is it any peak at all now?
We do. There is a mimum scaled raw value of +-14 that has to be crossed for 3 samples before we start taking the output of the filter. The output of the filter then goes through peak detection and after that the state machine.
These values are defined in stepcount.c as:
// In periods of 12.5Hz
[#define](https://forum.espruino.com/search/?q=%23define) T_MIN_STEP 4 // ~333ms
[#define](https://forum.espruino.com/search/?q=%23define) T_MAX_STEP 16 // ~1300ms
[#define](https://forum.espruino.com/search/?q=%23define) X_STEPS 6 // steps in a row needed
[#define](https://forum.espruino.com/search/?q=%23define) RAW_THRESHOLD 14
[#define](https://forum.espruino.com/search/?q=%23define) N_ACTIVE_SAMPLES 3
If you observe the x.y.z values when the watch is on a static flat surface you will sometimes see scaled raw values up to approx +-8 but the average over time is zero.
I ran various configs of RAW_THRESHOLD, N_ACTIVE_SAMPLES, X_STEPS against the test harness and in practice and what we ended up with was the best result.
I guess the next step might be we could record the accelerometer data from your watch and then >play it back through the algorithm here to see why it's triggering steps.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
We do. There is a mimum scaled raw value of +-14 that has to be crossed for 3 samples before we start taking the output of the filter. The output of the filter then goes through peak detection and after that the state machine.
These values are defined in stepcount.c as:
If you observe the x.y.z values when the watch is on a static flat surface you will sometimes see scaled raw values up to approx +-8 but the average over time is zero.
I ran various configs of RAW_THRESHOLD, N_ACTIVE_SAMPLES, X_STEPS against the test harness and in practice and what we ended up with was the best result.
Yes - I think we need to do this.