Search the Community
Showing results for tags 'offset'.
-
Thanks for the info. I can't understand why the constant value of 36.53 is added to convert degrees C in the code that everyone uses. The data sheet says the offset is -521 and since the sensitivity is 340 per degree c, surely 521/340 = 1.53 ?? Yes, I do see the 35 degrees under Conditions - but this was the test condition that the spec was determined under - right? Why is it (apparently) added to the 1,53 to get the 36.53 ? Thanks Russell
-
I have made an Arduino sketch that simplifies the task of calibrating the MPU6050's offsets. Easy steps: - Wire your MPU6050 to your Arduino. - Put the MPU6050 as horizontal as possible and leave it there, don't touch it. - Check the sketch in order to configure your MPU's I2C address (0x68 or 0x69). - Upload the sketch to your Arduino. - Open Arduino serial monitor and send any character to the Arduino. - Wait. - Write down your offsets for that particular MPU6050 and use them with library's functions "...setoffset..." in your projects. There are also a few options in the code in case you want to fine tune it. There may be bugs, or maybe it does not converge for everyone, so let me know your experience. I use it with an Arduino DUE, configured to 400KHz I2C bus speed, but I think you can use any Arduino and standard bus speed (100KHz). If people find it useful maybe Jeff can add it to the library once it is bugfree. Happy new year. UPDATE 30th January: New version 1.1 available. It fixes a bug related to variables overflowing in Arduinos other than the DUE. MPU6050_calibration_v1.1.zip
- 61 replies
-
- calibration
- offset
-
(and 1 more)
Tagged with:
-
Hey everyone! Thought I'd share my version of an auto-offset calibration sketch; it converges all offsets in about 20s or so. Just upload and watch the serial (at 38400bps)! A note on how it works/converges: - the code takes an initial guess for each offset (supplied at the top of the sketch), takes a certain number of readings from the MPU-6050 (the # of readings it takes is defined by countMax), and averages those number of readings. If that average is less than the value errorCheck, it assumes that axis has converged - if the average isn't less than errorCheck, it will subtract a certain amount from the initial guess - if the errorCheck you set is too small, or the initial guess is smaller than what the solution is, it wont converge - in this case either choose a larger value for errorCheck or a larger initial guess I've given some initial guesses / settings which should help you get to where you need to be; just watch the serial - it'll tell you what the average reading from the MPU-6050 was for each guess, you'll want that average to be as close to 0 as possible for each axis. Enjoy! MPU6050_calibration.zip
-
I am building a head tracker for FPV using the MPU-6050. I need to add a button so that a user can tap it to say essentially 'this is the new center'. I imagine this should be done using the set____Offset functions but for the life of me I can't figure it out. Are the set___Offset functions accepting raw acceleration/gyro values, gravity free accelerations, etc? Sorry if this is a duplicate question, I've tried searching the forums but I'm not even sure I'm using the correct terminology. Thanks!
-
I am building a head tracker for FPV using the MPU-6050. I need to add a button so that a user can tap it to say essentially 'this is the new center'. I imagine this should be done using the set____Offset functions but for the life of me I can't figure it out. Are the set___Offset functions accepting raw acceleration/gyro values, gravity free accelerations, etc? Sorry if this is a duplicate question, I've tried searching the forums but I'm not even sure I'm using the correct terminology. Thanks!