i2cdevlib icon indicating copy to clipboard operation
i2cdevlib copied to clipboard

? bug 9 Axis Motion Apps 41

Open domenic64 opened this issue 3 years ago • 2 comments

I am using the file MPU6050_9Axis_MotionApps41 converted to python on the mpu9250. In the fifo the data of the magnetometer are incorrect. To have the data of the readings in the fifo I changed this: # setup AK8975 (0x0E) as Slave 0 in read mode AK8963 (0x0C) if self.debug:print("Setting up AK8975 read slave 0...") bus.write_byte_data(self.address, self.MPU6050_RA_I2C_SLV0_ADDR, 0x8C) #8 readmode C address bus.write_byte_data(self.address, self.MPU6050_RA_I2C_SLV0_REG, 0x02) #origin 01 bus.write_byte_data(self.address, self.MPU6050_RA_I2C_SLV0_CTRL, 0xD8) #origin 1101 1010=10byte origine DA In this way on the fifo there are the magnetometer data always updated.

domenic64 avatar Jul 19 '22 13:07 domenic64

The magnetometer only updates every 100ms the FIFO never receives the data and updates at 10ms unless changed there is a library that fuses the Magnetometer with the FIFO data but it is not loaded into the MPU6050 it is a separate file The file is libmplmpu.lib it is a binary file not readable and has several .h files to gain access to the functions. Invensense website has a developer section with all the documentation. Hope this helps. Z

ZHomeSlice avatar Jul 20 '22 05:07 ZHomeSlice

I checked with this modification you get the correct magnetometer data in the fifo. Otherwise they are passed incorrectly. It is necessary to read from reg 0x02 of the magnetometer not from reg0x01. dmp 4.1 makes the 6x quaternion + magnetometer data available in the fifo. the fusion must be worked out externally.

domenic64 avatar Jul 20 '22 06:07 domenic64