Author |
Message |
theboss4545
Rookie
Joined: Sun Sep 25, 2011 1:52 pm Posts: 16
|
 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 |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 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 |
|
 |
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
|
 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 |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: dCompass Accurate reading
You could do as Xander said and make a leveling gyro for the compass. Or get a three-axis compass 
_________________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 |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 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 |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: dCompass Accurate reading
Ah. Well I'm a noob at tilty things. 
_________________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 |
|
 |
theboss4545
Rookie
Joined: Sun Sep 25, 2011 1:52 pm Posts: 16
|
 Re: dCompass Accurate reading
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 |
|
 |
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
|
 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 |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 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 |
|
 |
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
|
 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 |
|
 |
theboss4545
Rookie
Joined: Sun Sep 25, 2011 1:52 pm Posts: 16
|
 Re: dCompass Accurate reading
Yes that would be great ! I appreciate it . Thank you.
|
Thu Mar 28, 2013 7:33 pm |
|
|