Difference between revisions of "MPU6050"

From RobotinoWiki
Line 7: Line 7:
 
==Scale==
 
==Scale==
 
When the robot rotates 360° the integration of the gyroscope readings should give us also 360° of measured rotation. This only is true when the gyroscope signal is scaled precisely. The gyroscope has an error of +-2% on the signal scale, i.e. the worst case would be that Robotino rotates 360° and we measure 353°. To compensate for scale errors you can run the ''gyrocal'' program on Robotino.
 
When the robot rotates 360° the integration of the gyroscope readings should give us also 360° of measured rotation. This only is true when the gyroscope signal is scaled precisely. The gyroscope has an error of +-2% on the signal scale, i.e. the worst case would be that Robotino rotates 360° and we measure 353°. To compensate for scale errors you can run the ''gyrocal'' program on Robotino.
 +
 +
==gyrocal==
 +
Use putty to log into Robotino. If not logged in as root directly do
 +
<pre>
 +
sudo su
 +
</pre>
 +
to become root.
 +
 +
Put some tape on the floor and align Robotino so that you can find the starting rotation again.
 +
[[image:gyrocal_start.jpg]]
 +
<pre>
 +
</pre>

Revision as of 10:18, 12 August 2014

Introduction

Robotino3 is equipped with a gyroscope mounted on the internal I/O-board. The gyroscope is a MPU6050. MEMS gyroscopes in general have two major problems. These are drift and scale.

Drift

When the gyroscope is not rotated the output signal should be zero. Unfortunately the gyroscope produces small random output signals even if not rotated. These random signals are called drift. On Robotino we now pretty well when the robot and therefor the gyroscope is not rotated. This is the case when the encoders from all three drive motors output 0. 500ms after we read zero from the three encoders we store the current output signal of the gyrosope and subtract this stored value from all gyroscope signals measured later. This ensures that the gyroscope signal is zero when the robot is not rotating. This also means that you can fool this mechanismn of drift compensation by taking up Robotino and rotate it without rotating the wheels.

Scale

When the robot rotates 360° the integration of the gyroscope readings should give us also 360° of measured rotation. This only is true when the gyroscope signal is scaled precisely. The gyroscope has an error of +-2% on the signal scale, i.e. the worst case would be that Robotino rotates 360° and we measure 353°. To compensate for scale errors you can run the gyrocal program on Robotino.

gyrocal

Use putty to log into Robotino. If not logged in as root directly do

sudo su

to become root.

Put some tape on the floor and align Robotino so that you can find the starting rotation again. Gyrocal start.jpg