mhickman Posted February 19, 2014 Report Share Posted February 19, 2014 We have some Arduino MEGA 2560-based boards with an on-board MPU-6050 at the default I2C address 0x68. i2cdevlib is extremely helpful (thank you Jeff!), except we can't seem to generate offsets that zero the sensor outputs. I've been using luisrodenas' Arduino sketch, which he posted in this forum recently, to calculate MPU6050 offsets. I modified the output to print the mean (2000 samples in this case) of the sensor outputs and the revised offsets calculated based on those mean values each time through the loop. The full data is attached and I've included a sample from gyro_z below. As you can see, the offsets change to try to move the mean values to zero. The sensors outputs seem to resist this adjustment, then at some offset threshold, the sensor values jump way past zero. This cycle then repeats. Only the gyro_y value responds as expected. Does anyone have any ideas what could be causing this? I've verified this on several PCBs, so it doesn't seem to be a bad MPU. I saw similar results setting offsets manually, so I don't think the issue is in the calibration sketch. Thanks, Mike MPU6050 connection successful Reading sensors for first time... Calculating offsets... Configuration: buffersize=2000 acel_deadzone=16 giro_deadzone=2 mean_gz gz_offset 492 140 931 -170 -93 -139 -89 -110 -88 -81 -89 -52 -88 -23 -89 6 934 -305 -1112 65 934 -246 -89 -217 -89 -188 -89 -159 -89 -130 -88 -101 -89 -72 -89 -43 -89 -14 -89 15 934 -296 -1113 75 output.txt Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted February 20, 2014 Report Share Posted February 20, 2014 So wierd... Could you attach the same sketch you are running? I will try to reproduce the error in my mega. I guess you haven't changed anything in the library, have you? What board is it? Do you have an schematic? Quote Link to comment Share on other sites More sharing options...
mhickman Posted February 20, 2014 Author Report Share Posted February 20, 2014 Luis, thanks for the offer of assistance. In pulling together the files for you I found the problem. Before zipping the files I decided to pull down a fresh copy of the i2cdevlib and diff my I2Cdev and MPU6050 files against it. Apparently I had somehow installed the older 2013-05-05 I2Cdev on my system. I swapped in the 2013-05-06 (current) version and everything worked as advertised. Thanks again, Mike Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.