Interface LSM303AGR Acceleration sensor STM32F4xx Board
조회 수: 15 (최근 30일)
As part of my master thesis, I am working on the STM32F411E Discovery board. This board has an LSM303AGR Accelerometer+Gyroscope via I2C communication, which I am trying to interface in Simulink to further develop a model in Simulink.
I have installed the STM Embedded coder support package however this doesnt have a block to get acceleration sensor data. I tried to look up how to interface an IMU sensor in Simulink however I could not find a tutorial that would fit my case. Has anyone worked on accel sesnsor fusion for STM board who could help me in the same. I have found various posts on the community regarding this but seems to be unsolved, posts dating back to 2016 even. It would be very useful if anyone could finally solve this sensor interface.
Thank you so much in advance for all the help.
Sebastian Gross 2023년 8월 30일
it is almost impossible to provide a block for every sensor for every target hardware.
There is an example for I2C communication with LSM303AGR on Arduino: https://www.mathworks.com/help/fusion/ug/estimate-oientation-using-ahrs-filter-and-imu-data-in-simulink.html. You might have seen this one. Do you have the corresponding I2C read block for your hardware plattform?
There are also ways to develop your own device driver block: https://www.mathworks.com/help/supportpkg/arduino/device-driver-blocks.html. This would result in a block like the LSM6DSL block in the example I listed above.
Did you try those approaches?
Sebastian Gross 2023년 9월 1일
just to make sure that things are running without external mode, can you turn it off: