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

Why no accel cal?

slowrunner opened this issue · comments

main.py runs a gyro cal, but not an accelerometer cal.
Is there a reason?

I created one and get these results:

Calibrating accel with 1000 points. Do not move!
aX std:16.0 min:298 max:402
aY std:17.0 min:8212 max:8316
aZ std:102.0 min:-512 max:-2

Calibration complete
	X accel offset: 351.5
	Y accel offset: 8267.1
	Z accel offset: -237.2

but I haven't tried factoring the offset into processValues()

                # Subtract the offset calibration values for the accelerometers
                # self.ax -= self.aXcal
                # self.ay -= self.aYcal
                # self.az -= self.aZcal

I have used at least half a dozen different MPU 6050/9250 and have found the accelerometer to be very accurate with no need for calibration. Additionally, to get a true calibration in a lab setting high precision jigs are required, although a level surface or block can also do the trick. That being said, I can create an additional function if you would find it useful.

How did you complete your calibration? Accelerometers do not drift like gyroscopes and in theory the calibration values can be hard coded opposed to being evaluated every time at start up. The Adafruit guide here goes into a little more detail.