Arduino script for MPU-6050 auto-calibration

I while back I did some work on a self-balancing robot using and Arduino Uno and the InvenSense MPU-6050 6DOF sensor. Using the sensor is easy, thanks to Jeff Rowberg's  I2Cdev library and sample code.  If you look around line 200 of the MPU6050_DMP6 example arduino sketch that comes with the library you will see the following: // supply your own gyro offsets here, scaled for min sensitivity mpu.setXGyroOffset(220); mpu.setYGyroOffset(76); mpu.setZGyroOffset(-85); mpu.setZAccelOffset(1788); // 1688 factory default for my test chip I did some further reading on the I2CDev forum and found several threads on calibrating the MPU-6050 sensor and…continue reading →

An Arduino self-balancing robot: working prototype

I spent some time reading on accelerometers, gyros, sensor fusion, PID, optimized PWM motor control. I tinkered with the components I have for a while and then procrastinated for even longer. Finally, I can say that I have a prototype of a self balancing bot that shows promise. fine-tuning is needed, and I plan to add a Bluetooth module to get PID controller data wirelessly, possibly to adjust the PID coefficients in real time and, hopefully to steer the bot remotely someday. (more…)