2023-02-10 12:23 PM
Hi,
I'm facing several problems while using the MEMS1 package. I have designed a custom board with the L552 mcu and LSM6DSO32 and LIS3MDL sensors on the same SPI bus. The board has a WiFi connectivity, an SD card and a plethora of user IO. The firmware is written in C++ (no STL, no RTTI, no exceptions) and uses ThreadX. All of the ThreadX functionalities are wrapped into thin classes. My goal is to estimate a 3D orientation using MotionFX. I'm also using MotionMC and MotionAC and the results of calibration are stored on the SD card. I'm using the latest CubeIDE.
I first tried to follow the written instruction in UM2182. Then I tried to follow the graphical instructions. I found those to be quite different, yielding different orientations but whatever. Then I tried to run the 6 point tumble. Again no success, until I found some thread on this forum where the op said that the input to the MotionAC_Update function should in fact be an array of 6 MAC_input_t structs. I tried this approach and it worked somehow - I don't have any means of validating the results yet. Why isn't this explained in the guide? Can someone please explain it to me? One curious thing is that this method works even without setting the timestamp variable (which one of the 6 point should hold the timestamp anyway? all of them? first one? the same timestamp?).
2023-03-06 11:35 PM
2023-03-06 11:59 PM
Above mentioned example datalog formats will help me to simulate your data in our application and see if the problem is in your data (HW) or in your code.
BTW in X-CUBE-MEMS1 v9.6.0, which should be released in about a month or slightly more, you'll find the MotionFX and MotionMC libraries corrected in terms of visibility of variables and functions. Then you should be able to combine them in one application.
2023-03-07 10:14 PM
I went through my IMU initialization code and found that I left the Gyro's HighPass filter on from the previous project, which didn't really require the Gyro - so no problems observed there. Then I had to dig deeper into the Application note to see the HP filter settings and I of course did not follow these steps in my fusion project - didn't know about the App note. The HP is a FIR filter, I suppose, and a pretty large one (lot of bins), I suppose. The Application note states that the HP filter requires up to 45s for its output to reach 99% of the final value (page 13, table 13). A FIR filter this long would produce a significant phase delay (which again is not addressed in either the Datasheet or App. note) which can distort the measurements. This information should be present in the Datasheet I believe.
As for the data logs - I found a problem with my data visualization application and it needs addressing first. I will post these Logs later, but I managed to get it working at a decent level.
2023-03-07 11:55 PM
No need to send datalogs if it will more or less work after all your fixes