You are reading a single comment by @HughB and its replies. Click here to read the full conversation.
  • Why there need to be a threshold on the raw M input

    Place the watch on a table and you will still see some raw m signal from the accelerometer:

    523593,6,0
    523673,4,0
    523754,4,0
    523833,6,0
    523913,6,0
    523993,8,0
    524073,9,0 PEAK
    524153,6,0
    524233,5,0
    524357,5,0
    524393,4,0
    524473,5,0
    524553,6,0
    524633,7,0
    524713,7,0
    524793,8,0 PEAK
    524873,7,0
    524953,6,0
    525033,8,0 PEAK
    525113,5,0
    525193,2,0
    

    This signal has PEAKs. When using PEAK detection it means that the step state machine will get called from very small movements - EG when sat on a sofa.

    I have flashed 2.10.13 and am testing against 3.11.
    15 mins sat on the sofa the FW has done 13 steps and 3.11 has done 6 steps.
    The difference is that the FW has no minimum raw threshold that must be reached before
    we take the filter output.

    3.11 has this bit of code :

    
      if (raw_clipped > RAW_THRESHOLD || raw_clipped < -1*RAW_THRESHOLD) {
        if (active_sample_count < N_ACTIVE_SAMPLES)
          active_sample_count++;
        if (active_sample_count == N_ACTIVE_SAMPLES)
          gate_open = true;
      } else {
        if (active_sample_count > 0)
          active_sample_count--;
        if (active_sample_count == 0)
          gate_open = false;
      }
    
      if (!gate_open)
        accFiltered = 0;
    
    
    

    What this code is doing is saying is the raw m value bigger than room noise for more than 3 samples.
    The raw threshold is set to +-10. And to take the filter output the ABS(input) must be greater than the threshold (10) for about 1/4 of a second. This is necessary otherwise PEAKs in the chip noise or noise from the ground get passed into the state machine. We want to definitely moving before we start calling the state machine.

    I'm convinced this concept is needed AND it can also be one of the parameters we use to TUNE the step counter against the accellog recordings.

About

Avatar for HughB @HughB started