Skip to content

Using NavStick NanoPilot Board

Mayank Mittal edited this page Mar 9, 2017 · 4 revisions

Contributor: Mayank Mittal, Shibhansh Dohare

Inertial Navigation System (INS)

An INS is a self- contained navigation technique, in which measurements from the accelerometers and gyroscopes are used to track the position and orientation of object relative to the original state (position, orientation and velocities) of the system.

There are two possible system configurations in an INS:

  1. Stable Platform Configuration in which the inertial sensors are mounted on a platform which is always aligned with the global frame (this can be achieved using gimbals)
  2. Strapdown Configuration in which inertial sensors are mounted rigidly onto the device

In our AUV Varun, we use the NavStick NanoPilot which is a strapdown navigation system. The NavStick NanoPilot is a 10-DOF sensor comprising of a three- axis gyroscope, three- axis magnetometer, three- axis accelerometer and barometer. Besides that, it has a inner temperature sensor which can be used to reduce noises due to heating up of device and improve the accuracy of the measurements.

Before proceeding further, in case you are unaware of the working of the Inertial Measurement Unit (IMU) a good place to read up on the basics and the math involved can be understood here. On the mentioned link you would also be able to find a simple algorithm which can be used to reduce the bias errors from the measurements we get from the IMU.

Direct Cosines Method (DCM)

The DCM is a popular technique to reduce the errors seen while determining the orientation using the IMU. It utilizes the data from the sensors to finally obtain the orientation of the system, in our case our robot. A brief introduction to this can be found here.

Calibration of IMU

Before using the DCM method, we first need to calibrate our IMU. Calibration refers to associating the readings from the sensor to a physical quantity which is measured using standard measurement techniques. Although several companies provide a calibrated sensor, however we need to repeat the process before using the sensor as the environmental conditions where the sensor is being used and factory conditions may vary.

Suppose you need to find the acceleration along one of the axis of our IMU, say x- axis. When the robot moves, the IMU measures the force experienced along that direction and sends corresponding digital output (a value between 0- 255 for a 8- bit sensor). We then convert this output to acceleration in terms of g.

You may read about various calibration techniques for the magnetometer and accelerometer over here.

In practice, we get a vector output from the accelerometer, each component being the acceleration along principle axis of the body frame of the sensor. Since we are using a strapdown system, the measurement along z doesn't mean gravitational acceleration. In fact each component has a particular component of g projected onto it. The values of acceleration with resepect to global frame can be found by the rigid body transformation matrix once we obtain the orientation of the system, using the gyroscope and magnetometer.

A useful software Magneto12 can be used to calibrate the accelerometer and magnetometer. The software is available for Windows only. However, the data files can be saved in txt format which can later be read on a Linux system.

Retrieving Data from NanoPilot

The NanoPilot we use came with NavStick IvyPro board. This board helps interfacing with the Nanopilot using a micro-USB cable which can then be connected directly to the USB 2.0 port of our laptop/ processor.

  1. Ensure you have the software packages required. If not then download them be referring to our wiki page.

  2. Clone AUV- IITK git repository: git clone https://github.com/AUV-IITK/auv.git

  3. Access the hardware layer containing about IMU package: cd /auv/hardware_layer/hardware_imu

  4. Now install minicom software, which is used to interact with the IMU. For this, type the command sudo apt-get install minicom on a terminal

  5. Connect the IMU to your system. Open dev directory which should be present in the Linux root folder. Then type cd /dev in your terminal, followed by ls to find ttyACM files in the directory.

  6. Depending on which file you find, type the following command: sudo minicom -D /dev/ttyACMk -b 115200 (where k is the number at the end of ttyACM, example: ttyACM0)

  7. Hit Enter and then type usb to see nine different outputs.

  8. After this, cource your environment and run the rosnode yawDirect in the IMU package, to see the yaw output only.

Formula used to determine roll, yaw and pitch

Suppose principle axis are denoted by e0, e1 and e2 for a 3-D system, then the readings from the accelerometer can be defined as [acc0, acc1, acc2] and magnetomter measurements with e0, e1 and e2 axis as [mag0, mag1, mag2] respectively.

yaw = -atan2(mag1,mag0)

pitch = atan2(acc1,sqrt(acc2acc2+acc0acc0))

roll = atan2(acc0,sqrt(acc2acc2+acc1acc1))

Frequently Faced Problems

  1. Command line does not appear after pressing enter in minicom. This problem occurs when the two IMU boards (NanoPilot and IvyPro board) are not connected properly together.

  2. “Permission Denied” while starting minicom. This problem arises when your user does not belong to dialout group. Use the following command to add your user to the dialout group: sudo gpasswd --add joeuser dialout

  3. “Device is locked” error comes. If the minicon did not shut down properly the last time it was closed, this problem occurs. The lock is stored as a temporary file which can be removed by: rm /var/tmp/LOCK..ttyACM0 or rm /var/lock/LOCK..ttyACM0

Future Work To DO

  1. Improve the measurements from the sensors by finding out the various noises that occur in an INS system, mainly random walk.
  2. Implement Kalman Filter Algorithm to get a best estimate over the orientation of the robot from the gyroscope and magnetometer together.

References

[1] Introduction to IMU, Oliver J. Woodman

[2] NavStick Labs