Example of data logged on the motorcycle

Some days ago I went to work by motorcycle, and I tested the data logger with the latest software. After exporting the data from Arduino 101 SD card to the PC, I converted it to a CSV file and uploaded on Google Drive using the Google Fusion Tables application. The following is the result.


The data shown in the graphs is taken between 2 points ("start point" and "end point"). GPS position is logged once every second, and it is used to calculate the speed (km/h) and GPS heading angle (North is 0=360 degrees, clockwise positive direction). When GPS position, speed and heading are judged to be reliable, the GPS heading information is used to correct the yaw angle calculated from IMU (Inertial Measurement Unit) acceleration and gyroscope sensors.

Pitch and roll angles are calculated by fusing the data coming from acceleration sensors (3 axis) and gyroscope sensors (3 axis). When acceleration modulus value is close to 1 g (gravity acceleration, 9.81m/s2), it means that the acceleration data is not noisy, therefore it is given maximum priority to it. On opposite, when acceleration signals are noisy, the gyroscope signals have highest priority to calculate instant pitch and roll angles.

In other words, gyroscope signals usually have high priority to calculate yaw, pitch and roll angles. But since they may be affected by an offset error (which leads to an integrated error which is always increasing), it is necessary to correct these information somehow. In my algorithm, I correct the angles long period drift as following:

  • Pitch and roll angles are corrected using accelerometer sensors data.
  • Yaw angle is corrected using GPS heading angle information.

The complete data-log can be downloaded here: PDF file (20160621_going_work) and CSV file (20160621_going_work).

The latest IMU library can be downloaded here: IMU_library_20160622. The library is about 700 lines of C++ code. It allows to calculate yaw, pitch, angles using acceleration sensors, gyroscope sensors and GPS latitude, longitude and time data. The library contains some calibratable parameters, which should be adapted to each application. I will prepare some documentation (however, the code is already hardly commented).

Author: Davide Cavaliere

I am an Italian Electrical Engineer graduated at Politecnico di Milano. My interests are motorcycles and cars, electronics, programming, Internet of Things, and Japanese culture.

2 thoughts on “Example of data logged on the motorcycle”

  1. Hi,

    I am building my own GPS logger with a arduino.
    Do you log from own sensors or do you log traffic from the bike ?

Leave a Reply

Your email address will not be published. Required fields are marked *