View unanswered posts | View active topics It is currently Mon Sep 01, 2014 10:22 pm






Reply to topic  [ 11 posts ] 
dCompass Accurate reading 
Author Message
Rookie

Joined: Sun Sep 25, 2011 1:52 pm
Posts: 16
Post dCompass Accurate reading
Hello,
I am using the dCompass on a boat. Thus the sensor does not stay flat , it rocks back and forth and up and down due to the motion of the boat. Because of that, I am getting an inaccurate reading with the compass. Is there a way to fix that? I also have tilt sensor available.Thank you.
Cheers.


Sat Mar 09, 2013 8:09 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3209
Location: Rotterdam, The Netherlands
Post Re: dCompass Accurate reading
You can only fix that if have an accelerometer to calculate your tilt values. Once you know that, you can use the three magnetic fields to calculate your magnetic north heading. The math of this is not something I can conjure up off the top of my head (or any other part of my head, for that matter).

Edit: this is why ships' compasses are always mounted in a way that allows them to move around and stay level :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Mar 10, 2013 2:11 am
Profile WWW
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: dCompass Accurate reading
Does the boat rock just back and forth or just left and right or all? If you answered 1 or 2 I can help with the tilt math.

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Sun Mar 10, 2013 8:08 pm
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: dCompass Accurate reading
You could do as Xander said and make a leveling gyro for the compass. Or get a three-axis compass :P

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Sun Mar 10, 2013 8:43 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3209
Location: Rotterdam, The Netherlands
Post Re: dCompass Accurate reading
The dCompass /is/ three axes, but that won't help you if you don't know your tilt levels.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Mon Mar 11, 2013 12:27 am
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: dCompass Accurate reading
Ah. Well I'm a noob at tilty things. :mrgreen:

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Mon Mar 11, 2013 10:24 am
Profile WWW
Rookie

Joined: Sun Sep 25, 2011 1:52 pm
Posts: 16
Post Re: dCompass Accurate reading
Coder A wrote:
Does the boat rock just back and forth or just left and right or all? If you answered 1 or 2 I can help with the tilt math.

Both ! The boat rock back and forth and left and right. I can buy an accelerometer (dIMU) if that would make it work. I think it is only a matter of figuring out the math. I would really appreciate it if you help me ! Thank you.


Mon Mar 18, 2013 2:26 pm
Profile
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: dCompass Accurate reading
To figure out the tilt you would squareroot the sum of the squares of the forces felt along 2 of the axes(confusing? Don't worry). Then you do some math wilth arctangent, and add in the third axis, and do some more math, and you have the tilt both ways. however, it is up to you and the others to figure out how this helps get a reading from the compass. Do you want me to post the code? It could be a while, as I have not actually made it.

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Tue Mar 19, 2013 3:47 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3209
Location: Rotterdam, The Netherlands
Post Re: dCompass Accurate reading
If you make it, I will add it to the Driver Suite with credits, of course :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Mar 20, 2013 1:50 am
Profile WWW
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: dCompass Accurate reading
All it is is the third-dimensional extension of the point downwards program. I will try to make it.

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Wed Mar 20, 2013 2:11 pm
Profile
Rookie

Joined: Sun Sep 25, 2011 1:52 pm
Posts: 16
Post Re: dCompass Accurate reading
Coder A wrote:
To figure out the tilt you would squareroot the sum of the squares of the forces felt along 2 of the axes(confusing? Don't worry). Then you do some math wilth arctangent, and add in the third axis, and do some more math, and you have the tilt both ways. however, it is up to you and the others to figure out how this helps get a reading from the compass. Do you want me to post the code? It could be a while, as I have not actually made it.

Yes that would be great ! I appreciate it . Thank you.


Thu Mar 28, 2013 7:33 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.