BruGi Verticle IMU Orientation Set-up
December 2014
Standard BruGi orientation |
Introduction
Vertical Mounting
If you want to mount the IMU vertically (on the back of the camera), as of this writing, you will need to change code in the Arduino IMU sketch (IMU.ino), compile and reload the firmware. This page covers the sketch changes needed for the eight possible IMU orientations when mounted on the back of the camera.
For a PDF version of the Sketch change worksheet use this link to download:
The following picture shows the standard orientaion rotated about the Y axis.
Rear mount direction, rotating X & Z about Y |
Code Change Matrix
The matrix below lists the parameter values for channel assignments and directions for the eight standard rear verticle positions. The first column are the values found in the standard 050_r217 IMU.ino file. All position information assumes the Z-reverse checkbox is checked and the X-Y Swap checkbox is unchecked in the BruGi GUI. The two columns with green highlight were tested and found to work as expected.
To make a change to your file, first save a copy outside the brugi folder as a backup. Open Arduino and open the BruGi.ino file in Arduino. Find the IMU tab and make the listed code changes. Go to "File"/"Save", re-select the Brugi tab and re-flash the firmware.
Axis Directions |
+X Frwrd +Y Right +Z Down |
+Z Frwrd +Y Right -X Down |
+Z Frwrd +X Right +Y Down |
+Z Frwrd -Y Right +X Down |
+Z Frwrd -X Right -Y Down |
-Z Frwrd +Y Right +X Down |
-Z Frwrd -X Right +Y Down |
-Z Frwrd -Y Right -X Down |
-Z Frwrd +X Right -Y Down |
IMU.ino Sketch Changes: // channel assignment |
Default (r217) |
+z to +x |
+z to +x & +x to +y |
+z to +x & +x to -x |
+z to +x & +x to -y |
+z to -x |
+z to -x & +y to +x |
+z to -x & +y to -y |
+z to -x & +y to -x |
sensorDef.Gyro[ROLL].idx = | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
sensorDef.Gyro[PITCH].idx = | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
sensorDef.Gyro[YAW].idx = | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
sensorDef.Acc[ROLL].idx = | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
sensorDef.Acc[PITCH].idx = | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
sensorDef.Acc[YAW].idx = | 2 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
//direction | |||||||||
sensorDef.Gyro[ROLL].dir = | 1 | 1 | 1 | 1 | 1 | -1 | -1 | -1 | -1 |
sensorDef.Gyro[PITCH].dir = | -1 | -1 | -1 | 1 | 1 | -1 | 1 | 1 | -1 |
sensorDef.Gyro[YAW].dir = | 1 | -1 | 1 | 1 | -1 | 1 | 1 | -1 | -1 |
sensorDef.Gyro[ROLL].dir = | 1 | 1 | 1 | 1 | 1 | -1 | -1 | -1 | -1 |
sensorDef.Gyro[PITCH].dir = | 1 | 1 | 1 | -1 | -1 | 1 | -1 | -1 | 1 |
sensorDef.Gyro[YAW].dir = | 1 | -1 | 1 | 1 | -1 | 1 | 1 | -1 | -1 |
//initialize coordinate system in EstG | |||||||||
EstG.V.X = | 0 | ACC_1G | 0 | ACC_1G | 0 | ACC_1G | 0 | ACC_1G | 0 |
EstG.V.Y = | 0 | 0 | ACC_1G | 0 | ACC_1G | 0 | ACC_1G | 0 | ACC_1G |
EstG.V.Y = | ACC_1G | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
See Also
TBA
Comments? Questions?