Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 04-04-2017, 18:02   #16
Registered User
 
GILow's Avatar

Join Date: Sep 2008
Location: On the boat, somewhere in Australia.
Boat: Swanson 42 & Kelly Peterson 44
Posts: 9,155
Re: Homemade tiller autopilot

Quote:
Originally Posted by DeepFrz View Post
Not so simple if you want a unit that will handle all sea states and steer to wind taking into consideration surfing down wave fronts. A steer around the pond unit is pretty simple.
Very true. There were a surprising number of variables to track in my final version of the code.

I started out thinking all I had to worry about was the heading, but before you know it you need to track rudder position, response rate and re-centring delay on the helm.

Then once you add a bit of learning in there it gets quite busy from a code perspective.

I found some variables so hard to predict in advance that I simply put a couple of variable resistors on the prototype so that I could dial them in as the boat was sailing. Some of the numbers around helm delays and neutralising the helm were very different to what I was expecting.

A gyro would have helped, so I am interested in SP's idea.

As it was, I did not have a good enough linear actuator to test the system in anything but ideal conditions, so I will never know how it would have coped.

I may get a chance soon though, as my 30 year old Course Master is slowly dying of dry solder joint problems, and despite my best efforts I think I will lose it soon. Thankfully the drive motor is still fine and expected to last a long time, so replacing the brains of the machine is all I will have to do. I am still thinking picaxe but I am tempted by SP's idea. Giving it some thought... do I really want an aging IPhone 5S driving my boat...?

Matt
__________________
Refitting… again.
GILow is offline   Reply With Quote
Old 04-04-2017, 18:02   #17
Registered User
 
Tacmed's Avatar

Join Date: Nov 2013
Location: Brisbane Australia
Boat: Boden 36ft sloop
Posts: 77
Re: Homemade tiller autopilot

Quote:
Originally Posted by Tacmed View Post
I used to write software for a living. I use the same PID formula that raymarine and the others use. You are correct, it isnt simple, but mine works better than my autohelm with extra functions. I can also repair my own equipme t, which was my original motivation. I am a live aboard cruiser so self reliance is important to me.
https://en.m.wikipedia.org/wiki/PID_controller
Tacmed is offline   Reply With Quote
Old 04-04-2017, 18:11   #18
Registered User
 
GILow's Avatar

Join Date: Sep 2008
Location: On the boat, somewhere in Australia.
Boat: Swanson 42 & Kelly Peterson 44
Posts: 9,155
Re: Homemade tiller autopilot

Quote:
Originally Posted by Tacmed View Post
That looks a hell of a lot like Newtonian convergence from here.

My algorithm was a lot less sophisticated, the maths library on the picaxe is very limited, but in short I kept track of the last guess and added an error result to it after the correction. Then I averaged the last ten (I think) corrections and calculated the next correction based on the result of that average.

Crude, but it seemed to work.

A more powerful piece of hardware could probably work with that sort of formula.

(Unless it was an early Pentium chip, in which case the floating point error would probably blow it out of the water.)


Matt
__________________
Refitting… again.
GILow is offline   Reply With Quote
Old 04-04-2017, 18:13   #19
Registered User
 
Tacmed's Avatar

Join Date: Nov 2013
Location: Brisbane Australia
Boat: Boden 36ft sloop
Posts: 77
Re: Homemade tiller autopilot

Quote:
Originally Posted by GILow View Post
That looks a hell of a lot like Newtonian convergence from here.

My algorithm was a lot less sophisticated, the maths library on the picaxe is very limited, but in short I kept track of the last guess and added an error result to it after the correction. Then I averaged the last ten (I think) corrections and calculated the next correction based on the result of that average.

Crude, but it seemed to work.

A more powerful piece of hardware could probably work with that sort of formula.

(Unless it was an early Pentium chip, in which case the floating point error would probably blow it out of the water.)


Matt
Looks worse than is is. Quadcopters use the same system.
Tacmed is offline   Reply With Quote
Old 04-04-2017, 18:44   #20
Registered User
 
GILow's Avatar

Join Date: Sep 2008
Location: On the boat, somewhere in Australia.
Boat: Swanson 42 & Kelly Peterson 44
Posts: 9,155
Re: Homemade tiller autopilot

Quote:
Originally Posted by Tacmed View Post
Looks worse than is is. Quadcopters use the same system.


I wonder what chipset they use. You need a decent maths library for basic differential integration. .
__________________
Refitting… again.
GILow is offline   Reply With Quote
Old 04-04-2017, 19:10   #21
Registered User
 
DeepFrz's Avatar

Cruisers Forum Supporter

Join Date: Mar 2006
Location: Winnipeg
Boat: None at this time
Posts: 8,462
Re: Homemade tiller autopilot

Arduino has PID libraries that should simplify things.
DeepFrz is offline   Reply With Quote
Old 04-04-2017, 19:30   #22
Registered User

Join Date: May 2011
Location: Lake Ont
Posts: 8,548
Re: Homemade tiller autopilot

Cool thread.

I think if I was asked to do an autopilot from scratch, I'd use something like a Raspberry Pi 3:
  • more horsepower than a microcontroller
  • lots of I/O ports - digital, serial, I2S, etc
  • USB inputs - keboard/mice, USB GPS module, etc
  • Ethernet or wifi to the boat's network for additional inputs, broadcasting status, alarms, remote terminal on a tablet, etc
  • Can drive a video display
  • Linux OS, which gives lots of flexibility
    • wide choice of development languages
    • many libraries
    • other marine apps could run concurrently - eg OpenCPN
Anyway, keep us appraised. Good luck!
Lake-Effect is offline   Reply With Quote
Old 04-04-2017, 19:34   #23
Registered User
 
GILow's Avatar

Join Date: Sep 2008
Location: On the boat, somewhere in Australia.
Boat: Swanson 42 & Kelly Peterson 44
Posts: 9,155
Re: Homemade tiller autopilot

Quote:
Originally Posted by DeepFrz View Post
Arduino has PID libraries that should simplify things.


Not fair!
__________________
Refitting… again.
GILow is offline   Reply With Quote
Old 05-04-2017, 01:32   #24
Registered User
 
Tacmed's Avatar

Join Date: Nov 2013
Location: Brisbane Australia
Boat: Boden 36ft sloop
Posts: 77
Re: Homemade tiller autopilot

Quote:
Originally Posted by GILow View Post
I wonder what chipset they use. You need a decent maths library for basic differential integration. .
A lot of the leading flight controllers use the same Atmel chip as used on the Arduino UNO. Written in C. Tilt compensated giro and compas, barrometric pressure sensor. Motor control is performed by motor control modules which take care of prop speed without putting the pwm overhead on the main Atmel chip.
Tacmed is offline   Reply With Quote
Old 05-04-2017, 17:04   #25
Registered User

Join Date: Mar 2017
Location: Chile
Boat: Lagoon 620, In my dreams
Posts: 13
Re: Homemade tiller autopilot

In your parts list, you should also include a motor controller to interface from your controller to the motor. Those can run you about $100 for powering a decent sized linear actuator, but you don't have to mess around with DPDT switches.

I've coded and tested a full authority autopilot for aircraft. It is able to fly a 747 (in X10 simulation) from one field to another completely unmanned from full stop to full stop.

Yes, a boat is different, but I figure if I could conquer that challenge I might be able to help a bit with your autopilot if you want to discuss it with me. It's a project I plan to do someday anyway.
Maker42 is offline   Reply With Quote
Old 09-12-2017, 09:24   #26
Registered User

Join Date: Sep 2012
Posts: 257
Re: Homemade tiller autopilot

Tecmed, do you still have the code for your autopilot... I would really like to look at it, if you don't mind. I'm not about tearing down ideas.. but if you have had good luck with it, I would really like to compare to what for me has not worked!

Personally, I have given up on PID and have been studying fuzzy logic. After distilling it for months, read, think, read, think etc, I think I have figured out the gist of it.
The cool thing about fuzzy logic is that that once a surface control map/s is developed for the controller it can be tweaked and does not have to be linear in any way. In fact I can see how counter steering can be put into place rather easily to slow the rate of change as the boat comes back to course. I could never do that with PID, way too rigid. On top of that various control maps can be loaded on the fly for various sea states.. the trick is knowing when to do that..

Also fuzzy logic has the ability to self learn, even though I doubt that will be needed and will likely only make the controller excessively complex. I have an old Autohelm 4000 that controls my boat just fine, but it is obsolete and can be unreliable. I'm looking for a software solution I can port to different platforms. We have a huge choice of hardware platforms these days.

Thanks,

Dave
Dave9111 is offline   Reply With Quote
Old 09-12-2017, 10:25   #27
Registered User
 
thomm225's Avatar

Join Date: Aug 2011
Location: Lower Chesapeake Bay Area
Boat: Bristol 27
Posts: 10,553
Re: Homemade tiller autopilot

Quote:
Originally Posted by Brasshopper View Post
So, I can't help but thinking ahead to when I get my boat fixed. I have seen stand alone autopilots that take control of the tiller. I thought about it and this is my hardware list to replicate such an autopilot. Arduino board, $10. Wifi shield, (optional, maybe not release 1) $20. Display board with pushbuttons for control, $12. Waterproof box, $6. Linear actuator with position reporting, $135. Hookup wire, $40. 9 degree of freedom sensor with included flux gate compass, $10.
How about this used Simrad TP10 already built and tested.

Asking price $199.00

https://www.ebay.com/itm/Pre-owned-S...NaKvn7&vxp=mtr
thomm225 is offline   Reply With Quote
Old 09-12-2017, 11:14   #28
Registered User

Join Date: May 2014
Location: USA
Boat: 41' yawl
Posts: 1,187
Re: Homemade tiller autopilot

Hmm. So a basic PID control loop will look at your present heading and your intended heading and make adjustments to helm direction based on three terms (P, I, and D) to account for the present error ("woah, we are 20 degrees off course!") , the past error ("hmm, we've been off by about 2 degrees to port this whole time"), and the predicted future error ("yikes, this boat's turning awfully fast, better slow down so we don't overshoot.")

I think in the absence of waves its probably totally sufficient. But a model of the boat that just looks at present heading and tiller location is unable to account for all the other weird stuff that happens when you zip down a wave, etc. I think the special sauce in marine autopilots is that they are really looking at the whole, 3-dimensional picture.

Neural networks are interesting for this - the normal approach ("supervised learning") needs lots (thousands) of training examples (Here's a picture of a cat, it's a cat.) which you'd have to generate yourself by having all your sensors up and running and just collecting YOUR steering choices. So you'd manually create training examples by just using your boat. That's pretty neat, I wonder if it would get you enough data though...

Another, newer approach is "reinforcement learning" where you don't have training examples, I've never actually done anything with this but I *think* the network just looks at it's present state and intended state kinda like a PID, but rather than just a couple terms dictating the response you have a whole network full of past and present context to help choose the next action.
chris95040 is offline   Reply With Quote
Old 09-12-2017, 18:25   #29
Registered User
 
Tacmed's Avatar

Join Date: Nov 2013
Location: Brisbane Australia
Boat: Boden 36ft sloop
Posts: 77
Re: Homemade tiller autopilot

Do you have tiller position feedback as part of you P.I.D?
Tacmed is offline   Reply With Quote
Old 09-12-2017, 19:18   #30
Senior Cruiser
 
hpeer's Avatar

Cruisers Forum Supporter

Join Date: Dec 2008
Location: Between Caribbean and Canada
Boat: Murray 33-Chouette & Pape Steelmaid-44-Safara-both steel cutters
Posts: 8,576
Re: Homemade tiller autopilot

Some fellow posting a few threads about a potential low cost Pacific crossing on a small boat. One thread was about auto pilots and someone linked to a raspberry pi solilution. Open development, apparently they have a working model. If I run across the thread again I’ll try to remember this one and cross post the info.

Ah. Here ya go


boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,800
Re: Solo Sailing without Auto Pilot?
I recommend a wind vane of course, as this is can be very robust and reliable.


Autopilots do not need to use much power. I have a free autopilot anyone can use my design and software:

pypilot - open source marine autopilot

This autopilot cost is less than 1/3rd of the simrad tiller pilot. It keeps course using very little power. My friend also tried it, and reported it works significantly better than his simrad tp32, making far fewer corrections.

It averages from 1-4 watts to keep course depending on sea state, I have sailed offshore for hundreds of miles with it.

In protected waters in light winds, it drops down to less than 1 watt to keep course and works much better than the wind vane. Ideally you would have both, switching to the electric autopilot when the wind is light.
hpeer is offline   Reply With Quote
Reply

Tags
autopilot


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm a tiller guy, not a wheel guy. With a tiller, I felt I always had complete... Pipeline Multihull Sailboats 30 30-04-2016 09:24
Homemade Cat - What Do You Think? phmadeira Multihull Sailboats 9 25-07-2009 16:25
Homemade Chartlets? Highlander40 Navigation 1 01-06-2009 11:43
homemade tv antenna mobetah Marine Electronics 14 12-06-2008 09:36
Homemade hooch? wes28 Cooking and Provisioning: Food & Drink 42 29-04-2008 19:15

Advertise Here


All times are GMT -7. The time now is 19:10.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.