View Single Post
  #2   Spotlight this post!  
Unread 12-03-2008, 01:21
Matt H. Matt H. is offline
Long Distance Mentor
FRC #1726 (N.E.R.D.S.)
Team Role: Alumni
 
Join Date: May 2006
Rookie Year: 2007
Location: Sierra Vista, AZ
Posts: 238
Matt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond repute
Re: HM55B Digital Compass - How do I program the controller to read it?

I'd be very careful using any kind of compass on your robot--the magnetic fields produced by your motors and even in the straight wiring connections of your robot will produce a large magnetic field simply because of the amperage they are using. The earths magnetic field is only .05 mT which will easily be overwhelmed by the magnetic fields created by your robot.

A brief calculation
the magnetic field generated by a 80Amps flowing through a long straight wire (a situation which approximates the wiring on your robot under low load) from .5m (assuming optimal mounting of your compass) away is

B=u*I/(2(pi)*r)
B=1.256*10^-6*80/(2*(3.14)*.5)
B=.03mT which is more than enough to throw off your compass.

This calculation also does not take into account windings in your motors and other sources of a magnetic field which will make your compass essentially useless.

To solve your problem it might be better to try using the gyro which measures change in angle and driving straight by measuring change in angle and correcting.