Testing my code for the HMC5843 turns out that the labeling for the axis may be wrong. The sign directions are different too. I checked against the Board from Sparkfun. Looking at the datasheet, the components axis described there are when you look at the bottom of the device. The schematic pictures is mirrored upside down to show a view from the top.
Tags:

Permalink Reply by Luis Mauro on January 2, 2011 at 8:27pm Chris,
I already double checked the solder jumper, It´s connecting the center pad with the pad labeled 5V.
I´ll record the values supplied by the board and show in a time-stamp graph for a better understanding of the problem.
I´m thinking to make a non-sense trying: set-up the 5843 board to 3V and connect to the Arduino board through a logic level converter (Sparkfun)!

We don't see the problem on the APM board. You can see sample data here
Permalink Reply by Luis Mauro on January 6, 2011 at 12:35pm
Permalink Reply by Fabio Varesano on January 3, 2011 at 12:51am Hi there, the problem I reported at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1291403700 was mostly imputable to the ITG3200 rather than the magnetometer. See this for more details.
You can give a try to my Arduino library for the HMC5843 based on Wire.
Also if you are into sensor fusion algorithms and 9DOM/DOF boards check my 9DOF/DOM orientation filter algorithm code and my FreeIMU 9DOM/DOF board.
Permalink Reply by Luis Mauro on January 3, 2011 at 8:16am Hello Fabio
First of all, thank you for your help. I already downloaded your library and I´ll try!!
IMPORTANT: I´m not using the SparFun board (3.3V) that needs a level converter to be connect to 5V devices, I´m using DIYdrones board that can deal with 3V3 and 5V devices. In this case it´s setted-up to 5V (no level converter required).
Permalink Reply by Uwe Gartmann on January 3, 2011 at 2:13pm Hi Fabio
Great stuff. What do you use to display the orientation on screen?
I enhanced the original APM code for the HMC5843 for my purposes: Link (goto libraries)
Permalink Reply by Fabio Varesano on January 4, 2011 at 1:15am Hi Uwe, I use Processing to display the cubes on the screen. It's a very simple programming language which perfectly fits the need of rapid graphics prototyping.
If you were talking about the 9DOF/DOM orientation filter above the Processing code is available on the attachments of my 9DOF/DOM blog post.
Permalink Reply by Uwe Gartmann on January 4, 2011 at 2:18pm
Permalink Reply by Uwe Gartmann on January 6, 2011 at 1:49pm Hi Fabio
Can you give me some support regarding your code?
How ist the syntax/format of the string send to the processing prg?
Permalink Reply by Fabio Varesano on January 6, 2011 at 4:09pm Sure, the sensor fusion algorithm computes a quaternion which is a representation of the orientation of the body in 3d. A quaternion is stored in memory as four floating variables.
These variables are then sent over the wire using an HEX representation.The format should be:
f:HEX_q1,f:HEX_q2,f:HEX_q3,f:HEX_q4,\r\n
Above, HEX_q1 means the hexadecimal representation of quaternion first component.
That's how I managed to send floats over serial without loss of precision. I wrote a blog post on this topic.
The Processing app just need to read the data from the serial interface, decode that back into a float and use the orientation data for displaying the rotated cube.
For more examples on Arduino, Serial and Processing check my blog post: Serial communication with Arduino and Processing: simple examples a...
Feel free to ask if you need more help.
Permalink Reply by Uwe Gartmann on January 8, 2011 at 2:16pm Hi Fabio
I try now since hours to run your code on my APM board. But it does not work.
I do not know why, but when the calculated values are written back to q0..q3, this values remain zero at all.
May the compiler is wrong. I found that A = A + 1 is not working correctly until I write it like this: A =+ 1
Very strange all this things. At this point I miss professional development tools.
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.24 members
51 members
184 members
51 members
8 members
© 2013 Created by Chris Anderson.
Powered by
