Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mo_bri
New Contributor I
101 Views

Compass Calibration D2000 ? Magnetometer example - Wrong compass degree reading

IMG_7039-1.jpg

Hi,

I build and run the magnetometer example. The degree reading is wrong, I've tried flashing the rom, can't figure out if I need to calibrate - however according to the d2000 Customer Ref Boar PDF doc

"The oscillator trim codes are not correct/setup" - for my particular serial number board - is this a problem ? It then states they they are set up in software (if using QMSI 1.1 which I am)

So my problem is how do I correct the degrees of the compass ? Do I

1. Calibrate it - is so how

2. The trim codes mean it will never work ?

3. The code is wrong in the example provided by Intel ?

4. I have the board orientated wrong ( see attached image )

The code to calculate the compass orientation in degrees looks like this :

bmx1xx_read_mag(&mag);

heading = atan2(mag.y, mag.x);

if (heading < 0) 
{
		heading += 2 * M_PI;
}

deg = (int)(heading * 180 / M_PI);

Attached is an image of the compass on top of the d2000 board (is the board the correct way up ?)

When I compare the orientation of the board with a compass I get :

Board is facing North     code shows me degrees

mag x 1716 y -681 z -2444 deg 338 direction N
mag x 1711 y -681 z -2444 deg 338 direction N
mag x 1716 y -681 z -2444 deg 338 direction N
mag x 1710 y -675 z -2443 deg 338 direction N
mag x 1710 y -675 z -2437 deg 338 direction N
mag x 1711 y -687 z -2437 deg 338 direction N

Board is facing East     code shows me degrees

mag x -912 y 988 z -4429 deg 132 direction SE
mag x -918 y 982 z -4435 deg 133 direction SE
mag x -918 y 988 z -4435 deg 132 direction SE
mag x -912 y 988 z -4435 deg 132 direction SE
mag x -924 y 988 z -4423 deg 133 direction SE
mag x -918 y 994 z -4442 deg 132 direction SE

 

Board is facing South     code shows me degrees

mag x -1582 y 639 z -717 deg 158 direction S
mag x -1593 y 639 z -717 deg 158 direction S
mag x -1587 y 633 z -723 deg 158 direction S
mag x -1593 y 639 z -723 deg 158 direction S
mag x -1582 y 639 z -717 deg 158 direction S
mag x -1587 y 633 z -723 deg 158 direction S
mag x -1593 y 639 z -723 deg 158 direction S

Board is facing West     code shows me degrees

mag x 905 y -829 z 1459 deg 317 direction NW
mag x 905 y -841 z 1453 deg 317 direction NW
mag x 905 y -841 z 1447 deg 317 direction NW
mag x 905 y -835 z 1459 deg 317 direction NW
mag x 900 y -835 z 1452 deg 317 direction NW
mag x 905 y -830 z 1459 deg 317 direction NW
mag x 905 y -835 z 1453 deg 317 direction NW
mag x 894 y -835 z 1453 deg 316 direction NW


Can anyone help me get the compass working ?

 

Marcus

0 Kudos
5 Replies
Sukruth_H_Intel
Employee
101 Views

Hi Marcus,

                  We have received your issue. We are investigating the same. Would get back to you with an update soon.

Regards,
Sukruth H V

0 Kudos
Sukruth_H_Intel
Employee
101 Views

Hi Marcus,

                   You mentioned in the description above :- 

however according to the d2000 Customer Ref Boar PDF doc

"The oscillator trim codes are not correct/setup"

I don't see this statement about trim codes in CRB refrence guides :- http://www.intel.com/content/dam/www/public/us/en/documents/guides/quark-d2000-crb-user-guide.pdf . Could you please help me understand where you get this error about trim codes?

Regards,
Sukruth H V 

0 Kudos
Sukruth_H_Intel
Employee
101 Views

Hi Marcus,

                I have escalated this to our development team. I would notify you once i get an update.

Regards,
Sukruth H V

0 Kudos
mo_bri
New Contributor I
101 Views

Hi,

the quote is regarding trim is from this URL

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/d2000/quark-d2000-customer-refere...

This document

"Intel quark microcontroller d2000 developer platform hardware manual - September 2016"

Document number 333582 005EN - Page 8

My question though is, is this a problem with my board as I have one of the boards that is listed as having this problem - can you send me another board - one that has this problem fixed ?

Thanks

Marcus

0 Kudos
mo_bri
New Contributor I
101 Views

Hi,

I just want to know

1. How do I calibrate the compass

2. What can interfere with it ? Ie is the power source likely to cause a discrepency (USB vs Barrel vs VIN)

3. If it is broken can you send me another one ASAP please

This is holding up my development of my robot

www.roboticsfordreamers.com

Marcus

0 Kudos