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.

 

Views: 1301

Reply to This

Replies to This Discussion

Luis, the mags are user-configurable between 3v and 5v (via a solder jumper). Check your module: if the solder jumper is in the 3v position, you need to move it to the 5v position.

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

Hello

A question about the data from http://code.google.com/p/ardupilot-mega/wiki/MagnetometerTest
Does the magnetometer was moving or static (no movement)?

Please take a look in details the problem that I´m having (powerpoint attached file)
Attachments:

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.

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).

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)

 

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.

very cool, thanks for sharing.

Hi Fabio

 

Can you give me some support regarding your code?

How ist the syntax/format of the string send to the processing prg?

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.

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.

RSS

Social Networking

Contests

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.

A list of all T3 contests is here

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service