PhilippMolitor / waveshare-rp2040-roundlcd-boilerplate

A PlatformIO project to get started with the Waveshare RP2040 with the 1.28" round LCD display. Includes a driver for the IMU, as well as a display driver implementation with LovyanGFX.
20 stars 9 forks source link

AttitudeEngine #2

Open LazaroFilm opened 1 year ago

LazaroFilm commented 1 year ago

Has anyone manage to get the AttitudeEngine working?

PhilippMolitor commented 1 year ago

I had a look at the datasheet describing the AttitudeEngine, but as I am not very fond of the purpose it fulfills I didnt bother implementing it.

It should not be too hard to implement tho. If you would try to do that, I would

Please feel free to try it and submit a PR! :)

LazaroFilm commented 1 year ago

I've been trying to activate the AttitudeEngine, but the bits referring to the quaternion don't return anything, no matter what settings I try.

PhilippMolitor commented 1 year ago

Can you describe what registers you tried to modify in order to set up the IMU configuration?

LazaroFilm commented 1 year ago

Reg7 to 0b00001011 / 0x0B as per p29 and 33 of data sheet (CTRL7, sEN =1, aEN=1, gEN=1) them read the quaternions at 0x49 to 0x50 p38 of data sheet

Edit: I also tried different values for Reg6 still get all zeros on que quat.

PhilippMolitor commented 1 year ago

Hmm, that is indeed weird. I didn't find too much precise information on how to switch to AE mode from normal mode, but i saw this table:

image

Did you go through this table as well? Also, did you check if you still get updated "normal" IMU data with your current register setup? If so, seems like something is not enabled quite right yet. If not, AE probably lacks some setup params to get running properly..

PhilippMolitor commented 1 year ago

Also, did you set the ODR for AE mode? I had a look at the waveshare example driver, they have a function to set it up (up to 128Hz) or a last value for MoD mode. I think it wouldnt start measuring values unless provided with an AE ODR configuration.

LazaroFilm commented 1 year ago

I did go through that chart (I actually printed it because I was done scrolling it). I'm still getting Acc and Gyro values so indeed something is aloof. I'm now trying with the Touch version of the board (the other one.. fell down...) using WaveShare's demo code and modifying it. But I'm not getting any results. I'm starting to lose hope...

PhilippMolitor commented 1 year ago

I am sure we are just missing on a very small detail, like setting one specific register. Unfortunately I am not able to work on this code myself at the moment. I will try to think on it though! Maybe I can have a look at the datasheet soon again, and maybe work out a strategy. At this point, I am not even sure anymore if AE mode runs parallel to the normal mode or if it replaces it.