MarkSherstan / MPU-6050-9250-I2C-CompFilter

MPU6050/9250 I2C and SPI interface. Sensor fusion using a complementary filter yields sensor Euler angles and is implemented in five different languages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

madgwickFilter params

Ongoza opened this issue · comments

Hi Mark!

You did a good job ;) but looks like something wrong with madgwickFilter in 9DOF/main.py
mx = mpu.my and my = - mpu.mx
Please add notes to your code - i thought it was mistake
// Sensors x (y)-axis of the accelerometer is aligned with the y (x)-axis of the magnetometer;
// the magnetometer z-axis (+ down) is opposite to z-axis (+ up) of accelerometer and gyro!

You can also improve your code when read raw data:

  1. replace

for ii in range(7):
rawData.append(self.bus.read_byte_data(self.MPU9250_ADDRESS, self.EXT_SENS_DATA_00 + ii))
by "rawData = self.bus.read_i2c_block_data(self.MPU9250_ADDRESS, self.ACCEL_OUT, 14)"

  1. and add try/except block - sometime self.bus.read return error while try to read raw data

Thank you for the feedback! I tested and made the changes in commit 364fff7.