# Compass issue - calibration

**URL:** <https://discuss.bluerobotics.com/t/compass-issue-calibration/4463>\
**Category:** Sensors\
**Created:** [February 26, 2019, 8:36pm UTC](https://discuss.bluerobotics.com/t/compass-issue-calibration/4463 "2019-02-26T20:36:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamid.n888](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@hamid.n888](https://discuss.bluerobotics.com/u/hamid.n888)\
**Post date:** [February 26, 2019, 8:36pm UTC](https://discuss.bluerobotics.com/t/compass-issue-calibration/4463/1 "2019-02-26T20:36:11Z")

</div>

hi. I have some problem with the compass on my rov. my rov is working around the steel ships it can attach to the ship’s hull by magnets on her chain wheel. so in this situation, my compass can’t work correctly and the output data in turning 360 degrees is about 40 degree 😑  
Does anybody have any idea for solving this problem? can I calibrate my compass?  
my last compass module was cmps11  
do you have any advice or any compass or gyro that can work in this situation? also, this a student project and I have money issue and I can’t buy expensive modules like imu or usbl method.

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [February 27, 2019, 2:07pm UTC](https://discuss.bluerobotics.com/t/compass-issue-calibration/4463/2 "2019-02-27T14:07:16Z")

</div>

A compass measures the local magnetic field. If you are applying any significant magnetic field or distorting earth’s magnetic field (steel ship/ferrous metals), then the compass will measure that. That’s not what you want, but there isn’t any way around it.

If your applied field is _constant_, then you might be able to calibrate the compass while your applied field is on in order to ‘subtract’ this constant from your measurements, leaving you with the remaining field. Another option is to fuse the compass reading with a gyroscope, and trust the gyroscope measurements when your magnet is on.

It is a difficult problem to solve… let us know if you fix it!

---

<div class="post-metadata">

**Author:** ![hamid.n888](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@hamid.n888](https://discuss.bluerobotics.com/u/hamid.n888)\
**Post date:** [February 27, 2019, 3:52pm UTC](https://discuss.bluerobotics.com/t/compass-issue-calibration/4463/4 "2019-02-27T15:52:06Z")

</div>

i can’t understand your second recommendation. can you explain more about it? “fuse the compass reading with a gyroscope”

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [February 27, 2019, 5:10pm UTC](https://discuss.bluerobotics.com/t/compass-issue-calibration/4463/5 "2019-02-27T17:10:23Z")

</div>

It is a common thing. Check [here](https://www.google.com/search?q=fuse+compass+gyroscope&oq=fuse+compass+gyroscope&aqs=chrome..69i57.3510j0j7&sourceid=chrome&ie=UTF-8).
