NXC: how to calibrate the HT Compass sensor?
NXC: how to calibrate the HT Compass sensor?
hi,
I just tested my new platform by odometry, HTgyro, and HTcompass, and all are fine - except the compass (real weird values, such as +/- 45°-60° although turned +/- 90°).
It was long time out of use, so I guess it has to be recalibrated (last time I used it - about 4 years ago - it it was quite ok).
Does anybody know how the calibration has to be done by NXC?
I just tested my new platform by odometry, HTgyro, and HTcompass, and all are fine - except the compass (real weird values, such as +/- 45°-60° although turned +/- 90°).
It was long time out of use, so I guess it has to be recalibrated (last time I used it - about 4 years ago - it it was quite ok).
Does anybody know how the calibration has to be done by NXC?
Re: NXC: how to calibrate the HT Compass sensor?
From the HiTechnic page http://www.hitechnic.com/cgi-bin/commer ... ey=NMC1034
However, I just got my compass, and was also noticing some odd readings while testing it out. I finally figured out that it's very sensitive to it's horizontal attitude. In other words, I could hold it steady at a constant bearing, but the value would change if I rotated the sensor up or down from horizontal. I haven't seen anyone else comment on this so I'm not sure if it's just mine or a common issue. I could understand the value changing a bit if I tilted the compass a lot, but I'm just talking a few degrees here. I'd think once I put this on a moving robot, just normal jostling around as the robot drove would cause this same error. Could this possible be part of your problem too?
Thanks,
Jason
Or if you use mightor's driver suite, he has that added for you.Calibrating the Compass Sensor
The HiTechnic compass sensor will be influenced by local magnetic interference in the same way as any other magnetic compass. Objects such as metal items, motors, batteries and wires can cause magnetic interference. Local magnetic interference may cause the compass to output a heading several degrees different than the actual magnetic heading. This is called compass deviation. To correct for deviation, the HiTechnic compass sensor has a built in calibration function that calculates correction offsets and stores them in the compass.
Calibration is optional and usually not required for normal operation. To minimize the need for calibration make sure you mount the compass at least 4 – 6 inches (10 – 15 cm) away from the NXT and NXT motors.
To calibrate the compass under program control, select calibration mode (value 2 wired to the Action plug input) and then program your robot to rotate (turn in a tight circle) between 1 ½ and 2 times (more than 360 degrees) so it completes a full turn in about 20 seconds. Once the turns have been completed, set the Action to a Read function (Absolute or Relative) and the compass will be calibrated. The compass will retain the calibration settings until another calibration is performed, even if it is unplugged.
However, I just got my compass, and was also noticing some odd readings while testing it out. I finally figured out that it's very sensitive to it's horizontal attitude. In other words, I could hold it steady at a constant bearing, but the value would change if I rotated the sensor up or down from horizontal. I haven't seen anyone else comment on this so I'm not sure if it's just mine or a common issue. I could understand the value changing a bit if I tilted the compass a lot, but I'm just talking a few degrees here. I'd think once I put this on a moving robot, just normal jostling around as the robot drove would cause this same error. Could this possible be part of your problem too?
Thanks,
Jason
Re: NXC: how to calibrate the HT Compass sensor?
it's really a compass issue, nothing else (some years ago it worked rather sufficiently at least outside the house in the garden, but as time goes by...).
(Maybe refer to the Gyro noise thread where I decribed both readings.)
All electrical and ferromagnetical parts are more than 20 cm away from the compass (and no motors are running during compass test readings).
The compass is mounted 100% horizontally. Of course, maybe the HT compass is meanwhile defective although not in use for several years.
As it's a NXC question, and because (re-)calibration shall become an integral part of my navigator robot I would need NXC code - have you or anyone got one?
(Maybe refer to the Gyro noise thread where I decribed both readings.)
All electrical and ferromagnetical parts are more than 20 cm away from the compass (and no motors are running during compass test readings).
The compass is mounted 100% horizontally. Of course, maybe the HT compass is meanwhile defective although not in use for several years.
As it's a NXC question, and because (re-)calibration shall become an integral part of my navigator robot I would need NXC code - have you or anyone got one?
Re: NXC: how to calibrate the HT Compass sensor?
Doc,
Some compasses need to be degaussed from time to time. I don't think the HT sensor has a degaussing method.
Anyway, here is a paper describing a calibration algorhithm, just in case you do not want to use the on board method.
Some compasses need to be degaussed from time to time. I don't think the HT sensor has a degaussing method.
Anyway, here is a paper describing a calibration algorhithm, just in case you do not want to use the on board method.
My blog: nxttime.wordpress.com
Re: NXC: how to calibrate the HT Compass sensor?
I can't write code for i2c devices.
Re: NXC: how to calibrate the HT Compass sensor?
Check the bottom of this thread for some NXC code to calibrate your compass. Hope it helps!
http://sourceforge.net/apps/phpbb/mindb ... 96292a8673
http://sourceforge.net/apps/phpbb/mindb ... 96292a8673
Re: NXC: how to calibrate the HT Compass sensor?
very kind, thx a lot! I'll check it immediately!
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: how to calibrate the HT Compass sensor?
Surely you can learn to write I2C related code. If you want, I'll share my I2C library with you. It's a general purpose I2C library, and you may learn a thing or two from examining it (or use it as it is). It doesn't have special purpose functions, just general sensor read and write abilities.doc-helmut wrote:I can't write code for i2c devices.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXC: how to calibrate the HT Compass sensor?
matt,
I'll glady contact you if I'll have again a problem like that.
jasonlh,
the calibration worked! At least for outdoors. "North" is indicated correctly outdoors.
Unfortunately is shows that a compass is often not suitable for indoors:
As I know exactly where direction "North" is, indoors the compass indicates "North" where actually NorthWest is.
Also the relative bearings still have a big deviation.
Not very well for my indoors navigation. :(
I'll glady contact you if I'll have again a problem like that.
jasonlh,
the calibration worked! At least for outdoors. "North" is indicated correctly outdoors.
Unfortunately is shows that a compass is often not suitable for indoors:
As I know exactly where direction "North" is, indoors the compass indicates "North" where actually NorthWest is.
Also the relative bearings still have a big deviation.
Not very well for my indoors navigation. :(
Re: NXC: how to calibrate the HT Compass sensor?
Glad that helped. Now I'm curious how much the error I was seeing was due to being inside my house too? I'll have to play a bit more with it this weekend.
When inside, maybe you could use a "compass" like this!
(I thought you might like this after reading some of your posts about odometry).
Slightly off topic, but I can't find any old posts about how sensitive the compass is to tilt? Does anyone know a good link discussing this? I guess I just don't understand how the solid state compass works, but I can't wrap my mind around why a little tilt would be such a big deal? I also got a GPS sensor and was going to use in conjunction with the compass to navigate around my neighborhood. Do I also need to use an accelerometer to determine if the robot is level when using the compass? What do I do if I need to travel up or down a slight hill, is the error linear to the tilt?
Thanks!
Jason
When inside, maybe you could use a "compass" like this!
(I thought you might like this after reading some of your posts about odometry).
Slightly off topic, but I can't find any old posts about how sensitive the compass is to tilt? Does anyone know a good link discussing this? I guess I just don't understand how the solid state compass works, but I can't wrap my mind around why a little tilt would be such a big deal? I also got a GPS sensor and was going to use in conjunction with the compass to navigate around my neighborhood. Do I also need to use an accelerometer to determine if the robot is level when using the compass? What do I do if I need to travel up or down a slight hill, is the error linear to the tilt?
Thanks!
Jason
Who is online
Users browsing this forum: No registered users and 0 guests