How to test FreeIMU with Arduino

Asked by Ricardo Santos

How i test my FreeIMU? I have tried to run FreeIMU_yaw_pitch_roll, but i only have strange caracters...
And i never used processing...

Question information

Language:
English Edit question
Status:
Solved
For:
FreeIMU Edit question
Assignee:
No assignee Edit question
Solved by:
Fabio Varesano
Solved:
Last query:
Last reply:
Revision history for this message
Ricardo Santos (ricardosantos-developer) said :
#1

I'm really dumb... I was having strange characters, because I had the wrong baudrate in the terminal ...
But still could not put the processing work ... And i know it's my fault...

Revision history for this message
Fabio Varesano (fabio-varesano) said :
#2

First, check your connections. They have to look like the document called "Connecting FreeIMU v0.3 or v0.3.1 to Arduino Duemilanove or UNO" at http://www.varesano.net/projects/hardware/FreeIMU#0.3

Then install the FreeIMU library available at http://www.varesano.net/projects/hardware/FreeIMU#library as explained in http://arduino.cc/en/Reference/Libraries (section "Contributed library").

Once you'll have them installed restart the Arduino IDE and the examples will show up under File->Examples->FreeIMU

You can use FreeIMU_raw to verify raw readings from the sensors. You can use FreeIMU_yawpitchroll to see the yaw pitch and roll informations coming out from the sensor fusion. You can use FreeIMU_quaternion to stream the quaternion representing the board orientation to the Processing application.

In order to use the processing cube you have to donwload and install processing. Once you got it open the processing examples you downloaded from http://www.varesano.net/projects/hardware/FreeIMU#library in the IDE. Remember to change the serial port configuration in the Processing code to match the serial port used by Arduino in your system. You may have to change the line
 final String serialPort = "/dev/ttyUSB9";
in something like
 final String serialPort = "COM1";
if you are running Windows.

Revision history for this message
Fabio Varesano (fabio-varesano) said :
#3

You can get the Serial port your arduino is using from the Arduino IDE in Tools->Serial Port

Revision history for this message
Ricardo Santos (ricardosantos-developer) said :
#4

I already did what you said in my case is COM4... but the cube doesn't move...
In Arduino IDE everything works, but not in processing... =S

My terminal show this:

WARNING: RXTX Version mismatch
 Jar version = RXTX-2.2pre1
 native lib Version = RXTX-2.2pre2

Revision history for this message
Fabio Varesano (fabio-varesano) said :
#5

You have to use the FreeIMU_quaternion Arduino Sketch associated with FreeIMU_cube Processing code. Are you doing this?

Remember to close the serial monitor of the Arduino IDE before running the Processing app as only one application is allowed to access the serial interface.

Revision history for this message
Ricardo Santos (ricardosantos-developer) said :
#6

Yes I am ... Where should display the values shows ​​NaN ... And the cube disappears ... Also the led of Tx in arduino is blinking...

Revision history for this message
Fabio Varesano (fabio-varesano) said :
#7

What does the Arduino IDE serial monitor shows when running the code?
What values do you read when you use the FreeIMU_raw arduino sketch in the monitor?
What angles do you get when running FreeIMU_yawpitchroll arduino sketch?

Revision history for this message
Ricardo Santos (ricardosantos-developer) said :
#8

FreeIMU_quaternion:

0000C0FF,0000C0FF,D923C0FF,C6B5C0FF,
0000C0FF,0000C0FF,0000C0FF,0000C0FF,
0000C0FF,0000C0FF,0000C0FF,D923C0FF,
0000C0FF,0000C0FF,C6B5C0FF,C6B5C0FF,
0000C0FF,0000C0FF,D923C0FF,D923C0FF,
0000C0FF,0000C0FF,0000C0FF,0000C0FF,
0000C0FF,0000C0FF,D923C0FF,D923C0FF,
0000C0FF,0000C0FF,D923C0FF,C6B5C0FF,
0000C0FF,0000C0FF,D923C0FF,D923C0FF,
0000C0FF,0000C0FF,D923C0FF,0000C0FF,
0000C0FF,0000C0FF,D923C0FF,D923C0FF,
0000C0FF,0000C0FF,D923C0FF,D923C0FF,

FreeIMU_raw

3,-32,227,-81,-12,12,0,0,0,
3,-32,227,-77,-10,12,0,0,0,
3,-32,227,-81,-9,11,0,0,0,
-1,-35,236,-78,-13,13,0,0,0,
-1,-35,236,-81,-15,10,0,0,0,
-1,-35,236,-80,-10,14,0,0,0,
-2,-33,233,-83,-8,12,0,0,0,
-2,-33,233,-79,-8,13,0,0,0,
-3,-33,234,-82,-12,12,0,0,0,
-3,-33,234,-75,-8,9,0,0,0,
-3,-33,234,-75,-12,11,0,0,0,
-3,-36,236,-85,-11,9,0,0,0,
-3,-36,236,-78,-8,9,0,0,0,

FreeIMU_yawpitchroll:

Yaw: 46.56 Pitch: 0.71 Roll: -9.15
Yaw: 46.54 Pitch: 0.74 Roll: -9.15
Yaw: 46.52 Pitch: 0.77 Roll: -9.14
Yaw: 46.50 Pitch: 0.80 Roll: -9.12
Yaw: 46.48 Pitch: 0.82 Roll: -9.11
Yaw: 46.46 Pitch: 0.85 Roll: -9.08
Yaw: 46.45 Pitch: 0.88 Roll: -9.06
Yaw: 46.43 Pitch: 0.89 Roll: -9.05
Yaw: 46.42 Pitch: 0.90 Roll: -9.04
Yaw: 46.40 Pitch: 0.92 Roll: -9.04
Yaw: 46.39 Pitch: 0.94 Roll: -9.03

Revision history for this message
Best Fabio Varesano (fabio-varesano) said :
#9

Ok, problem found. Unfortunately, it seems that your magnetometer is not working as it should.

3,-32,227,-81,-12,12,0,0,0,
3,-32,227,-77,-10,12,0,0,0,
3,-32,227,-81,-9,11,0,0,0,

the last 3 numbers per line are the readings from the magnetometer. Of course it shouldn't be zero but a varying number. This means that the magnetometer has some problems. Without a fully functional magnetometer the sensor fusion algorithm will fail and the cube graphics won't work.

I did tested successfully the board before shipping it, it may have damaged during shipping.. it has happen before.

I'm shipping a new FreeIMU v0.3.1 to you on Monday. I'm sorry for this problem.

Revision history for this message
Ricardo Santos (ricardosantos-developer) said :
#10

Thanks Fabio Varesano, that solved my question.