Simple Arduino Tiller Pilot for tiny Yacht

by Microyacht on Wed Dec 15, 2010 3:53 pm

I am constructing a small self-contained "Tiller Pilot" for my little Leisure 17-SL sailing Yacht

(Lashing the tiller or using a wind-vane are not options for various reasons. Neither is purchasing a ready made auto-pilot as it's not in-keeping with MDP for my boating on a budget (MDP = Misers Dream Philosophy))

The unit comprises of just three main components:
Arduino ATmega168 (Already have)
Giant RC Servo Hitec HS-805BB (Already have)
GlobalSat EM406A GPS Module

This is the general layout:
Image

The set button is used to store the current heading obtained from the output from the GPS module into the Arduino
A single PWM output is required to steer the Servo left or right (Port or Starboard) when there is a difference between the stored heading and the current heading. The PWM output is the same as the majority of RC Servos 1.0 to 2.0 ms. 1.5 being straight ahead.

I am OK with the construction including enclosing the unit to keep out seawater and rain.

I have no idea where to start with the code required. It's now 10 years or more since I worked out how to use Basic Stamp BS1's + giant stepper motors to move searchlight beams around the sky on 31st Dec 1999 and the start of the new millennium !

Help please.

Many thanks

Bye for now

Steve
______________________________
Steve Carey
http://www.withamweather.co.uk
Last edited by Microyacht on Sat Jan 15, 2011 4:56 pm, edited 1 time in total.
User avatar
Microyacht
 
Posts: 16
Joined: Mon Dec 13, 2010 6:10 pm
Location: WITHAM, Essex, UK

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Alan Chatham on Wed Dec 15, 2010 4:14 pm

One quick thing to mention, I've been working with that compass module for a couple of months, and it's kinda tricky to work with, and will especially be so on a boat (and especially on a sailboat). Basically, it's not tilt-compensated, and it means that it's really hard to get a good reading if it will be tilting at all. The datasheet says that readings from it will be off up to 2 degrees per degree of tilt, and I have personally found it to be maybe worse than that. Moreover, it's not off by a fixed amount, but rather the amount it will be off by will be a function of both which way it's tilted and how it's facing at the time.

So if your boat is going to be anything but level, depending on how accurate you want your compassing to be, it might not be a really workable solution. I mean, 15 degrees of tilt isn't all that much, depending on the size of the boat, and if that's going to make your reading 30+ degrees off, you might be in trouble. I don't know much about sailing, but will changing the rudder tilt the boat? You might wind up getting into some sort of situation where it tries to turn say, to port, and that makes the compass reading further off, which drives it further to port, and so on.

In terms of practical help, I'd say start playing around with your servo and Arduino - there are some good examples out there for playing around with servos, and there's a good Servo library built in with Arduino, I think. Just don't try and power your servo from the Arduino, and you should be good to go with that side of things. Hope it helps!
OpenChord.org - Open Source kits to let you play Guitar Hero with a real guitar, or build your own Wii/banned/USB controllers.
Alan Chatham
 
Posts: 143
Joined: Thu Feb 04, 2010 1:30 am

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Microyacht on Wed Dec 15, 2010 6:19 pm

Hello Alan,

I thought it was too simple! I'm not sure how Tiller Pilot manufacturers get around the problem but there are Fluxgate module costing 10 times more that have tilt compensation. The actual heading on the fluxgate is immaterial, in fact my unit was never intended to have a display or be the main compass. All that matters is that when sailing on a specific heading using the main "Ships" compass, I would just press the button and store the heading from the fluxgate inside the tiller pilot. The arduino moving the secondary tiller to correct any error due to wave or wind bombardment. I had not considered that even on the same heading that the Fluxgate would be constantly changing.

The giant RC Servo comes with a "Direct" DC lead that bypasses a radio control receiver, as the same applies, could NOT power it from the receiver. Yes, the servo comes straight off the battery. On full load it draws 800mA @ 6V and has a torque of 20kgs/cm. The auxiliary rudder would be long but quite narrow, maybe 4" wide X 24" long? I would actually try the secondary rudder out on it's own to confirm effectiveness.

I wonder if it's worth trying mounting the Fluxgate on a dual-gimble arrangement?

Steve
______________________________________________
Steve Carey
http://www.withamweather.co.uk
User avatar
Microyacht
 
Posts: 16
Joined: Mon Dec 13, 2010 6:10 pm
Location: WITHAM, Essex, UK

Re: Simple Arduino Tiller Pilot for tiny Yacht

by franklin97355 on Wed Dec 15, 2010 10:48 pm

What is it you are trying to accomplish? if all you want is for the boat to point in a specific direction a compass will do but if you want the boat to navigate to a specific location you would be better off with a GPS unit.
User avatar
franklin97355
 
Posts: 2676
Joined: Mon Apr 21, 2008 1:33 pm

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Alan Chatham on Wed Dec 15, 2010 11:22 pm

You might try the double-gimball, if you've got something of the sort lying around. Otherwise, for your application, I think getting the tilt-compensated one like this:
http://www.sparkfun.com/products/8656
will probably save you a lot of headaches.
OpenChord.org - Open Source kits to let you play Guitar Hero with a real guitar, or build your own Wii/banned/USB controllers.
Alan Chatham
 
Posts: 143
Joined: Thu Feb 04, 2010 1:30 am

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Microyacht on Fri Dec 17, 2010 10:01 am

What is it you are trying to accomplish? if all you want is for the boat to point in a specific direction a compass will do but if you want the boat to navigate to a specific location you would be better off with a GPS unit.


NO, a compass won't steer the boat when I sleep or cooking dinner. A GPS won't take me to a specific location unless it's a straight line or I'm in a power boat. The system would be to complicated to cater for 101 "Way points". In a sailboat you "Tack" in a series of zig-zags because a boat will not sail directly into the wind. Might be as much as 40º off on either direction Port or starboard to the wind but you head in the general direction that you want to go. Sails are trimmed to suit the tack. Supposing the tack was 10 miles before changing to the opposite tack. I want to hit the SET button and steer say, 155º for the next few hours with the helm unattended!

Commercially made units are available at upwards of 10 times the cost of the basic components. I try to make as many things as I can. Much easier to understand should they go wrong!

Steve
___________________________________
Steve Carey
http://www.withamweather.co.uk
User avatar
Microyacht
 
Posts: 16
Joined: Mon Dec 13, 2010 6:10 pm
Location: WITHAM, Essex, UK

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Microyacht on Fri Dec 17, 2010 10:11 am

You might try the double-gimball, if you've got something of the sort lying around. Otherwise, for your application, I think getting the tilt-compensated one like this:
http://www.sparkfun.com/products/8656
will probably save you a lot of headaches.


Thanks Alan. I've seen them and there is a HUGE difference in cost! That adds $100 to the cost of the project . . . having said that, it may be the only reliable solution. I won't be sailing again until 1st April 2011, so I have a bit of time. As I already have everything else in stock apart from the enclosure which I may actually make myself from GRP, I may just "Bite the bullet" and spend the extra on the Fluxgate unit. Perhaps I'll talk to Santa . . . . . . .

Steve
____________________________________
Steve Carey
http://www.withamweather.co.uk
User avatar
Microyacht
 
Posts: 16
Joined: Mon Dec 13, 2010 6:10 pm
Location: WITHAM, Essex, UK

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Alan Chatham on Fri Dec 17, 2010 2:59 pm

Yeah, it's a hard trade-off when you're trying to keep things banned. I'm still using the el-cheapo unit, but that's because I'm trying to make something that might eventually go into some sort of production run. On the other hand, it's taken me literally weeks of time working with that unit and coding solutions to get something that manages to reliably figure out yaw, +-30 degrees or so for an application that tilts a maximum of 15 degrees. So I'd say your choices come down to paying an extra $100 and having something that has a good chance of working, or building something that juuust works, but is broken enough make you realize you just wasted a lot of time making something that, realistically, is wholly unusable.

Oh! One big thing to mention! Keep your compass unit, whatever one you get, away from as much wiring as possible! The earth's magnetic field isn't all that strong, and current passing by near the sensor chip will totally throw your readings off/make them all sorts of unreliable. FYI.
OpenChord.org - Open Source kits to let you play Guitar Hero with a real guitar, or build your own Wii/banned/USB controllers.
Alan Chatham
 
Posts: 143
Joined: Thu Feb 04, 2010 1:30 am

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Microyacht on Wed Dec 29, 2010 6:37 pm

Hello Alan,

I've been away for a few days and also had to get my boat hauled out and transport her home. She was buried under a huge pile of snow for 2 weeks and I was unable to get through the main hatch to get inside the cabin. When it was warm, before the snow:

Image

Hope you had a nice Christmas and all the best for the new year.

It's a pity I'd not already purchased the fluxgate because I could of had a play. Theory and practice don't normally agree! In fact, many years ago a tutor said to me "When Theory and practice agree . . . worry"

It would be interesting to actually see the variation using the Fluxgate hooked up to the Arduino and an LCD display! I then thought what about using a banned PCB GPS module. There should be little if no variation but the unit could still be gimbaled in order to keep all the current satellites in sight of the aerial. Then I had yet another thought . . . "AVERAGING"

Suppose my intended course is 260º. The fluxgate is varying between 255º and 265º. The Arduino could perhaps take readings over say for a 10 second period, take an average and then respond to the Servo? As it's wind and wave that are affecting the actual course, I doubt if we'd end up with a symmetrical ± figure. Perhaps more like + 7 and − 3 or whatever. To compensate for this, there could be two additional buttons on the unit that are + and - 1º to the stored number (heading in º) for every push of the button. The entry would then most likely remain true for the period of that Tack until I change the boat to another tack (zigzagging across the wind).

I have to do some urgent work on the boat. All 5 windows need removing as they leak slightly. They are all surface mounted and bedded onto mastic. Over the years it has gone hard and cracked. All need re-bedding on new mastic/sealant. When I've got this out of the way, I'll purchase a Fluxgate Compass Module and take it from there.

Bye for now.

Steve
___________________________________
Steve Carey
http://www.withamweather.co.uk
User avatar
Microyacht
 
Posts: 16
Joined: Mon Dec 13, 2010 6:10 pm
Location: WITHAM, Essex, UK

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Entropy on Mon Jan 03, 2011 10:54 am

Hmm, a thought here:

WARNING: I may have swapped the definitions of heading and bearing here, I'm currently using:
Bearing - Which direction the boat is pointing - Available from a compass module
Heading - Which direction the boat is traveling (may differ from bearing due to currents/wind) - Available from a GPS module

For what you're trying to do, do you actually need to know the boat's current bearing, or just the heading to keep it going in the same direction? In fact, wouldn't you want to compensate for wind/currents and use heading?

In this case, I think the best bet for you might be to use a GPS module and extract heading/speed information and use this to control the boat?

(Best would be to combine the two, and use the compass to compensate for significant divergence of bearing/heading at low speeds. As your speed increases, these should diverge less.)
Entropy
 
Posts: 472
Joined: Mon Jan 07, 2008 11:43 pm
Location: Owego, NY USA

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Microyacht on Mon Jan 03, 2011 5:34 pm

The unit just needs to keep the boat on the current heading whatever that maybe. On the same tack would be a better description. So when I hit the "SET" button, I want to stay on that course as long as possible and until I tell it otherwise by killing the unit, setting a new head from the boats main compass and then pressing the "SET" button again.

For the sake of "getting Started", I'd like to forget wave motion and the rocking effects o the boat and imagine the water is dead flat. I'm sure there will be away around the sea motion using a combination of mechanics and software tweaks!

Thanks everso much everyone for your help so far.

Happy New Year

Bye for now
Steve
User avatar
Microyacht
 
Posts: 16
Joined: Mon Dec 13, 2010 6:10 pm
Location: WITHAM, Essex, UK

Re: Simple Arduino Tiller Pilot for tiny Yacht

by jdl2001 on Mon Jan 03, 2011 7:02 pm

Entropy wrote:Bearing - Which direction the boat is pointing - Available from a compass module
Heading - Which direction the boat is traveling (may differ from bearing due to currents/wind) - Available from a GPS module

Bearing is the direction to another point (e.g., lighthouse, point of land, etc).
Heading is the direction the boat is pointing.
Track is usually the name for the actual direction the boat is moving.

A single GPS can only provide track, a compass can only provide heading. Your comment about them converging/diverging at high/low speeds is spot on.

Steve,
I've integrated a digital compass PNI-TCM2 which is pitch/roll compensated( http://www.mil.ufl.edu/projects/gnuman/ ... m2_man.pdf) with a GPS (EM406a) and accelerometer (ADXL335) to characterize sailboat dynamics. I keep everything in an Otterbox and normally can keep it below and still have acceptable GPS reception. I know you've thought about how to package everything to protect the system from the elements, could you share what you're thinking?

Please keep us in the loop,
Jim
jdl2001
 
Posts: 86
Joined: Sun Mar 08, 2009 11:53 am

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Microyacht on Tue Jan 04, 2011 11:29 am

Hi Jim

I've looked at the spec for the Digital Compass PNI-TCM2 Module. Very impressive and I have no doubt that it would be the way to go apart from cost. I feel it's outside the scope of my "Simple Arduino Tiller Pilot for Tiny Yacht". By "Simple", I should have also defined : banned! It may well be that my "Simple" won't work but my whole life has been driven by MDP (Misers Dream Philosophy !) and finding a way to adapt/modify low cost items to do a job. I think I can gimbal mount the fluxgate module to sufficiently dampen the movement to obtain an accurate enough input that represents the tack I wish to maintain.

Last year I tested a low cost gimbaled fluxgate compass with built-in LCD display designed for use in cars. I fitted it to the handlebars on my Mountain bike and set off down a trail. Although bouncing all over the place, I was heading pretty much in the same direction. The display was very constant. It would have been a good unit to canaballise and feed the output into the Arduino maybe.

For the housing, I was going to initially use a sealed H/D Plastic box with and external 12V power from the boats main battery. BUT later make a custom GRP enclosure.

BFN

Steve
User avatar
Microyacht
 
Posts: 16
Joined: Mon Dec 13, 2010 6:10 pm
Location: WITHAM, Essex, UK

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Entropy on Wed Jan 05, 2011 1:13 pm

I think you may be better off using a GPS receiver module - extract your track information and hold that, this will let you compensate for currents.

It'll fail at very low speed though.
Entropy
 
Posts: 472
Joined: Mon Jan 07, 2008 11:43 pm
Location: Owego, NY USA

Re: Simple Arduino Tiller Pilot for tiny Yacht

by Microyacht on Wed Jan 05, 2011 3:40 pm

There are many PCB GPS units around that cost about the same or little more than a Flugate module. I'll have a hunt around and see what's readily available in the UK. Later on, I could add an LCD display and take advantage of the actual position as well as tack heading. The boat already has a GPS repeater.

Steve
_________________________________
Steve Carey
http://www.withamweather.co.uk
User avatar
Microyacht
 
Posts: 16
Joined: Mon Dec 13, 2010 6:10 pm
Location: WITHAM, Essex, UK