Intro
So, this weekend I've started working on a simple, Arduino-based Inertial Navigation System.Using accelerometers and gyroscopes it is possible to calculate the traveled distance and the direction, from a known startpoint. The main problem of this method is that to get these distances, you have to perform integrations of the accelerations. Integration means that also every little error in measurement will be integrated, so they add up over time and the accuracy gets worse and worse. Therefore you need very good sensors and smart algorithms, being the reason why professional systems are expensive.
A constant error ... |
integrated over time twice ... |
leads to an increasing error. |
These are my first steps and far from a finished project. Right now I'm basically just reading the sensor data.
Parts
Parts on breadboard. My desk is actually white. |
- Arduino Uno [info@arduino]
- MPU6050 Breakout Board [info@sainsmart]
- LEDs, resistors, switches, etc.
First breadboard test
Breadboard drawn with fritzing. |
I used this how-to to learn how to hook up the MPU6050.
- MPU6050 / Arduino Uno
- VCC / 3V3
- GND / GND
- SCL / A5
- SDA / A4
Arduino sketch
The first sketch just reads the sensor data and stores the acceleration in x-direction it in the EEPROM. The EEPROM can store 1024 bytes. That means it can store 1024 numbers between 0 and 255. The sensor data come as integers, ranging from −32,768 to 32,767, so the value has to be divided and shifted. After the button is pressed, data is logged for 10 seconds with 100Hz.
The second sketch reads the data from the EEPROM and prints it to the serial monitor. From there I copied the data into a .txt-file, which I processed and visualized using a simple Python-script.
At first, the sensor was upside down, resulting in -1g, then turned around, 1g, and then yanked around a little. |
Next steps
- find a algorithm to integrate the sensor values
- add a micro-SD card reader for data logging
- add a magnetic sensor to find north
- add a barometric sensor to get the heigth
No comments:
Post a Comment