Showing results for 
Search instead for 
Did you mean: 

[MotionAR] Requirements and configuration for STM32F4



Since past few days I am working with MotionAR library to detect activity type using accelerometer. In my configuration Cortex M4F core is used as a main processing unit. During code project development I have come across some mismatch between documentation (UM2193) and provided example in STMCubeMX (MotionAR library version: 3.2.1).

1. According to documentation "required accelerometer data sampling frequency: 16Hz" but frequency 50Hz has been used in provided example - can you explain why 50Hz was utilized according to required 16Hz? Library source code is unavailable so it is hard to determine if higher sampling frequency gives better recongition ratio ...

2. One of function parameter (timestamp) is described as "timestamp is a relative time for actual sample in ms", in function prototype this variable is type of int64_t:

2.1 What happen after (relative) timestamp exceeds variable limit - do I have to manually reset algorithm or just pass 0 (and follow fresh timestamp) if so, how will it impact recognition?

2.2 What happen if negative number will be passed?

2.3 Is there some "windowed" recognition algorith implemented - if yes, how many samples have to be provided in one feeding data block (to restart timestamp value to 0 without recognition impact)?

3. My target project will be using CRC module, but library required this module. What is the impact of MotionAR for CRC? How CRC module it is used and how might it impact my target program which will continuously use CRC module? What type of operation/configuration MotionAR make on CRC peripheral?

4. Can you please explain me what for is used method MotionAR_SetOrientation_Acc(...)? I understand that it set orientation of acceleration axes but what is used for - no specific position of device is required for detection purpose so such configuration does not make sens, if I am wrong please explain me what is it used for?

4.1 Does "nwu" means the same as "enu" or "seu" in case of orientation set? If no, how to determine it properly?

I will be grateful for your answers and hope that my questions are precise enough to present my problems:)

Miroslav BATEK
ST Employee

1. The sampling rate should 16Hz. Higher data rate is possible but 16Hz is preferred.

2.1 The timestamp is 64bit variable and it uses ms, so it will never roll over in our live 🙂

2.2 Negative values are ignored

2.3 We don't share this information but there is Reset function if you want to reset the algorithm.

3. CRC is needed only for Init function.

4. The library is intended for mobile device (i.e. mobile phone) the orientation is partially important. The function is used to align sensor axis with device frame axis. See page 4 of the UM2193.

5. nwu = X to North, Y to West, Z up, enu = X to East, Y to North, Z up ...

Not applicable

Thank you for solving the problem. Really appreciable for the detailed answer.

Thanks again