cancel
Showing results for 
Search instead for 
Did you mean: 

FSM#13: How to… test your FSM: basic PEDOMETER, the last algorithm example - Part 1

Eleon BORLINI
ST Employee

This example describes how to set up a finite state machine to enable the built-in detection of a basic PEDOMETER. The picture here below shows the first part of the dedicated FSM code (tomorrow the second and last part will be published). A human step pattern is composed from a first step, than a debounce phase and finally another step phase. The purpose of this part code is to detect the first step and the debounce phase steps. Note that thresholds and timers are finely tuned. In attachment you can find the state machine code to upload on your Unico tool.

Input data are the axl output stream (select ODR >= 26Hz)

Masks selects as interesting orientation the overall resultant v+ (MASK_C=0x02),

Thresholds are set to 1.1g (TH1) and 1.2g (TH2)

Timeout have been selected and tuned as 3sec (short counter, TI3) and 0xFFFF (long counter, T4)

Output of this section of the code is when a step and a debounce phase steps are detected

Enjoy!

0690X000006DPmqQAG.jpg

Link: https://www.st.com/content/ccc/resource/technical/document/application_note/group0/56/95/d6/a1/34/4c/49/6d/DM00517282/files/DM00517282.pdf/jcr:content/translations/en.DM00517282.pdf

0 REPLIES 0