Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Compass radians to direction calculation

Status
Not open for further replies.
Hi,
Here's a test showing XZY_RAW with no calculation, and some numbers to look at:
C
 

Attachments

  • XZY RAW.txt
    652 bytes · Views: 211
Hi,
Here's a test showing XZY_RAW with no calculation, and some numbers to look at:
C
The values seem to be way off, if my calculations are ok.

COMPASS PCB HB LB calculated/ degrees

10 X 255 213 Y 0 119 20
40 X 255 95 Y 0 79 64
50 X 255 61 Y 0 48 76
60 X 255 33 Y 0 12 79
90 X 255 11 Y 255 117 120
120 X 255 75 Y 254 0 160
 
The values seem to be way off, if my calculations are ok.

COMPASS PCB HB LB calculated/ degrees

10 X 255 213 Y 0 119 20
40 X 255 95 Y 0 79 64
50 X 255 61 Y 0 48 76
60 X 255 33 Y 0 12 79
90 X 255 11 Y 255 117 120
120 X 255 75 Y 254 0 160
Hi J,
Any ideas why they appear wrong?
C.
 
Did you have the compass, magnets or iron... near the chip when measuring.
Currents near the chip might affect the results?
HMC5983 has a self test feature, which you could try.
 
Did you have the compass, magnets or iron... near the chip when measuring.
Currents near the chip might affect the results?
HMC5983 has a self test feature, which you could try.
Hi J,
The test PCB I've been using is a temporary measure, and the HMC5984 hasn't been properly setup, as it was uncertain that any results were possible, also there are metal objects including the brass compass, around that could affect it. I am making anew PCB, and once everything is fixed, it will be worth setting all of the details.

If the results, are somewhere near what should be, then at this stage it seems fine.
C.
 
Hi,
I'm better at visual than calculations, so I made a compass wheel.
I can now see a pattern that will help me figure it out. There are 4x circles corresponding to XHB, XLB YHB, YLB
Hope it helps.
C
 

Attachments

  • compass wheel.jpg
    compass wheel.jpg
    199.3 KB · Views: 216
Last edited:
Did you have the compass, magnets or iron... near the chip when measuring.
Currents near the chip might affect the results?
HMC5983 has a self test feature, which you could try.
Hi J,
Regarding the self test feature. Does the module need to be in it's finished set-up, i,e, in the hardware, for the self test to work, or if I run it, will it work for all circumstances?
C.
 
Hi,
I've got a bit tangled with the 'self test'

Will someone check my settings for the test, also my normal running settings, from the 'Self test.jpg, please?

From the results on the screen, it appears that the self test, and settings are ok.

C.
 

Attachments

  • Self test.jpg
    Self test.jpg
    562.8 KB · Views: 217
  • ST.jpg
    ST.jpg
    98.1 KB · Views: 211
  • RegB.jpg
    RegB.jpg
    182.9 KB · Views: 210
Last edited:
Hi,
I'm getting a bit more familier with the 3 Axis compass technology, as time goes by, and getting various results. It seems as though there are two ways of compensating for errors. 1/for hard iron affects and 2/ For soft iron affects.

I've just come across a Compass module viewer that looks interesting, and can visualise the effects of nearby metals etc: https://diydrones.com/profiles/blog...oft-iron-magnetometer-calibration-for-dummies
It uses serial DATA from the module to give results. See attached.

EDITED
C.
 

Attachments

  • DATA entry.jpg
    DATA entry.jpg
    76.3 KB · Views: 205
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top