ROBOTC.net forums
http://robotc.net/forums/

dCompass Accurate reading
http://robotc.net/forums/viewtopic.php?f=1&t=5601
Page 1 of 1

Author:  theboss4545 [ Sat Mar 09, 2013 8:09 pm ]
Post subject:  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.

Author:  mightor [ Sun Mar 10, 2013 2:11 am ]
Post subject:  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

Author:  Coder A [ Sun Mar 10, 2013 8:08 pm ]
Post subject:  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.

Author:  NeXT-Generation [ Sun Mar 10, 2013 8:43 pm ]
Post subject:  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

Author:  mightor [ Mon Mar 11, 2013 12:27 am ]
Post subject:  Re: dCompass Accurate reading

The dCompass /is/ three axes, but that won't help you if you don't know your tilt levels.

= Xander

Author:  NeXT-Generation [ Mon Mar 11, 2013 10:24 am ]
Post subject:  Re: dCompass Accurate reading

Ah. Well I'm a noob at tilty things. :mrgreen:

Author:  theboss4545 [ Mon Mar 18, 2013 2:26 pm ]
Post subject:  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.

Author:  Coder A [ Tue Mar 19, 2013 3:47 pm ]
Post subject:  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.

Author:  mightor [ Wed Mar 20, 2013 1:50 am ]
Post subject:  Re: dCompass Accurate reading

If you make it, I will add it to the Driver Suite with credits, of course :)

= Xander

Author:  Coder A [ Wed Mar 20, 2013 2:11 pm ]
Post subject:  Re: dCompass Accurate reading

All it is is the third-dimensional extension of the point downwards program. I will try to make it.

Author:  theboss4545 [ Thu Mar 28, 2013 7:33 pm ]
Post subject:  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.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/