0

Compass vs Gyro for a simple autohelm
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Compass vs Gyro for a simple autohelm

by rainymaker on Wed Jan 28, 2009 4:03 pm

Hi - I'm working on a simple arduino based auto pilot for my 31' sailboat. All the device needs to do is HOLD a course. I'd primarily use it when motoring so that I could have it hold my present course while I get a fresh beer, etc.

The device does not need display the course or do any interfacing with my other marine electronics. It just needs to keep the boat pointed in the same direction I left it.

I've been looking a various compass modules that seem like they'd do the trick, but I was wondering if a gyro module would also work. I only need 5-10 degrees of precision.

Can anyone offer any insight into whether a gyro may be a suitable choice for such a project?

Thanks tons!!!!!!
rainymaker
 
Posts: 1
Joined: Wed Jan 07, 2009 12:59 pm
Location: Seattle

Re: Compass vs Gyro for a simple autohelm

by Amberwolf on Wed Jan 28, 2009 10:08 pm

You could probably do it even with just a MEMS accelerometer chip. The one in my STM32Circle devbox is sensitive enough to changes in direction that it can be used as a mouse. I'm not sure how well it would work if the course change was a very slow one, but if you only need such a low precision anyway, I suspect it would work.
Watch me build an electric bike from assorted junk!
Alternative Energy Sources for the Home from Recycled Junk
A subsidiary of Cybernetic Necromancers, Discorporated:
"We Bring Dead Things To Life"
Amberwolf
 
Posts: 310
Joined: Wed Oct 08, 2008 2:42 am
Location: Phoenix, AZ, USA

Re: Compass vs Gyro for a simple autohelm

by samuel on Mon Mar 29, 2010 7:02 pm

Hi !

It will be better using a compass like this one http://www.superdroidrobots.com/shop/it ... 8&catid=35
It has 0.1 resolution degrees with an error fo 3-4 degrees. Its output could be I2C or PWM ;)
samuel
 
Posts: 6
Joined: Tue Feb 16, 2010 1:11 pm

Re: Compass vs Gyro for a simple autohelm

by jdl2001 on Mon Mar 29, 2010 7:55 pm

samuel wrote:Hi !

It will be better using a compass like this one http://www.superdroidrobots.com/shop/it ... 8&catid=35
It has 0.1 resolution degrees with an error fo 3-4 degrees. Its output could be I2C or PWM ;)


2-axis compass won't cut it if he decides to sail due to heel angle and pitch will also be a problem in any kind of seaway. I'd look into a GPS-based solution; I realize it's track and not heading but you could write code that the autopilot just holds the present track once it's engaged. As long as you're moving a few knots or more, track is reasonably consistent but you'll probably want to play a bit with averaging/damping to avoid overworking the motors but that's the fun part. I've had good luck using the EM-406a on a number of sailboats from below in the cabin and it's had no trouble establishing and holding a fix.

You could continue to build on the simple approach to navigate to waypoints, navigate routes (multiple WPs), etc.

Good luck and please report back on your efforts.
jdl2001
 
Posts: 86
Joined: Sun Mar 08, 2009 12:53 pm

Re: Compass vs Gyro for a simple autohelm

by zener on Tue Mar 30, 2010 12:40 am

Not really answering your question, but this is a cool part:

http://www.st.com/stonline/products/fam ... 303dlh.htm

zener
 
Posts: 4483
Joined: Sat Feb 21, 2009 2:38 am

Re: Compass vs Gyro for a simple autohelm

by Entropy on Tue Mar 30, 2010 9:34 am

A gyro alone will NOT be sufficient - gyros (especially MEMS gyros) are prone to drift.

Use a magnetic sensor (compass).

Adding GPS may help (and in fact will definately help when heading != track), but you need the compass for slow speeds.
Entropy
 
Posts: 472
Joined: Tue Jan 08, 2008 12:43 am
Location: Owego, NY USA

Re: Compass vs Gyro for a simple autohelm

by sirket on Tue Mar 30, 2010 2:56 pm

In short:

Accelerometers and compass modules are accurate over the long term- gyros are accurate over the short term. Gyro's alone will be next to useless for you. A compass module will be much more accurate for what you want to do.

That said- you would likely need a tilt compensated compass for use in a boat, and those are very expensive- about 2 to 3 times the price of a GPS module. A GPS module won't give you heading, but it will give you track, speed, position, etc. GPS plus a basic non-tilt compensated compass would still be cheaper than a tilt compensated compass and should be accurate enough for your needs.
sirket
 
Posts: 128
Joined: Fri Oct 26, 2007 8:46 pm
Location: NYC

Re: Compass vs Gyro for a simple autohelm

by Entropy on Wed Mar 31, 2010 9:21 am

Actually, accelerometers fit in with gyros as things that have long-term drift but short-term accuracy, which is why they're used to filter GPS position fixes (long-term stability with a lot of short-term noise).

Many modern handheld GPS units have a tilt-compensated compass, and with the right cable I am fairly certain you can get NMEA output from the newer Garmin Oregons (the higher-end ones have 3-axis tilt-compensated compasses.)
Entropy
 
Posts: 472
Joined: Tue Jan 08, 2008 12:43 am
Location: Owego, NY USA

Re: Compass vs Gyro for a simple autohelm

by sirket on Wed Mar 31, 2010 10:39 am

Entropy wrote:Actually, accelerometers fit in with gyros as things that have long-term drift but short-term accuracy, which is why they're used to filter GPS position fixes (long-term stability with a lot of short-term noise).

Sorry- I think we're referring to different uses of accelerometers. In an IMU you generally use the accelerometers to measure gravity, and as such, they are accurate over the long term- but can be inaccurate in the short term.

Entropy wrote:Many modern handheld GPS units have a tilt-compensated compass, and with the right cable I am fairly certain you can get NMEA output from the newer Garmin Oregons (the higher-end ones have 3-axis tilt-compensated compasses.)

Sure, but that's a large unit to be sticking on a small boat.

A single chip tilt compensated compass such as:
http://www.sparkfun.com/commerce/product_info.php?products_id=8951

is nicer, but very pricey.
sirket
 
Posts: 128
Joined: Fri Oct 26, 2007 8:46 pm
Location: NYC

Re: Compass vs Gyro for a simple autohelm

by zener on Wed Mar 31, 2010 2:07 pm

The chip I posted is the same (for 1/10 of the price) except doesn't include the processor to sort everything out.

zener
 
Posts: 4483
Joined: Sat Feb 21, 2009 2:38 am

Re: Compass vs Gyro for a simple autohelm

by jdl2001 on Wed Mar 31, 2010 2:20 pm

Zener wrote:The chip I posted is the same (for 1/10 of the price) except doesn't include the processor to sort everything out.


Do you have a link to a retailer? Thanks!

I'm sure by now the OP has realized that two bungees work well enough and to be sure, added a cooler to the cockpit.
jdl2001
 
Posts: 86
Joined: Sun Mar 08, 2009 12:53 pm

Re: Compass vs Gyro for a simple autohelm

by franklin97355 on Wed Mar 31, 2010 3:22 pm

DigiKey has them.

franklin97355
 
Posts: 21362
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Compass vs Gyro for a simple autohelm

by jdl2001 on Wed Mar 31, 2010 3:45 pm

franklin97355 wrote:DigiKey has them.


SMT to an old guy with bad vision/shaky soldering skills? Cruel, just plain cruel! :)
jdl2001
 
Posts: 86
Joined: Sun Mar 08, 2009 12:53 pm

Re: Compass vs Gyro for a simple autohelm

by Entropy on Thu Apr 01, 2010 9:26 am

sirket wrote:Sure, but that's a large unit to be sticking on a small boat.

A single chip tilt compensated compass such as:
http://www.sparkfun.com/commerce/product_info.php?products_id=8951

is nicer, but very pricey.

A 31' sailboat is not exactly small... I take handheld GPS units (similar in size to the Oregons - I haven't been canoeing since purchasing mine) on canoeing trips!
Entropy
 
Posts: 472
Joined: Tue Jan 08, 2008 12:43 am
Location: Owego, NY USA

Re: Compass vs Gyro for a simple autohelm

by sirket on Fri Apr 02, 2010 12:11 pm

Sorry- for some reason I thought this was for a model- I must have read 31" instead of 31'.

There are lots of good, inexpensive and/or used units available for less than I would think you could probably build your own unit for. I know people like to build their own tools- but when your life is on the line a thoroughly tested commercial unit sounds like a good idea. When I sail I prefer a simple windvane- draws no power and is a lot less likely to fail :)
sirket
 
Posts: 128
Joined: Fri Oct 26, 2007 8:46 pm
Location: NYC

Please be positive and constructive with your questions and comments.