IMU: Unterschied zwischen den Versionen

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche
(Gyro)
(Abstract)
 
(46 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
 
=Abstract=
 
=Abstract=
<gallery>
+
[[File: Imu_assembly.png  | 400px]]
File:Imu.jpg
+
</gallery>
+
  
 
An IMU (Intertia Measurement Unit) is a key component of an inertia navigation system. We use it to:
 
An IMU (Intertia Measurement Unit) is a key component of an inertia navigation system. We use it to:
 
*detect if the robot is in tilt orientation
 
*detect if the robot is in tilt orientation
 
*keep the robot on track for the 'lane-by-lane' mowing pattern
 
*keep the robot on track for the 'lane-by-lane' mowing pattern
 +
[[File: Slope1.png | 400px]]
  
 
=Acceleration sensor=
 
=Acceleration sensor=
 
An acceleration sensor measures earth gravity force (m*s^2) in all 3 robot axes (x/y/z) allowing you to calculate the orientation towards earth center of the robot (Roll, Pitch). However, it cannot detect movement around Yaw - this requires a gyro.
 
An acceleration sensor measures earth gravity force (m*s^2) in all 3 robot axes (x/y/z) allowing you to calculate the orientation towards earth center of the robot (Roll, Pitch). However, it cannot detect movement around Yaw - this requires a gyro.
  
<gallery>
+
[[File: Ardumower_pitch_roll_yaw.png|400px]]
File: Ardumower_pitch_roll_yaw.png
+
</gallery>
+
  
 
=Gyro=
 
=Gyro=
Zeile 22: Zeile 19:
 
                 noise dps/sqrt(Hz)
 
                 noise dps/sqrt(Hz)
 
  L3G4200D        0.03
 
  L3G4200D        0.03
 +
ITG3200        0.03
 +
L3GD20          0.03
 
  BMG160/BNO055  0.014
 
  BMG160/BNO055  0.014
 
  MPU9250        0.01
 
  MPU9250        0.01
Zeile 31: Zeile 30:
 
  MPU9150/MPU6050 0.005
 
  MPU9150/MPU6050 0.005
 
  ADXRS290        0.004
 
  ADXRS290        0.004
 +
CRM100/200      0.003
 
  GYPRO2300      0.00277
 
  GYPRO2300      0.00277
  
Zeile 40: Zeile 40:
 
# If tilting the robot, the compass measurements (x,y,z) relate to the tilted robot. So, you need to correct them using knowing the tilt angles. This requires the use of the accerlation sensor (x,y).
 
# If tilting the robot, the compass measurements (x,y,z) relate to the tilted robot. So, you need to correct them using knowing the tilt angles. This requires the use of the accerlation sensor (x,y).
 
# The compass measurements are influenced by motors. So you may need to switch of the motor to get an accurate measurement.
 
# The compass measurements are influenced by motors. So you may need to switch of the motor to get an accurate measurement.
 +
 +
Typical compass measurement errors:
 +
 +
                        sensitivity (uT)      typical heading error (degree)
 +
AK8975 (MPU9150)        0.3                    5
 +
BNO055                  0.3                    2.5
 +
CMPS11 (9S0 2413 530BS)                        2.0
 +
HMC5883L (GY-80)        0.2                    1.5
 +
AK8963 (MPU9250)        0.15                  not tested
 +
LIS3MDL                0.14                  not tested
 +
LSM303DLM
 +
MAG3110/FXOS8700CQ      0.1                    not tested
  
 
=Sensor fusion=
 
=Sensor fusion=
Zeile 46: Zeile 58:
 
We use a complementary filter to fusion all sensor values.
 
We use a complementary filter to fusion all sensor values.
  
<gallery>
+
[[File: Ardumower_sensor_fusion.png  | 600px]]
File: Ardumower_sensor_fusion.png  | IMU sensor fusion
+
</gallery>
+
  
Additionally, gyro/acceleration and compass sensors can be further input to a [http://wiki.ardumower.de/index.php?title=Sensor_fusion position estimation].
+
=IMU module=
  
=IMU modules=
+
<gallery>
 +
File: Gy80.jpg | GY-80 module
 +
File: GY80-Schematic.jpg | GY-80 schematics
 +
</gallery>
  
 
GY-80
 
GY-80
Zeile 59: Zeile 72:
 
*Gyro: L3G4200D
 
*Gyro: L3G4200D
 
*Pressure sensor: BMP085  (not used here)
 
*Pressure sensor: BMP085  (not used here)
 
MPU9150
 
 
<gallery>
 
File: Gy80.jpg | GY-80 module
 
File: GY80-Schematic.jpg | GY-80 schematics
 
File: Mpu9150.jpg | MPU9150 module  (in development/testing)
 
File: Gy9150_schematics.png | GY-9150 schematics
 
</gallery>
 
  
 
=Assembly=
 
=Assembly=
This photo shows how the IMU module is placed in the driving position (the black arrow shows the driving position). The tube shown was needed to ensure a minimum distance of 30cm from all motors. This minimum distance seems to be needed to ensure the compass is not disturbed by dynamically disturbing sources (like motors).
+
This photo shows how the IMU module is placed in the driving position (the red arrow shows the driving position). Ensure a minimum distance of 30cm from all motors. This minimum distance seems to be needed to ensure the compass is not disturbed by dynamically disturbing sources (like motors).
  
<gallery>
+
[[File: Imu_assembly.png | 400px]]
File: Gy80_direction.jpg | GY-80 assembly
+
</gallery>
+
  
 
=Calibration abstract=
 
=Calibration abstract=
Zeile 84: Zeile 86:
 
The origin of a 3D compass point is 0,0,0 (x,y,z) and points to the north pole. If the 3D compass is rotated around all of its axes i.e. all values of x, y and z are measured then these points will ​​lie on a sphere.  
 
The origin of a 3D compass point is 0,0,0 (x,y,z) and points to the north pole. If the 3D compass is rotated around all of its axes i.e. all values of x, y and z are measured then these points will ​​lie on a sphere.  
  
<gallery>
+
[[File: Compass_sphere.png |400px]]
File: Compass_sphere.png  
+
</gallery>
+
  
 
If you add a magnetic material (e.g. metal) near the compass, the measured values ​​from the origin (0,0,0) of the sensor suddenly point in one direction only - Why?
 
If you add a magnetic material (e.g. metal) near the compass, the measured values ​​from the origin (0,0,0) of the sensor suddenly point in one direction only - Why?
Zeile 104: Zeile 104:
 
The goal of the calibration is that the measurements are centered again on a sphere around the origin of the sensor.
 
The goal of the calibration is that the measurements are centered again on a sphere around the origin of the sensor.
  
 
+
=Calibration steps=
=Calibration (latest version)=
+
 
==Acceleration sensor==
 
==Acceleration sensor==
  
Zeile 117: Zeile 116:
 
Repeat this step for all 6 sides. After all 6 sides are calibrated, you will hear a short melody.
 
Repeat this step for all 6 sides. After all 6 sides are calibrated, you will hear a short melody.
  
<gallery>
+
[[File: Gy80_acc_calibration.png|500px]]
File: Gy80_acc_calibration.png
+
</gallery>
+
  
 
==Compass sensor==
 
==Compass sensor==
This calibration can be performed outside or inside of the robot (in its final position). Make sure the module is far away from magnetic fields or ferreous sources! Start the compass calibration:
+
This calibration can only be performed inside of the robot (IMU in its final position). Start the compass calibration:
  
 
*Via serial console "IMU com calibration start/stop" OR
 
*Via serial console "IMU com calibration start/stop" OR
Zeile 129: Zeile 126:
 
Hold each of the 6 module sides to North direction and tilt the module until minimum and maximum of the axis does not change anymore (until no tone is outputted anymore):
 
Hold each of the 6 module sides to North direction and tilt the module until minimum and maximum of the axis does not change anymore (until no tone is outputted anymore):
  
<gallery>
+
[[File: Gy80_com_calibration.png|500px]]
File: Gy80_com_calibration.png
+
</gallery>
+
  
 
==Calibration quality test==
 
==Calibration quality test==
 
+
For a quality test, you can plot the calibration results (Yaw, Pitch, Roll) via pfodApp. Place the robot on a flat ground and let it rotate (pfodApp: click on "Commands->Auto rotate" until robot rotates). Alternatively, you can let the robot drive a circle (pfodApp: click "Manual->Right" until it drives the desired radius). Finally, choose 'Plot->IMU' to see the calibration result.
===Table test===
+
For testing calibration quality, hold module (parts upside) against a table edge and do not move. Write down the Yaw-value (example: -95,45). Then rotate the module by 180 degree and hold it again against the table edge. Now the Yaw-value should output 180 degree away (example: -95,45 + 180 = 84,55). Repeat this test for both remaining sides of the module.
+
 
+
<gallery>
+
File: Gy80_calibration_check.png
+
</gallery>
+
 
+
... hold module against a table edge ...
+
 
+
calls=30    yaw=-95.56    pitch=0.02    roll=2.52    com=-95.91    com180=84.09    gyroZ=0.00
+
calls=30    yaw=-95.48    pitch=-0.11    roll=2.33    com=-95.81    com180=84.19    gyroZ=-0.01
+
calls=30    yaw=-95.42    pitch=0.03    roll=2.42    com=-95.65    com180=84.35    gyroZ=-0.00
+
calls=30    yaw=-95.45    pitch=-0.21    roll=2.38    com=-95.35    com180=84.65    gyroZ=-0.00
+
 
+
... turn 180 degree, hold again against table edge ...
+
 
+
calls=30    yaw=85.06    pitch=-2.50    roll=0.04    com=84.91    com180=-95.09    gyroZ=-0.03
+
calls=30    yaw=84.90    pitch=-2.59    roll=0.05    com=84.63    com180=-95.37    gyroZ=-0.02
+
calls=30    yaw=85.19    pitch=-2.55    roll=0.01    com=84.73    com180=-95.27    gyroZ=-0.01
+
calls=30    yaw=84.98    pitch=-2.73    roll=0.02    com=84.85    com180=-95.15    gyroZ=-0.01
+
 
+
If deviation is more than one degree, repeat calibration steps!
+
 
+
 
+
===pfodApp test===
+
For a more detailed quality test, you can plot the calibration results (Yaw, Pitch, Roll) via pfodApp. Place the robot on a flat ground and let it rotate (pfodApp: click on "Commands->Auto rotate" until robot rotates). Alternatively, you can let the robot drive a circle (pfodApp: click "Manual->Right" until it drives the desired radius). Finally, choose 'Plot->IMU' to see the calibration result.
+
  
 
For the yaw plot, the curve should be a straight line when the robot is rotating with a constant speed.
 
For the yaw plot, the curve should be a straight line when the robot is rotating with a constant speed.
  
<gallery>
+
[[File: Ardumower_imu_plotting.jpg|300px]]
File: Ardumower_screenshot_IMU.png
+
File: Ardumower_imu_plotting.jpg
+
</gallery>
+
 
+
 
+
=Calibration (old v0.9.3)=
+
==Acceleration sensor==
+
This one-time calibration ensures that all 3 axes measurements are weighted equally. This calibration can even be performed externally to the robot.
+
 
+
1. Connect the Arduino Nano to your PC. On the PC, open the serial console (19200) in the Arduino environment. After the automatic gyro calibration menu appears (this can be shown at any time by pressing the "m" + ENTER keys).
+
 
+
2. Start the calibration by pressing "1" + ENTER keys.
+
 
+
2.1. After calibration, each of the 6 sides of the module has to look up-side and down-side (rotated 180 °). The module has 6 sides, so it must be rotated 6 times, so that each side once is on the table (you can hold the module with your hand  without moving it). Press ENTER after each calibration step. The aim of the calibration to determine the acceleration due to gravity (more precisely, the minimum / maximum value) for each axis . The module must not be artificially accelerated. The order of the sides does not matter.
+
 
+
<gallery>
+
File: Ardumower_pitch_roll_yaw_imu.png
+
</gallery>
+
 
+
Finally, the calibration values ​​for acceleration sensor are printed out on serial console.
+
 
+
==Compass sensor==
+
 
+
First ensure that the IMU module is mounted on the final position and that entire robotic electronic equipment and metal objects are 30cm or more away from it (ie the sensor is not distracted by metallic objects in its environment).
+
 
+
1. Download ArduMag calibration app for Android.
+
2. If not done yet, pair your Android device with the Bluetooth module: On the Android device main screen, choose symbol "Settings" (via Android menu). Now choose  "Wirless and Networks->Bluetooth Settings" and "Find device". Finally, choose "pair with this device" and enter your pin (very often "1234"). The Bluetooth module should now appear as "paired".
+
3. In the ArduMag app, press the Android menu key and then "Bluetooth" to connect with your Bluetooth module (and your robot). The robot should confirm the connection with a beep. The number of measurements should increase.
+
 
+
 
+
Turn around the robot slowly for all axes and all 6 sides for at least 360 degrees:
+
 
+
<gallery>
+
File: Ardumower_compass_calibrate.png
+
</gallery>
+
 
+
The order of the axis of rotation and the direction does not matter. For example, rotate each side 180 degree clockwise and then again 180 degree counterclockwise (result is a 360 degree rotation). The measurements may not fit a sphere.
+
Examples:
+
 
+
<gallery>
+
File: Ardumag1.png
+
File: Ardumag2.png
+
File: Ardumag3.png
+
</gallery>
+
 
+
Finally, press 'Calibrate' to finish the calibration. The robot will confirm the calibration with two beeps. The measurements should fit a sphere now.
+
Examples:
+
 
+
<gallery>
+
File: Ardumag4.png
+
File: Ardumag5.png
+
</gallery>
+
 
+
==Compass deviation==
+
The 'compass deviation calibration' should ensure that all courses are correct (example: south = north + 180 degree).
+
 
+
1. Keep robot on a flat surface, and let it rotate (via pfodApp, press "Commands->Auto rotate" repeatedly until robot rotates). Alternatively, you can let the robot drive in circles (via pfodApp, press "Manual->Right" repeatedly until reaching desired radius).
+
 
+
2. Start deviation calibration (pfodApp: "Settings->IMU->Start Com Cal Dev"). At each 10 degree step, the Nano LED flashes. After reaching all 360 degrees, the Nano LED stops flashing and the deviation calibration is completed.
+
 
+
==Calibration test==
+
===Testing of compass and tilt angles (via serial console)===
+
The Arduino outputs:
+
 
+
yaw: Course/Yaw (see above figure)
+
pitch: Pitch angle (see above figure)
+
roll: Roll angle (see above figure)
+
frequency: Number of measurements per second (100)
+
latency: Number of latency overflows (0)
+
access: Number of external access counts (from Arduino Mega)
+
 
+
===Testing (by using LED)===
+
Align the compass facing north, south, east, west - the LED should go ON. Between them it should go OFF. North, south and east, west about should be opposite.
+
 
+
===Testing (via Android pfodApp)===
+
You can plot the results of the IMU module (yaw, pitch, roll) using pfodApp.
+
 
+
  
 
=Videos=
 
=Videos=

Aktuelle Version vom 11. Mai 2017, 11:11 Uhr

Abstract

Imu assembly.png

An IMU (Intertia Measurement Unit) is a key component of an inertia navigation system. We use it to:

  • detect if the robot is in tilt orientation
  • keep the robot on track for the 'lane-by-lane' mowing pattern

Slope1.png

Acceleration sensor

An acceleration sensor measures earth gravity force (m*s^2) in all 3 robot axes (x/y/z) allowing you to calculate the orientation towards earth center of the robot (Roll, Pitch). However, it cannot detect movement around Yaw - this requires a gyro.

Ardumower pitch roll yaw.png

Gyro

A gyro measures rotational speed (degree/second) in all 3 robot axes (Roll, Pitch, Yaw). This allows us to correct the robot if it is driving 'off-course' due to wet conditions or slope. When integrating (adding) gyro values over time, the actual course (yaw) can be calculated. However, because each sensor reading has a small error, the course will 'drift' over time. This needs to be corrected via an absolute heading sensor (compass).

Typical gyro measurement errors:

                noise dps/sqrt(Hz)
L3G4200D        0.03
ITG3200         0.03
L3GD20          0.03
BMG160/BNO055   0.014
MPU9250         0.01
L3GD20H         0.011
LSM9DS0         0.00875
BMI160          0.007  
MAX21003        0.007
L2G2IS/L2G3IS   0.006
MPU9150/MPU6050 0.005
ADXRS290        0.004
CRM100/200      0.003
GYPRO2300       0.00277

Compass

If a robot drives on a wet lawn, you'll notice quickly that it will not drive straight forward, but instead tends to drive into the direction of the slope. Reading a compass heading can solve this problem and the robot will drive straight forward again .

However, a compass has two problems:

  1. If tilting the robot, the compass measurements (x,y,z) relate to the tilted robot. So, you need to correct them using knowing the tilt angles. This requires the use of the accerlation sensor (x,y).
  2. The compass measurements are influenced by motors. So you may need to switch of the motor to get an accurate measurement.

Typical compass measurement errors:

                        sensitivity (uT)       typical heading error (degree)
AK8975 (MPU9150)        0.3                    5
BNO055                  0.3                    2.5
CMPS11 (9S0 2413 530BS)                        2.0
HMC5883L (GY-80)        0.2                    1.5
AK8963 (MPU9250)        0.15                   not tested
LIS3MDL                 0.14                   not tested
LSM303DLM
MAG3110/FXOS8700CQ      0.1                    not tested

Sensor fusion

To eliminate the issues of all sensor, they are merged to compute the course (degree) and pitch/roll angles.

We use a complementary filter to fusion all sensor values.

Ardumower sensor fusion.png

IMU module

GY-80

  • Acceleration sensor: ADXL345B
  • Compass sensor: HMC5883L
  • Gyro: L3G4200D
  • Pressure sensor: BMP085 (not used here)

Assembly

This photo shows how the IMU module is placed in the driving position (the red arrow shows the driving position). Ensure a minimum distance of 30cm from all motors. This minimum distance seems to be needed to ensure the compass is not disturbed by dynamically disturbing sources (like motors).

Imu assembly.png

Calibration abstract

This one-time calibration ensures that:

  • All 3 axes measurements of the acceleration sensor are weighted equally. This calibration can even be performed externally to the robot.
  • Cables, metal, etc. which are located in the robot near the IMU module have no effect on the compass data.

Why is it needed? The origin of a 3D compass point is 0,0,0 (x,y,z) and points to the north pole. If the 3D compass is rotated around all of its axes i.e. all values of x, y and z are measured then these points will ​​lie on a sphere.

Compass sphere.png

If you add a magnetic material (e.g. metal) near the compass, the measured values ​​from the origin (0,0,0) of the sensor suddenly point in one direction only - Why? There are two types of disturbances of the magnetic field which change / move the values​​:

  • Hard ircon (e.g. magnets): the sphere moves
  • Soft ircon (e.g. metal): the sphere deforms (becomes an Ellipsoid)

Example measurements

The goal of the calibration is that the measurements are centered again on a sphere around the origin of the sensor.

Calibration steps

Acceleration sensor

This calibration can be performed outside of the robot. Place each of the 6 module sides exactly upright, do not move and choose 'next side calibration':

  • Via serial console "IMU acc calibration next side" OR
  • Via pfodApp "Settings->IMU->acc calibration next side"

Do not move the module during the measurement of each side! During measurement you will hear a short beep tone.

Repeat this step for all 6 sides. After all 6 sides are calibrated, you will hear a short melody.

Gy80 acc calibration.png

Compass sensor

This calibration can only be performed inside of the robot (IMU in its final position). Start the compass calibration:

  • Via serial console "IMU com calibration start/stop" OR
  • Via pfodApp "Settings->IMU->com calibration start/stop"

Hold each of the 6 module sides to North direction and tilt the module until minimum and maximum of the axis does not change anymore (until no tone is outputted anymore):

Gy80 com calibration.png

Calibration quality test

For a quality test, you can plot the calibration results (Yaw, Pitch, Roll) via pfodApp. Place the robot on a flat ground and let it rotate (pfodApp: click on "Commands->Auto rotate" until robot rotates). Alternatively, you can let the robot drive a circle (pfodApp: click "Manual->Right" until it drives the desired radius). Finally, choose 'Plot->IMU' to see the calibration result.

For the yaw plot, the curve should be a straight line when the robot is rotating with a constant speed.

Ardumower imu plotting.jpg

Videos

  1. Robot dance
  2. Keep on track
  3. Driving lanes


Further links