Digital Compass

How well do digital compass ICs (e.g. HMC5843) cope with when rotating rapidly? If I were to rotate one at 1000 RPM, what kind of signal could I expect to get from it?

Would the measured bearing lag considerably, or would the chip simply be unable to calculate a heading at all?

Added: please note, I'm not asking about the sample rate. That is mentioned in the datasheet for every digital compass. What no data sheet seems to mention is if there is a fundamental bandwidth limit for this magneto-resistive technology.

  • 1
    \$\begingroup\$ I'm confused again. How do you define heading if the device is spinning at 1000 rpm? You mean it's bearing? \$\endgroup\$ – Paul Uszak May 19 '17 at 22:51
  • \$\begingroup\$ @pauluszak - fixed. \$\endgroup\$ – Rocketmagnet May 19 '17 at 23:02
  • \$\begingroup\$ Why would the manufacturer want to spit aliased samples at you? I would be surprised to discover that the sampling rates supported by the device don't comply with the Nyquist criterion. \$\endgroup\$ – Enric Blanco May 19 '17 at 23:58
  • \$\begingroup\$ @Enric The manufacturer might add a low-pass filter for anti-aliasing. Then use a slow A/D that's cheaper or consumes less power. Possible valid reason. \$\endgroup\$ – Nick Alexeev May 20 '17 at 1:20
  • \$\begingroup\$ @NickAlexeev Mmmhh... I disagre. A low pass filter that lets aliases through can't be called an anti-aliasing filter. What could happen here (although being weird) is that the anti-aliasing filter might be matched to the lowest sampling rate only, thereby limiting the actual bandwidth regardless of the selected sampling rate. Did you mean that? \$\endgroup\$ – Enric Blanco May 20 '17 at 8:58

The sampling rates available on magnetometers such as the HMC5843 do not come anywhere close to the bandwidth of the underlying anisotropic magnetoresistive element. For proof, we can look at the datasheet for the HMC1001, an analog AMR magnetometer, also from Honeywell. The datasheet states that the bandwidth is from DC to 5 MHz typical. With the 116 Hz sampling rate of your magnetometer, you're not going to be able to detect any bandwidth limitation of the sensor itself.

Incidentally, the HMC5843 is obsolete. You'd be better off with something like the HMC5983 (which is technically obsolete, but widely available) or the MMC5883MA.


The datasheet you linked specifies the maximum output rate as 116Hz. 1000RPM = 16.666 revolutions per second. 116Hz sample rate / 16.666 rev/second means you would have 6 samples per revolution (6.9 roughly, but the next sample would be into the next rotation).

I would recommend using a gyroscope in conjunction with the magnetometer. You can integrate the rotation rate to get a total angular displacement and use that to calculate the bearing, referencing the magnetometer when for corrections.

  • \$\begingroup\$ 1000 RPM is not 1000 Hz. \$\endgroup\$ – Abe Karplus May 19 '17 at 23:15
  • \$\begingroup\$ Whoops, you're right...I'll fix my answer. Thanks for the catch \$\endgroup\$ – alphasierra May 19 '17 at 23:17
  • \$\begingroup\$ But the question remains: would the chip even work at that speed? Would I actually get 6 useful samples at that speed, or does a magnetotesistive sensor have a bandwidth limit? \$\endgroup\$ – Rocketmagnet May 19 '17 at 23:24
  • \$\begingroup\$ Not an expert, but doubt that a gyro can be spun at 1000 RPM. At least not one the authorities would allow you to buy. \$\endgroup\$ – Paul Uszak May 19 '17 at 23:39
  • 1
    \$\begingroup\$ @Paul Uszak there's commercially available gyros which will go over 4000 degrees/second. \$\endgroup\$ – alphasierra May 19 '17 at 23:40

This isn't an answer per se, but rather an answer as to how you can find out. Try it by experiment.

  1. Connect together a small battery, micro controller and the compass.
  2. Assemble on a stout reinforced pcb, laid out symmetrically
  3. Add a spindle of something like M10 studding or bolt and nuts.
  4. Mark and record bearing of PCB wrt a proper compass.
  5. Rotate in drill for brief time. Suggest some form of eye protection.
  6. Record finish bearing.
  7. Repeat several times from different starting bearings.

The micro controller is programmed to read the compass and store the readings in persistent storage. After each test you off load the readings for analysis. You should be able to correlate the start and stop positions recorded electronically with the manual ones. You should also be able to see if the intermediate results make sense.

You could further refine the experiment by incorporating an optical encoder disc onto the studding. That would allow more accurate intermediate calibration.

This might all seem like hassle, but might be the only way to satisfy yourself of the device's capability. Call it product R & D. Are you developing a better Sidewinder?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.