View Full Version : homemade autopilot


Pages : [1] 2

bertho
11-08-2009, 05:00 AM
gents,
just a question for electronic fan...
is any "homemade" autopilot drawing on the net??? :rolleyes:
compas can be find easily, potentiometer for feebck too.. in betwen we just need to amplifie compas signal to send to actuating device... ? i'm not electronical specialist, far away, but look for me not "rocket science" to add adjustable temporization between compass signal and feedback rudder position.. , and send sufficient power for relay to drive on autopilot...?? any experience on the subject available??
bertho

hoytedow
11-08-2009, 06:58 PM
The trick would be to make it precise enough to avoid zigzagging across the ocean.

gonzo
11-08-2009, 07:10 PM
It is a complicated electronic equipment that has to work in salt water. You can use any hall effect sensor to make it work. Then you have design and build a circuit to adjust for sea state and gain. The compass has to work at different angles of heel, pitch and also pounding and vobration. That requires damping and either gimballing or a compass that works at any angle.

catsketcher
11-08-2009, 10:41 PM
I would really love to do my own autopilot. I have been bugging my electronics mad son to design me one but he says it is pretty hard.

I don't like the response time or multihulls of the typical autopilots. I would also like to get a proper sized motor without paying huge dollars.

So

What about using cheap accelerometers (I phone - Segway) and have these providing info to a box that takes inputs from a GPS. This does away with the fluxgate compass. I would especially love to be able to fine tune the whole process by using my laptop and help the box learn. For instance it would be fab to be able to tell the box (via laptop) that the boat is on port gybe. Then when the nose dips (accelerometer) down for a long period of time and the speed builds up GPS ( the boat starts surging on a wave) that the pilot bears away. This is what any helmsman does automatically.

Any ideas?

cheers

Phil

farjoe
11-09-2009, 12:49 AM
What about using cheap accelerometers (I phone - Segway) and have these providing info to a box that takes inputs from a GPS. This does away with the fluxgate compass.
Phil

I am actually in the process of doing something similar. i have decoded the Track info from the NMEA string send by the GPS using a micro controller and written a simple algorithm which drives 2 pins according to the deviation from the chosen track.

My plan is to set this up on the boat and see how it reacts and then go for a more sophisticated algorithm later.

I am stuck at building a proper housing for the motor assembly and fitting it to the tiller of my cat.

Any ideas?

TerryKing
11-09-2009, 01:08 AM
Take a look at what the model boat (and model airplane!) serious hobbyists are doing. And then, for complexity, what a few have done with model helicopters.

I don't think the guts are very expensive.

The ocean is the same ocean. The dynamics are similar but different (they have to have faster response than a large boat). The servo has to be bigger.
But most is the same.

Update: There's real stuff out there - Look at this:
http://paparazzi.enac.fr/wiki/Tiny_v2

A few pointers:
http://www.sciencenewsforkids.org/articles/20031217/Feature1.asp
http://news.stanford.edu/pr/96/960116gpsplane.html
http://wreilert.stud.hive.no/hopfe60/cms/downloads/rapport.pdf
http://www.gpss.tripoduk.com/autop.htm

Here's an open-source project for one:
http://autopilot.sourceforge.net/faq.html

Another more current project:
http://paparazzi.enac.fr/wiki/Main_Page

And these guys are doing serious stuff:
http://diydrones.com/
See this:
http://diydrones.com/profiles/blogs/705844:BlogPost:35640

Here's an idea: A 'smart' cellphone has all almost all you need inside for about $200. And you can send it a text message "come home"..

I'm living at new big University (King Abdullah University of Science and Technology http://www.kaust.edu.sa ) on the Red sea, with a long canal between housing areas. I've been thinking of doing a project with high school kids with a model boat that can auto-navigate the canal and the harbor.

I'm sure this is possible to do...

Manie B
11-09-2009, 01:37 AM
I had a look at this type of thing and in South Africa it would just be too expensive and then you have to worry about reliability
kinda re-inventing the wheel

gonzo
11-09-2009, 03:12 AM
You can buy a Tillerpilot for about $250.00 US dollars. The gears are not too sturdy, but if you connect it to a servo it will do very little work.

CDK
11-09-2009, 03:29 AM
compas can be find easily, potentiometer for feebck too.. in betwen we just need to amplifie compas signal to send to actuating device... ? i'm not electronical specialist, far away, but look for me not "rocket science" to add adjustable temporization between compass signal and feedback rudder position.. , and send sufficient power for relay to drive on autopilot...?? any experience on the subject available??
bertho

Yes, I made one several years ago, but the results were disappointing. My objective was to keep my boat, with twin stern drives, on course during displacement in choppy seas, so I didn't need to hold the steering wheel for hours.
I used the compass from an old Autohelm unit. That is the critical part; it hardly looks like a compass, just an oil filled cavity in a clear plastic cylinder with a circuit board containing some simple opto-electronics that determines the deviation from course and the direction. The servo amplifier and output stage are child's play for an electronics expert.

It should work reasonable well on a sailing boat with a keel, but in my case steering was very nervous due to the many over-corrections.

With today's technology it is much easier.
Use a fluxgate compass, a linear actuator and something with a microprocessor. Write a simple program that ignores the static from waves and considers the response time of the hull.
It is still on my "to do" list, but not on top.

yipster
11-09-2009, 10:48 AM
that girocompas is essential, rc helicopters nowadays have it and use 2 channels instead of 5.
had an autohelm on dual engine boat years ago too, girocompas down near CG
between wheel and dash the motor and controls, on/off, 3 different speed actuators when going fast
and a independant stay on compas course button, quite a nice system i hooked to gps and old laptop with nav soft
could set course between islands in advance, worked well but never used it much
till lever with all the buttons came off after to much sun and never repaired it
NMEA connections on serial? pc port was it? had more trouble hooking the gps into the system
ah, remeber now, was one of the first handheld and NMEA out didnt work i found out
whole batch went back to usa and got a new one but it was a headache to find
think a toyshop gyro compas and motor may beat the was was it 1500 i paid
wannahaves it are, nice, but you probably wont use it much, need an eye at the helm anyway

farjoe
11-09-2009, 01:48 PM
Which characteristics of a girocompass or a fluxgate make either essential for an autopilot?

Why isn't the track data coming out of a modern GPS sufficient? It may not be correct to compare older GPS units with modern ones. The one i like most is half the size of a computer mouse, totally water proof, very low current comsumption and can almost detect satellites from within the house.

It seems to me that with a simple microcontroller the variation due to waves can be averaged out. For me the challenge seems to be more in determining the actual angle of the rudder than any other parameter since many units I have seen do not have direct feedback of rudder angle.

of course this is all theory and practice may teach me otherwise.

Fanie
11-09-2009, 03:41 PM
This is not difficult to do at all.

You need two things for bearing - a wind vein and a compass module. One would be the master and the other one a reference so that if the reference vary more than a preset amount you get an indication or alarm.

If you follow the gps and the wind direction turn you must be notified, otherwise you may be sailing back instead of ahead :D

If you follow the wind and it again turns you may veer of course some.

The drive for controlling the rudder can be made quite easily. A rack and pinnion can be made from a wiper motor (you get big ones ie for busses as well) and the rack and pinnion from a gate motor available in all plastic too. You could even use a 12V gate motor.

This should be mounted inside the hull. Then a push pull cable like they use for boat steerings takes it to the great outdoors and onto the rudder.

On manual control you can use a joystick to steer.

CDK
11-09-2009, 04:51 PM
Which characteristics of a girocompass or a fluxgate make either essential for an autopilot?

Why isn't the track data coming out of a modern GPS sufficient? It may not be correct to compare older GPS units with modern ones. The one i like most is half the size of a computer mouse, totally water proof, very low current comsumption and can almost detect satellites from within the house.



I would prefer a fluxgate because it costs almost nothing and can measure the hull position angle. GPS gives the traveling direction with the resolution of the GPS grid, good for sailing but not to keep a motorboat on track.
A girocompass is something from the past that need not be discussed here.

Fanie
11-09-2009, 05:16 PM
A girocompass is something from the past that need not be discussed here.

Carefull CDK :D The new ones are very fancy. The 2 axle ones I agree with, to use them they should remain horizontal. With the three axle ones you can compensate for the boat heeling, and you hence get a very accurate and stable output. You do however need a processor to interface them.

The biggest advantage these have over GPS is that you can always see dierection, with a gps you have to be moving...

Have a look at the Honeywell HMC5843 ;)

CDK
11-10-2009, 03:00 AM
The Honeywell HMC5843 is 3-axis fluxgate sensor.
To me (must be my age) a girocompass is a fast spinning flywheel on a hinged platform. The last serious application I am aware of was the LN3 inertial navigator used in the Lockheed F-104: the error after one hour was more that 20 miles!

gonzo
11-10-2009, 03:05 AM
I used Sperry gyrocompasses for a long time working as a navigator. They were the size of a refrigerator and very accurate.

Frosty
11-10-2009, 03:40 AM
Im all for making stuff, be it fun or necessity.

But making an auto pilot is a difficult job, its not like they are expensive.

If you got the control box off something like the Navico wheel pilot you could make the rest. The control box houses everything.

A rudder feed back is not necessary.

gonzo
11-10-2009, 03:44 AM
Some boats will steer wildly without a rudder feedback sensor.

Frosty
11-10-2009, 03:48 AM
Granted but the Navico wheel pilot does'nt use one.

Its the most simple auto pilot which is why I suggest getting an old control box off one.

I have heard of people using this control box to track a satellite dish on boats at sea. !!!!!! might work,--I dont know if it does or not.

CDK
11-10-2009, 05:07 AM
I used Sperry gyrocompasses for a long time working as a navigator. They were the size of a refrigerator and very accurate.

Those were the days....
The Honeywell fluxgate sensor Fanie pointed to measures 4x4 millimeter and has 1-2 degrees accuracy.

With a microprocessor doing the math it should not be necessary to use rudder sensors if the program is able to learn from previous errors and stores the results. Something that was impossible with analog technology.
Long ago I designed a central heating clock/thermostat for a client. It kept track of the rate at which the temperature rose and fell; approx. a week after installation the thermostat was able to provide the set temperature within 0.2 degrees, even with very slowly responding floor heating systems. Only a sudden change in outside temperature could cause a somewhat larger error on the next set point.

A similar system for an autopilot would over-correct during the first few minutes only and perhaps again briefly when reaching the lee of an island.

gonzo
11-10-2009, 05:14 AM
I've been toying with the idea of software that will steer correctly in following seas. A good helmsman will start correcting before the boat changes course. The correction starts when the boats gets the bow down. I wonder if a gyro could be used for that.

catsketcher
11-10-2009, 05:17 AM
Frosty -

I guess I am looking for top of the line performance with gyros and a bigger motor without the expense of a below decks autopilot. I know that you can get an okay wheel autopilot for about $1800 Aus but if you want accelerometers and bigger motors mounted under deck you can pay double really quickly. My friend with a similar sized multi to mine can't use his $1800 autopilot in nice sailing weather downwind - it is too slow for a multi.

I don't care about current draw. I would much rather have a nice chunky motor pulling amps and have my tow generator off the back feeding them back in whilst I watch the boat get steered. I have spent many hours steering my boat downhill because the pilot can't handle the conditions quickly enough. I know to trim the boat well and I do but response time and grunt are needed in spades. If I buy a system suited to my cat I can quickly spend $4000.

So I would love a fast motor and a trainable software that I can set to my boat. I will have a laptop anyway so would like to program a PIC or some other type of chip like they have in radio controlled models.

That's my wish list anyway

Phil

gonzo
11-10-2009, 05:21 AM
With a powerboat, a standard automotive type hydraulic powersteering is a good choice. You can drive the system with a small fast electric motor

CDK
11-10-2009, 05:50 AM
I've been toying with the idea of software that will steer correctly in following seas. A good helmsman will start correcting before the boat changes course. The correction starts when the boats gets the bow down. I wonder if a gyro could be used for that.

An inclinometer, being a drop of mercury in a slightly bent glass tube could detect changes in the longitudinal axis. But as long as the direction doesn't change the autopilot cannot take action because it doesn't know in which direction it must steer. With the following seas coming from port or stbd it could anticipate, but from almost dead astern it would make mistakes.

Your 'good helmsman' also has visual information and sees the big one approaching. When blindfolded he will perform less good. I once entered a harbor with lots of obstacles ahead and a friend of mine threw an air mattress over the windscreen, saying "you have radar, you don't need this". I managed, very very slowly, but it made a hell of a difference.

gonzo
11-10-2009, 05:56 AM
I think it could make an improvement. Also, it could use winspeed to anticipate the boat heeling over and rounding up when going upwind.

yipster
11-10-2009, 10:07 AM
http://img.nextag.com/imagefiles/big/000/000/559/457/55945784.jpg
good to stand corrected and around '92 a fluxgate it was..

Tim B
11-10-2009, 05:53 PM
I think the tricky part of this question is actually the hardware. There are several Autopilot codes available on the web to choose from, and in it's simplest form a steer 10 deg port/starboard pilot is not hard to do (not efficient, but not hard).

There is a project called YBW OpenPilot (which at present has nothing to do with OpenPilot) which is looking to produce a software autopilot. I have invited them to develop it as part of the OpenPilot system, but as yet have had no response.

I would suggest that you look at using OpenPilot as a base, as the most of the code is pretty portable, and it could be made to run on any embedded platform that supports QT4. Furthermore, a lot of the data parsing has already been done and tested.

Gonzo, how long are you in London? (PM me)

Hope this helps,

Tim B.

Fanie
11-10-2009, 06:34 PM
I think the tricky part of this question is actually the hardware.

This is a steering mechanism I made and used. It simply worked with a joystick and relays switching the motor on and off and changed direction.

That is one motherly big wiper motor, a total overkill. It's a 24V motor I ran off 12V, and it will crush you if any body part gets in it's way.

The construction is an alu plate that bolts to the motor, on the alu plate is bolted a U shape milled engineering plastic the rack fits through. The sprocket turns and the rack moves. You can still see the ball fitting on the left of the pinnion.



Sorry CDK - I think I misunderstood what you were talking about on the fluxgate. I'm sometimes like the English say here but not all there ;)

An inclinometer can be a simple potentiometer with a weight on it

Guest625101138
11-10-2009, 10:40 PM
Which characteristics of a girocompass or a fluxgate make either essential for an autopilot?

Why isn't the track data coming out of a modern GPS sufficient? It may not be correct to compare older GPS units with modern ones. The one i like most is half the size of a computer mouse, totally water proof, very low current comsumption and can almost detect satellites from within the house.

It seems to me that with a simple microcontroller the variation due to waves can be averaged out. For me the challenge seems to be more in determining the actual angle of the rudder than any other parameter since many units I have seen do not have direct feedback of rudder angle.

of course this is all theory and practice may teach me otherwise.

The ability of the control system to cope with external disturbances such as wind and waves depends on the speed at which it gets course data. If the course information is slow then the system response has to be slow as well otherwise it will become unstable.

A GPS typically has a slower update than a gyro or Hall device. The GPS requires at least two updates to know the course as it is inferring direction from the track between points. The fastest update is usually within 1 second and a slow moving boat that is bouncing around will need some smoothing of the GPS data. So there is delay in the feedback signal that limits the overall response time. It will be OK for a boat that is not being thrown off course by fast changing external inputs.

Any system really needs linear control action rather than on-off. Linear proportional control makes a small correction for a small change in direction and larger change for larger variation. It will also improve with differential and integral action - so called PID loop control or its digital equal works well.

You can get adaptive control action as well but that is getting closer to what humans can achieve. The advantage of a human is that there is much more sensory data usually available. A human can actually anticipate how the boat will move as a wave approaches and make a course correction before the wave arrives. The human can feel the motion of the boat as well.

The drive mechanism needs to be robust as they tend to do a lot of work.

I have made a two autopilots and my view is that commercially available autopilots represent good value. If you have skill with electronics and ability to machine and fabricate the necessary drive parts then you might do something cost effective with carefully selected parts. Downfall with the first one was use of on-off control while both underestimated the amount of work they do over a period of time and wear and tear on the mechanical bits (with tiller mounted units). I really did not get beyond the prototype stage before realising it was cheaper to buy a commercial unit.

If you can find a proven design then it might be cheaper to build as you avoid wastage in the development phase. Make sure the application is similar to yours.

Rick W

CDK
11-11-2009, 04:01 AM
When I made the autopilot, the boat had power steering. All I had to do to put the stern drives in the desired position was push gently against the control valve. I used two small solenoids on a sub-frame that moved with the steering arm(s) and the Bourns wire wound pot that was already there for the rudder indicator. The stroke of the solenoids was only 4 mm so they required only 0.5 Amp.

That part worked perfectly. I also installed a joystick to steer the boat, using the same solenoids, but after the fun of the accomplishment I found myself using the steering wheel again. Because it felt more natural.

Fanie
11-11-2009, 04:19 AM
but after the fun of the accomplishment I found myself using the steering wheel again.
Did the same. For a hands on steering you need the proportional acceleration as Rick described.

As for the steering vein, you need to dampen the direction sensor's input to the control so it operates on an average value. With electronics it is quite easy to adjust this sensitivity.

Frosty
11-11-2009, 04:26 AM
You would not find that using the steering wheel felt more natural if you used a proper autopilot.

They steer far better than a crewman can.

yipster
11-11-2009, 05:40 AM
yes, specially following a pre programmed course. on the pilot (http://www.raymarine.com/productdetail.aspx?site=1&Section=2&Page=156&Parent=5&product_id=226) a had done on the say blinker arm there were 3 speed options
recall using the quik turn mode was constantly adjusting and dangerous at speed tho
motor was in the interface between dash and brought the wheel nicely some inches up. added gps nmea gmdss (or whats the name)
and navsoft that even kept a log. had serial ports wired to the dash and inside for the laptop (can nowadays be bluetooth)
never understood why both drives in the bilge had to hooked back tho. think they stopped this model but it worked well

CDK
11-11-2009, 12:06 PM
Did the same. For a hands on steering you need the proportional acceleration as Rick described.

As for the steering vein, you need to dampen the direction sensor's input to the control so it operates on an average value. With electronics it is quite easy to adjust this sensitivity.

Like I said in post #9, it is on my list but not on top.
A new system will be very different from the 1th because the power steering is history. There will also be no need for small correction: with the stern drives the boat refused to stay on course, but now she runs like on rails.

For this winter the planning is to lift one engine and overhaul it, plus some minor corrections around the tunnels to get a bit more planing surface. When that is ready it will be spring again....

Joakim
11-15-2009, 06:44 AM
I did some initial design for a tiller pilot for a saiboat. If you have good skills in programming and a bit in electronics, I think that would be doable.

I would have definitely bought the drive unit. Here is a very good candidate: http://www.linak.com/corporate/openpdf.aspx?pdffile=/corporate/pdf/english/la36_eng.pdf
It costs ~400$ with a potentiometer for posiotion and tolerates salt water. Another option is to use an old commercial tiller pilot.

For steering reference I would have used a rate gyro (these can be as cheep as 10$) and COG from GPS. I would think a fluxgate is not necessary, but I don't know any commercial autopilot without it.

For "brains" I would have used a microcontroller (ARV or ARM) or a small Linux platform (e.g. slug = nslu2). These can be programmed using C, which is the most famialar one to me. Costs is about 100$. Additionally you need some rather simple electronics to control the motor of the drive unit.

At the moment the project is on hold, since I noticed that the newest version from Raymarine already has a gyro and is quite reasonably priced (~1000$): http://www.raymarine.com/ProductDetail.aspx?SITE=1&SECTION=2&PAGE=87&PRODUCT=4173

Here is an interesting article of the demands for a good autopilot: http://www.marinea.fi/downloads/Ocean_Racing_12_2006_Autopilot.pdf

I have recenty bought a Raymarine ST2000+ and I'm very unsatisfied with it's performance. You can get it working for one conditions by adjusting gain and damping, but then it won't work in the next condition. Either it just keeps doing very small back and fort movements, when a much bigger adjustment would be needed or then it oscillates the course +-20 degrees. All of these even without any waves and bot on engine and while sailing.

Fanie
11-15-2009, 01:08 PM
I have almost finished a board with a compass chip and GPS on board. The intent is to use it for auto steering as well as instumentation. I will probably have it made some time next year, the PCB manufacturere are closing down on Monday. Can you believe it, the year is on it's way out !

Just to brag a bit. If all goes well a friend and myself may be going fishing in Moz... I'm getting extraction symptoms just thinking about it :D

DaveJ
11-17-2009, 01:35 AM
Not knowing the inards of the current crop of autopilots can't really comment on them, but i believe the DIY's out there are looking at the problem incorrectly. Coming from a Aviation background, the levels of autopilots start from very simple system at heading/altitude/speed hold, to next level with stabilty arugmentation to fully fled hands off take off and landing systems. It is quite amazing watch a helo hover just off the ground in 45 knots gusts and not moving more than a foot and watching the rotorblades move all over the place compensating.

This is done through a stabilty argumentation system, which i believe is the first step in designing an autopilot for a boat. Reason for this is a boat has to sail off course before the effect of the wave is felt. If you use a stabilty argumentation system, the sensors feel the wave motion and adjust for this even before the boat sails off course.

When the a particular militry jet (sorry don't want to name it due to security laws) first came out, it didn't have a GPS system fitted, it was totally independant to outside input for its nav solution. The pilot would enter the Lat/Long on startup. A advance autopilot system on a boat wouldn't use a GPS as the only navigation solution, but use it to compare its computed possition with what the GPS is stating, that way it has the ability to sence an error and alert the crew.

CDK
11-17-2009, 02:36 AM
In aviation things are quite different Dave. The autopilot in a plane has to maintain speed, altitude and course and must do all that with a fast response time. It has at least three sets of rudders and throttles to control, but it also can get input from systems like ILS.
In a boat there is just one rudder, the only complicating factor is the unpredictable effect from the waves.

I think that for recreational navigation a simple system with course input from a compass and position from a GPS will perform satisfactorily. On long trips it makes life a bit easier for the helmsman, like cruise control does for a driver; expectations beyond that are unrealistic.

Joakim
11-17-2009, 03:41 AM
In a boat there is just one rudder, the only complicating factor is the unpredictable effect from the waves.

I think that for recreational navigation a simple system with course input from a compass and position from a GPS will perform satisfactorily. On long trips it makes life a bit easier for the helmsman, like cruise control does for a driver; expectations beyond that are unrealistic.

Also the changes in wind speed and direction has an unpredictable effect on steering. Especially on most modern boats wind gusts have a violent effect on steering.

At least on my boat Raymarine ST2000+ works far from satisfactorily. On the other hand the system pilots with rate gyro on my friends boats work extremely well.

farjoe
11-17-2009, 01:27 PM
. Especially on most modern boats wind gusts have a violent effect on steering.

.

I think you should qualify this statement. From my admittedly very little experience I find this to be a huge problem on monohulls requiring simultaneous action on both rudder and mainsheet while it is not a problem at all on my catamaran installed with semibalanced rudders.

DaveJ
11-17-2009, 08:13 PM
CDK: True, aircraft require a faster responce compaired to a boat.

ALL: Listening to people complain about their installed systems suggest to me that the designers haven't look at the problem properly and only provided a bandaid solution. Joakim stated in his comment that his raymarine is not the best, yet the other system with a rategyro works better, the key here is that that system uses something other than a fluxvalve and a GPS, so it has a stabilty argumentation system built in.

I would use accelorometers, put one in the front, one in the rear. If the wave hits the bow and pushes it, the front accl would fell this while the back one doesn't and the autopilot would compsenate. For a current/wind drift to the side, both accl's would feel the same and the autopilot would then command the boat to crab to compensate. This is all without the use of a compass and gps, your boat already becomes more course stable. If you where in a tight channel with a strong cross wind, the SAS would keep you from drift out of the channel and running aground.

Joakim
11-18-2009, 02:34 AM
CDK: True, aircraft require a faster responce compaired to a boat.

ALL: Listening to people complain about their installed systems suggest to me that the designers haven't look at the problem properly and only provided a bandaid solution.

I would use accelorometers, put one in the front, one in the rear.

This is all without the use of a compass and gps, your boat already becomes more course stable.

I wouldn't be sure about the faster response need of an aircraft. I have never steered one, but watching it doesn't seem like very fast responses are needed. Steering some sailboats do need quite fast responses in hard conditions in order just to keep the boat going even somewhat straight.

There are quite different level of autopilots even from one brand. The cheepest one suitable for my boat would costs ~200$ and the best ones ~5000$. Certainly these are different. The one I have (~500$) seems to be a quite old design, but it probably works just fine for many boats.

I don't know of any model that uses accelerometers. The standard seems to be a fluxgate compass in all models and additionally a rate gyro in the top models. The top models also have input for speed of the boat and sense the rudder position.

Rate gyro measures the angular acceleration (I think all autopilots use just one axis: yaw). The fluxgate output needs a lot of damping due to accelerations and thus rapid changes can not be detected with it. Rate gyro will give accurate short term heading, but it needs to be corrected due to cumulative errors in heading integration.

CDK
11-18-2009, 03:58 AM
I wouldn't be sure about the faster response need of an aircraft. I have never steered one, but watching it doesn't seem like very fast responses are needed.

You have a very weak arguing position! I flew anything from a single prop Piper to military jets, believe me it's quite different from a sailing boat.

Tim B
11-18-2009, 01:33 PM
I am currently talking to the developers of YBW OpenPilot (which doesn't have anything to do with my OpenPilot project) about inclusion within the OpenPilot framework. Their system looks to be pretty well developed, so it might be worth looking at it.

http://sourceforge.net/projects/ybwopenpilot/

Cheers,

Tim B.

DaveJ
11-18-2009, 04:43 PM
Get onto youtube and watch an F-18 land on a carrier, whatch the back stab's, they will move up and down quite alot for very little aircraft change, alot of that is gain control so there is some pilot input. But a good fraction of that is the stabilty arugmentation system.

Rate gyros measure angular change around an axis, while accelorometers measure movement along an axis. So without any hull dynamics calulated into the solution a rategyro can only tell you how fair you have twisted off your heading, but with accelorometers it can tell you how far you have moved off your track, but using distance measure, and time taken to get to that distance you have your rate of twist. So with accelorometers not only have you got the same infomation that a rategyro would give you, but also the amount of error required to get back on track

Tim b: if you want any help understand autopilots feel free to pm me

Dave

Tim B
11-18-2009, 05:32 PM
YBW OpenPilot already have what looks like a sensible autopilot implementation. That's why I'm talking to them. I do not intend to develop an autopilot independently for my OpenPilot project, I have far too much to do as it is.

Thanks for the offer, there is plenty of non-autopilot related ways to contribute to my OpenPilot project. YBWOP might be glad of the input though if you feel like joining the open-source community.

Cheers,

Tim B.

catsketcher
11-19-2009, 05:27 AM
Dave

Are you basically saying that we should copy the old 747 style of inertial guidance system? This was the hyper accurate accelerometer thingo that measured all accelerations and timed them so that you knew where you were as long as you gave an initial accurate position.

If we take this concept further, why not use a GPS and then have accelerometers at the ends of the boat that then track how far the boat has moved from the last GPS position? You would not need quick GPS updating if the accelerometers had software that allowed them to calculate changes in course. Have the accelerometers do most of the work and refer to the GPS rather than the reverse.

I am sure someone has thought of this for boats but how far apart would the accelerometers need to be? Is there software available now?

cheers

Phil

Joakim
11-19-2009, 06:26 AM
It is typically not important to keep the boat very accurately "in the middle of the road". You get the cross track error from GPS and can adjust the course to in order to keep close to the "road". No need for accelerometers for this task.

Furthermore just two would not be enough due to heel and trim. In order to track the real position with accelerometers you need 3 accelerometers and 3 rate gyros which form the basis of an INS system. But as I said, there is no need for this in a boat.

What is not so easy and far more important is to keep the heading constant. This is necessary in order to keep the sails operating well and keeping the passengers happy. For this task the most important input is the current heading and that should be as instant as possible for boats that are not so course stable. The best source for this instant heading is visual, but that is not easy to implement into electronics. A rate gyro + some average heading device (fluxgate or GPS) does the job well enough.

You could build your own rate gyro from two accelerometers with longituninal distance, but why would you do that when there are compact and (more) accurate rate gyros available.

Joakim
11-19-2009, 04:33 PM
You have a very weak arguing position! I flew anything from a single prop Piper to military jets, believe me it's quite different from a sailing boat.

Yes that is true. However I don't know how strong is your arguing position about modern sailboats.

I just talked to a friend of mine who has plenty of experience on airplanes. He said that flying straight ahead does not require much input from the pilot. My sailboat would not go straight ahead for even one second without input from a pilot in many conditions.

I know there are military jets that are even completely unsteerable without an "autopilot", but I would assume "normal" airplanes are quite stable and do not require especially fast response from an autopilot.

gonzo
11-19-2009, 06:57 PM
How small are accurate accelerometers. They used to be pretty big and heavy. I assume they are based on a gyroscope.

farjoe
11-19-2009, 10:39 PM
How small are accurate accelerometers. They used to be pretty big and heavy. I assume they are based on a gyroscope.

the smallest I know is 3mm x 3mm x 1mm and the technogoly is not based on the old style gyroscopes. the main problem using these for us amateurs is actually how to solder reliably to the pads since they are about 0.2 to 0.3 mm square. Go to www.st.com and search for accellerometers for more details. They are the current world leaders in this area.

Submarine Tom
11-20-2009, 12:52 AM
That's correct, they are tiny. The ones I've installed (130 in total) to

measure earthquakes, are accurate to 0.5 mili-g. It is automotive air-bag

technology basically. They are also cheap, it's the support circuitry that's

going to slow you down. On a production run, we made 100, 3-axis sensors

for US$1500 each.

_Tom

CDK
11-20-2009, 04:02 AM
Yes that is true. However I don't know how strong is your arguing position about modern sailboats.

I just talked to a friend of mine who has plenty of experience on airplanes. He said that flying straight ahead does not require much input from the pilot. My sailboat would not go straight ahead for even one second without input from a pilot in many conditions.

I know there are military jets that are even completely unsteerable without an "autopilot", but I would assume "normal" airplanes are quite stable and do not require especially fast response from an autopilot.

To be quite honest Joakim, I spend as little time as possible aboard sailing vessels because I hate it when the resultant of forces on my body shifts from the vertical axis. Aboard a planing craft I feel much more at home. After a regatta in the North sea that turned into a nightmare due to thunderstorms I decided to decline further invitations to board sailing boats which aren't secured with heavy chains to immobile concrete objects.
But one also has obligations and I do have several sailing friends, so occasionally I do speak words of admiration sitting in a dangerously angled cockpit of a Bavaria, Jeannau or Marieholm, wishing it were over. Somehow these guys never invite me when the sea is calm.

So I do have some experience with sailing boats, just as I have some experience flying planes. I never was a pilot, but a military air traffic controller. At the time it was customary to let the ATCs taste what it was like to fly in the various machines they had to guide to the glide-path. Especially simulated emergencies like SFO (simulated flame-out), hydraulic failures and "speechless" procedures were very enlightening. And they let me make several 100 hours in a link trainer because I was a mechanical engineering student and my bosses thought I might have ideas about improvements.

Your friend is not completely wrong. Flying straight and level in a trimmed plane on a clear cold morning at 3000 ft is child's play. But cruising at 20.000 ft or above on that same day already puts you in the jet stream where 100 mph is quite usual. Your aircraft is doing 450 and even when the angle between course and wind is small the forces on the plane are considerable. The pilot has to adjust not only the course with the stick or steering column, but also use his feet to bank the plane so it doesn't slip sideways, pull or push to change the forward angle and adjust the throttle settings to maintain altitude and/or speed. The interaction between these controls is far more complicated than moving the rudder on a sailing boat.

CAT (clear air turbulence) on a hot day has caused airliners to crash during landings because the pilot couldn't react fast enough and a wing tip briefly touched the ground although the ATC informed the pilot during his approach so he was prepared for it. A modern automated landing system integrates the autopilot with the ILS (instrument landing system) with such an accuracy that it positions the plane exactly on the touchdown point with almost zero visibility. On the glide-path it corrects for wind, air density, reduces speed, extends flaps and lowers the gears with mathematical precision without pilot intervention.

The next time you are in an airliner and the fasten seat belts goes on early, watch the wingtips and engines swinging wildly. It gives you some idea of the forces the automated system has to cope with and the response time necessary.

DaveJ
11-22-2009, 05:22 PM
Dave

Are you basically saying that we should copy the old 747 style of inertial guidance system? This was the hyper accurate accelerometer thingo that measured all accelerations and timed them so that you knew where you were as long as you gave an initial accurate position.

If we take this concept further, why not use a GPS and then have accelerometers at the ends of the boat that then track how far the boat has moved from the last GPS position? You would not need quick GPS updating if the accelerometers had software that allowed them to calculate changes in course. Have the accelerometers do most of the work and refer to the GPS rather than the reverse.

I am sure someone has thought of this for boats but how far apart would the accelerometers need to be? Is there software available now?

cheers

Phil

I'm not saying to use a complex system that is used in todays jet airliners. I don't really want to compare the systems used in planes to boats, as they will be different beats, but more the ideaology on how to achieve the end goal.

Yes Phil, the concept of thought i'm trying to get people to understand is you use the accelorometers as a stability system and use the gps signal to look like an error that the stability systems compensates for, which ends up being course corrections that are sumed with wave/wind/current actions thus the boat will steer a straight course.

Accelerometers are cheap and accurate, very easy to use. Go to this link to find out infomation, i love this place http://www.sparkfun.com/commerce/categories.php?c=80

and this place also has very cheap GPS modules, http://www.sparkfun.com/commerce/categories.php?c=4

My problem is i can't program to save my life, i've brought a book on how to programm the microchip IC's in an effort to make my own systems, for those out there that can, will be able to make a great system very cheap.

DaveJ
11-22-2009, 05:27 PM
On a side not to CDK's comment, the ILS are so accurate, that they had to introduce errors, the reason for this was that the planes wheels where touching down on the same spot every time and was wearing the runway outs, so they (not sure how it is done) make the planes land on different spots of runway at different intervals.

Tim B
11-24-2009, 02:24 PM
Dave,

I have worked with instrumenting vessels, and post-processing the data and the first point to note is that getting motion data that is actually meaningful (think about the planes of reference and what you're actually going to be measuring) for starters is not a particularly easy job. Point 2 is that if you want to integrate the answer from the accelerometers to get position, you will need REALLY accurate measurement, this is not impossible but it will take an amount of work. If you try to do this, you'll find out very quickly why inertial navigation systems are so expensive, and why they're not fitted to yachts.

Historically, the approach to autopilots has been to steer either a constant course, or a constant apparent wind angle, the latter being done very successfully with a rudder vane.

I would suggest that you start with a simple heading-hold autopilot, written on "standard" PC hardware, there's a lot of code around written under Linux that will help.

You can then look at the effect of proportional control. You can also use the GPS to evaluate the typical cross-track error. There are GPS units that will update at 5Hz, and this will be more than adequate. You should probably be looking at a minor correction for cross-track error every 30s to 1min.

So, the inputs that I would expect you to need for a reasonably good system would be:

GPS track
Magnetic Heading
and later Apparent wind angle

The output is simply rudder angle.

Hope this helps,

Tim B.

TedZ
11-29-2009, 06:42 AM
I am always impressed at how erudite the folks are on this forum.

Someone mentioned accelerometers. While once these were expensive and easily damaged, they are neither now. It seems that all of the other factors discussed taken into account, a multi-axis accelerometer as a part of the design would give the kind of early info needed to allow the AP to "anticipate" situations such as a following sea. No question in my mind that there is a learning curve associated with this type of design but could be a big improvement.

Ted

Itchy&Scratchy
11-29-2009, 09:11 AM
Bloody hell...... I was lost at the second posting:p

Some clever people here- thats for sure.:)

J

DaveJ
12-06-2009, 05:57 PM
I am always impressed at how erudite the folks are on this forum.

Someone mentioned accelerometers. While once these were expensive and easily damaged, they are neither now. It seems that all of the other factors discussed taken into account, a multi-axis accelerometer as a part of the design would give the kind of early info needed to allow the AP to "anticipate" situations such as a following sea. No question in my mind that there is a learning curve associated with this type of design but could be a big improvement.

Ted

Ted: Agree with you, the accelerometers are alot more durable then gyro's. I guess the main reason for posting is the lack technology that has gone into boat AP's compared to other forms of travel (ie. the antilock, antiskid braking systems in cars). No one has accually ask how one would go about it, having done testing and troubleshooting on many different type of aircraft automatic flight control systems, i have an understanding how it is done in the aviation world and see some simularities that can be untilitised in the marine sector.

I would be all to happy to help in this area.

Dave,

DaveJ
12-06-2009, 06:01 PM
Bloody hell...... I was lost at the second posting:p

Some clever people here- thats for sure.:)

J

I agree, thats why i like reading this forum, i learn alot.

Tim B
12-09-2009, 04:17 PM
As admirable as the "let's develop the ultimate" approach is, I have worked on too many projects that have failed because of it. If the goal is to develop an autopilot, I strongly suggest that you start simply, then add functionality as it is required.

Tim B.

TedZ
12-09-2009, 05:23 PM
An autopilot that does what they do now is not a necessary project. One that would be using new technology is likely in the design stage in more than one AP house. We don't need to make hydraulic pumps, solenoid valves, piston or anything like that. Likely there is no room for significant improvement. So really it is simple circuitry with complicated software dealing with input that did not exist in previous models.

The challange is can we take that input and control the boat in a way that is better, hopefully much better than what is available now. Any $60 rabbit board with a few SSR's will handle the I/O. So again, it really is a software project. Can there be real innovation in software design? If there couldn't be, one would not be changing your cell phone, iPod or whatever every year or so. As every good software project starts with a flow diagram, it seems that a written flow diagram with pie in the sky parameters would be a good start. Subsets can come, but starting with a subset is just as likely to fail.

My $.02.

Ted

DaveJ
12-09-2009, 06:31 PM
As technology increased, it allowed software developers to come up with better ways with manipulating the data. Like Ted mention, just look at the range of mobile phones and what they can achieve today compared to 5 years ago.

With all projects there should be a research and planing phase, where you develope goals and milestones. For each milestone you map out a parth to achieve each milestone, remembering that each milestone must be achieveable. If the milestone is difficult, break it down into achieable milstones, afterall thats what your doing with the whole project, breaking it down into achievable bites.

Another problem is what we call scope creap, as your developing your project, you think it would be nice to add this feature, and then this feature and so on. It's better to log these new feature as addon's after the original product is working. Its ok to change the design to be able to adapt this new feature down the track if its easy, as they say, fitting for, but not with.

RyanN
01-29-2010, 10:44 PM
I've been thinking about this for a while now, and some projects at work are beginning to have some overlap. I thought I'd share some things I've learned and ideas I've had.

My goal is to build an autopilot for my 24,000 lb sailboat. I've got a wind vane, but it takes too long to setup sometimes, and doesn't like certain points of sail or motoring.

I was able to pick up a Raymarine type2 hydraulic ram and pumpfor a great deal a few years back, and I have it hooked to the rudder shaft. I also have a small linear actuator from an old Autohelm which I will attach to the wind vane. I've heard of people using old outboard rams and non-marine 12v hydraulic pumps. You could probably use the hydraulic helm instead, hooked to a decent gear motor of some sort.

What I lack is the processor, sensors and interface.

To drive the hydraulic pump motor, the best thing I've found is the Roboteq AX1500SC brushed DC motor controller. This motor controller is rated at 40 amps continuous so it should be more than capable of any autopilot motor even under severe duty. It has built in PID control and would require an analog feedback for rudder position. I was going to get some sort of industrial potentiometer off of eBay.
The controller can be commanded several ways, but I was going to use its serial interface. You would send it a desired rudder position, and it moves the rudder there based on how you have the PID tuned.

For sensor inputs, I was going to use the OS4000 digital compass. This tiny device gives heading, pitch, roll, and acceleration in 3 axes. It does this very rapidly with very high accuracy over a TTL level serial connection. You would also of course want a GPS for long term course following, as well as wind information if you want to keep a constant wind angle.

The only thing left is the brain and user interface. Here I have two very different ideas. First would be to use a pair of Arduinos. One would handle the course handling and the other would be hooked up to an LCD and buttons for the user interface. The code would be written in the Arduino's simplified C.
The second idea is to use a PC/104 form factor computer running Linux and write all the code in python. This would be overkill from a processing standpoint, but could do double duty as a navigation/instrumentation computer. Old PC/104 gear is pretty cheap and built to an industrial spec.

The whole thing would be housed in a IP67/IP68/NEMA 6P enclosure (depending on location) with some decent bulkheads (I like Souriau UTS).

I haven't thought much about the display and controls, but this should be easy.

For the software, the most basic implementaion would be a standard PID loop with your desired course being your SV, your rudder angle the MV, and your actual heading the PV.
Once this was working, additional inputs could be tied in to make everything work better.
The heading accelerometer easily be set up to could tweak the PID tuning variables.
A constant roll angle (heel) might indicate sailing, and since most sailboats head up more easily than the fall off, this could be implemented. This effect also increases with heel angle.
A sudden increase in wind speed while sailing would have a similar effect, but with greater delay.

The "ultimate" functionality would be to take a time series of pitch/roll/yaw and acceleration data and put it through some Fourier analysis to get the frequencies and directions of the waves acting on the vessel. This is how the NOAA buoys do it. In theory you should be able to predict the boats motion if the wave trains have any regularity to them. This would be far beyond the Arduino, but not too hard (in theory) for a x86 processor using scipy or matplotlib.

Would it be cheap? No, it would probably be at least US$1000 for the hardware, excluding the drive mechanism. It would be cheaper than the US$2600 Raymarine wants for an X30 + US$660 for the control head. It could also be much more sophisticated. I doubt that X30 actively monitors sea state or dynamically changes it's tuning based on vessel speed.

I'll have to look at the ybwopenpilot to see where they are going with this...

TerryKing
01-29-2010, 11:56 PM
>Ryan said: The only thing left is the brain and user interface. Here I have two very different ideas. First would be to use a pair of Arduinos. One would handle the course handling and the other would be hooked up to an LCD and buttons for the user interface. The code would be written in the Arduino's simplified C.

Ryan you have this very thought out and I'd encourage you to go for it! I think you have hit all the major mechanical and systems challenges. Bringing all that together is a problem for many people.

I think Arduino, especially a Mega, is an excellent choice.
(Some pointers, for reference):
http://www.arduino.cc/ - home page
http://arduino.cc/en/Main/ArduinoBoardMega - The Mega

You are talking about a lot of computer power, actually, by any previous standards. And the idea of multiple identical microcomputers handling separate parts of a complex system is an approach that is used successfully in industry. My son has done this in wind energy datalogging systems that have survived pretty difficult environments.

You're talking about multiple processors that run 20 million instructions per second, have hardware multipliers and shifters, and lots of peripheral and I/O choices including 4 hardware UARTS (serial ports). Not long ago this was a high-end desktop machine specification...

And a good development environment that's free, has dozens of talented contributors and lots of successful projects sounds good. Actually you can go at any time from the "simplified C" into the full Atmel-supported language features.

You have some forward looking ideas in the dynamic control area. Being able to continuously improve your software, in stepwise refinement, would make this approachable. Logging all your sensor data at sea might allow you to simulate things at home later. Or, if the system works well enough, you could repair to the chart table to rewrite the next software release level and then try it out :-)

Email me if you want a bunch of Arduino books...

If you do this well enough, maybe you can sell kits and retire to Okracoke :-)

Keep us posted!

goboatingnow
01-30-2010, 06:03 PM
I guess the main reason for posting is the lack technology that has gone into boat AP's compared to other forms of travel (ie. the antilock, antiskid braking systems in cars).

Sorry, can you back up that statement.

The fact is that modern rate gyro based AP, probably do as good a job as possible. Yes a customised autopilot, with software that is specifically tuned to your boats response and quirks might be better. But on a time or,materials basis, will never be cost effective.

Modern AP like Simrad and raymarine are very sophisicated, dupllicating that effort will not be easy.

TerryKing
01-31-2010, 12:16 AM
But on a time or,materials basis, will never be cost effective.

Exactly. But most of the people here on BoatDesign, given a choice between working elsewhere and then buying a new commercial "cost-effective" boat would rather build or modify one!

As Rat said in "Wind in the Willows", "There's nothing half so much fun as simply messing about with boats."

Tim B
01-31-2010, 04:15 AM
Ryan,

You've got a great project here! There's a lot of scope, but my concern is that you'll be duplicating a lot of work already done, whether that's by me, or by the guys at ybwopenpilot. Have a serious look at the main opensource projects in this field (OpenPilot, YBWOpenPilot and OpenCPN). Then decide whether you really want to start another disparate project, or whether you can take advantage of the work that has already been done.

Tim B.

DaveJ
02-01-2010, 06:07 PM
Sorry, can you back up that statement.

The fact is that modern rate gyro based AP, probably do as good a job as possible. Yes a customised autopilot, with software that is specifically tuned to your boats response and quirks might be better. But on a time or,materials basis, will never be cost effective.

Modern AP like Simrad and raymarine are very sophisicated, dupllicating that effort will not be easy.

Yep, very easily, first point is that rate gyro's have spinning wheel inside that is resisted to twisting by springs, the amount of deflection is your turn rate. But for good sensativity and quality of these devices the building cost goes up. and they a more prone to errors, if a spring looses its springyness or through wave action the wheel can slow down or spin up also causes errors. Accelerometers are more reliable, cheaper and more accurate.

Second point and i think is the trump card is that which a rate gyo system, with its lack of abilty to measure distance traveled along an axis you get the problem that is drawn in the very bad drawing i've posted. If you look the boat of the left, this boat has the rate gyro system, he wants to head on the course he's going, hits the button and the AP holds the heading, he's traversing his course until a side force acts on the boat, but since its not changing his direction, the AP system does not sence it, even with a compass as the boat is still pointing in the same direction.

Now look at the boat on the right, this has accelerometers in the AP system, he is the same deal, wants to travel in a direction, engages the autopilot system, but notice when a side force acts on it, the acceloremeters sences this, turns the boat into the side force, since it can measure how far it was pushed off track, it can then put the boat back on track and notice it crabs the boat to keep on track, the amount of crabbing can be used to measure the side force. And when the side force is removed the crabbing is removed and the boat traverses in a straight course. Notice, no external inputs are required to keep a track, thats no GPS or any other forms of navigational aid.

So bang for buck, the acclerometer system poo's all over even the best systems that use rate gyros as the major sensor. Even if this system uses GPS to keep the boat on track, because of the problems with rate gyro, these boats tend to hunt around the track course but never really sit on it.

RyanN
02-01-2010, 10:59 PM
Tim, You are correct, I'd rather not do it alone or start something new if there's already something out there which can be built upon. Both OpenPilot and OpenCPN seem to have scope which doesn not overlap with a dedicated autopilot. The YBWOpenPilot looks like a PC based system written in Java. I've asked to be registered, but I think it has to wait for the project owner to approve. I've not programmed in Java, but it doesn't look too hard.
Unfortunately, while I do some programming, that isn't my strength, I'm more of a hardware integrator.
I was working with a serial PID motor controller today, and the hardware capabilities are remarkable for the price. You tell the rudder where you want it to go, and it goes there. It's very easy to tune the acceleration, overshoot, etc.

The more I think about it, the more I tend to think that the Arduino is a better platform choice than the PC. I think that the YBWOpenPilot project is going to use the Arduino for IO, but why not do everything with it?

Although I already have an arduino, I haven't played with it enough. I have found a PID library:
http://www.arduino.cc/playground/Code/PIDLibrary

goboatingnow, I wonder how sophisticated they really are. It's a compromise to develop a one-size fits all product that can handle everything from fast planing craft to displacement sailboats. AFAIK, aside from the solid state rate gyro, there have been few advances in their capabilities. I think Simrad uses a variable speed controller, but Raymarine has on, pulse, and off.
Raymarine has their AutoLearn, but this is probably a simple PID tuning algorithm. I'd be curious to see wat processor runs a corepack. I'd guess it's remarkably primitive.
I think a basic PID controller, tuned correctly, could do as good a job as any commercial product. The user interface may be the hardest part.
From a materials standpoint: The mechanicals will be the same.
Processor: Arduino Mega $56
Motor Controller: MOTM3 w/carrier board. $100
Rudder position potentiometer (Raymarine uses a 5kohm) $10-100
Digital Compass/Rate Gyro: $250.
Enclosures, connectors, wire: $100
Some IP68 buttons and a serial LCD display: $100
Total:$700 max and probably less. vs $3200 for Raymarine.

Time is another matter. I don't have a lot of free time, but I've got a few years until we move back aboard with the kids.

DaveJ, I think that in the context of recreational autopilots (raymarine, simrad, etc), a "gyro" is really a solid state accelerometer. I don't think any of them use spinning gyros as that would be cost prohibitive.

DaveJ
02-02-2010, 12:17 AM
Ryan, with reguards to the rate gyro being solid state, i suspected as much. But reguardless whether being solid state or not, you will always the same problem. If the solid state gyro is dual purpose ie. not only does it give you rate of turn but also velocity along an axis would be a more flexiable sensor, allowing more complex programming when time permits.

Tim B
02-02-2010, 02:27 PM
If you search sparkfun or farnell (other distributors are available) that most common rate gyros are indeed MEMS system, not quite solid state, but pretty close. There is a device called a "Ring Laser Gyro", but these would cost the same as a small yacht. The MEMS gyros are not affected by linear motion to any great degree, however accelerometers will be sensitive to tilt-angles.

OpenPilot does not yet have any autopilot capability, however, it does have Serial IO, NMEA parsing and analogue input support, all of which may be of interest to you. It should also provide a way to manage the user interface.

If I were doing this project, I think I'd start with an ARM9 PC104 board running Linux, and build on top of an existing project.

But then, I would say that!

Tim B.

DaveJ
02-02-2010, 05:34 PM
I had that in mind myself Tim, there are plenty of ARM7 or ARM9 boards that would be plug and play so to speak, i've been told the Atmel's cut down version of linux for their boards is quite solid and feature rich.

Yes, the accel's would sence tiltangle, but the sensors i've in mind are three axis so you can compensate for tilt just through boring ol' vecotrs (going from the top of my head it would be the CoS of Y and Z axis i think)

But the AP system i have in mind would take inputs from the AIS and RADAR to provide a total tactical navigation solution (Hmmm my militry background is coming out with fancy words like that) where all your contacts are stored in a central database where API's/running programs can read/rewite bits and pieces to this database as the need requires, this is alittle over the top but believe it allows flexablity in design and further addon's.

It is then possible to transmit this database to another station, be it land or sea and recieve databases from those other station and get a greater pitcure of the traffic in the area (aswell as other data like wind and sea state). I see the potental benifits for the coast guard and air sea rescue more than anything else with this concept. Safety, safety, safety, you can never be too safe.

As you can see, i've done alot of thinking about what i want in a AP system and trying to hurd people in what i think is the right direction, and hopefully make a system that will be in a price range for the average sailor.

Tim: I have ideas of using Openpilot or other opensource software as the user interface but wanted to get my stuff in a pile before i troubled you.

RyanN
02-02-2010, 09:56 PM
I had to do a comparison of some PC104 boards recently and at first our top choice was a TS-7800 (http://www.embeddedarm.com/products/board-detail.php?product=TS-7800) from technologic systems. While it will run Linux fine, other software (python, MySQL) will have to be compiled for it, and sometimes it isn't so easy on account of the ARM processor. Boards based on x86 processors were a better value in the long run for us based on perceived development time. In the end we went with a Advanced Digital Logic ADLS15PC (http://www.adl-usa.com/products/cpu/datapage.php?pid=ADLS15PC) which has a 1.6 GHZ atom processor. It supports hardware virtualization too, so we hope to use Xen to run Debian and winXP at the same time. Unfortunately, this board costs 3x the TS-7800. For personal use, I think I'd choose the Win Enterprises MB-73200 which has about the same specs at under $300.

On the control front, I've read a few papers on autopilot control using Fuzzy Logic control instead of a PID loop. I'm still trying to get me head around all the concepts and how they translate to code, but It looks intriguing.

I can understand the desire for a "total system", but a box which given a heading via RS232, takes care of the sensors and rudder control takes a big chunk out of the project. I still think there's an advantage to doing the low level control with a micro-controller rather than a PC.

While the interface could be very sophisticated, in practice, I usually just push the Auto button when we are on a good course. If we are deviating from our desired course I adjust the course manually. At sea there's lots of time to push buttons and at 6 knots, you don't have to be exact. In my estimation, performance is more important than features, I would like to trust the system not to gybe while I'm on the foredeck.

I see the cockpit interface being a 4 line LCD, two buttons (Auto, Stby), and a course adjustment knob. This would be housed in a clear otterbox (http://www.otterbox.com/waterproof-cases/otterbox-3000/)type enclosure. The LCD would display current heading, desired heading, rudder angle, and mode. Setup and tuning could be done via a PC interface when I have the time. With some sysem of "hold sown auto for 5 seconds to enter programming mode", you could tune the autopilot with this basic interface as well.


It is also important that the autopilot is always available. If I need to do a sail change in a hurry, I don't want to have to re-boot the autopilot.

TerryKing
02-03-2010, 03:11 AM
Ryan, ...
my concern is that you'll be duplicating a lot of work already done, whether that's by me, or by the guys at ybwopenpilot.
Tim B.

Tim and Ryan, I don't think you are necessarily overlapping too much. The architectural question is where function is partitioned.

I think there are some good reasons for having a subsystem which "holds a commanded heading, perhaps damping boat motions in a sophisticated way". That subsystem can then become part of an overall system that knows about charts and waypoints, and "commands" the "auto-helmsman" to take a certain heading.

Hopefully the auto-helmsman can be optimized for low power, applying power to the rudder servo sparingly if necessary. Or it could use more power and do boat-dynamics stuff. Depends on the application, from Power to long-cruise low-power sail. If it's 8 hours between waypoints, the chart/human oriented part of the system can be shut down or put to sleep if the power is an issue.

Ryan knows some servo / mechanical stuff that is an important part of a low-cost working system. Maybe collaborate, divide and conquer??

Tim B
02-03-2010, 01:57 PM
I don't think we're actually overlapping at all. OpenPilot has most of the base features required to add an autopilot, and there's no autopilot in there at the moment. I'm not quite sure how to add capability to use the map for input (ie. waypoints), but we can work on that. It may be that it simply needs to return a location on mouse click with an op-code, but I suspect that it is a little more complex than that. I'll have to think about it!

OpenPilot only gets particularly heavy when you're using the map widget, particularly with high-res coastline data or charts. It is quite easy to build a small system by just using the components you need, and then connect it to another machine over Ethernet or serial. If you want to do a full map display, I would advise using a full PC system. I'm using a 2.4GHz P4 with 2GB Ram, so nothing spectacular.

I am very keen to collaborate on this, as I think it's a very worthwhile project.

Cheers,

Tim B.

DaveJ
02-03-2010, 05:30 PM
You may have noticed in some of my ealier posts i mention something about a Stability Argumentation System (SAS), this is your autohelm, you engage it, and it holds your heading against any dynamic forces against the boat. Now you can take a pice of software like openpilot that injects a cross track error into your SAS, which then sums this error with the normal computation it is doing with the dynamic forces and it will then put the boat on a course that is set inside openpilot. As you can see, we are building up modules one at a time, so you have achievable goals, and each module can be sold indervidually. So if someone wants just a simple autohelm, they buy the SAS, but can buy other modules later on if they find the need for them. But you need to incorportate this into your design earlier on otherwise it might be too difficult to redesign lateron.

goboatingnow
02-03-2010, 06:08 PM
You may have noticed in some of my ealier posts i mention something about a Stability Argumentation System (SAS), this is your autohelm, you engage it, and it holds your heading against any dynamic forces against the boat.

DaveJ, in my opinion, you have a fundemental misunderstanding of sailing. The dynamics of a sailing boat means that you really dont want precise control, This would cause incrediable rudder activity and power drain. Equally theres no point, often your destination is not partoculary accurate, nor does overall course accuracy matter. There is simply no requirement for a stability control system on a sail boat and I would argue its actually detrimental.

Your comments re coping with latteral shifts, shows the flaw, XTE tracking will cope with this over time,which is what you wnat as you dont want massive rudder movementsm, in practice small lateral shifts ( that dont result in a course change) are of no consequence. Sure if your trying to design a pilot to bring you into your marina berth thats that is a different story.


Designing an autopilot to for example attempt to control the boat in say an extreme dynamic situation like falling off teh face of a wave, is ridiculous, The electronics may be able to detect all the error movements, but the basic mechanicl system , ie the rudder, boat and sails, simply arnt capable of responding, so all that minute computations go outthe window.

The reason I made my comments, is that designing your own autopilot into going to bring anything new to the party.

DaveJ
02-03-2010, 09:36 PM
goboatingnow: with all due respect, i do have a good understanding of sailing. By your responce we are now starting to talk about the real nitty gritty of the algrorisms inside an autopilot system. We are now starting to talk about the recording, delaying, buffering and the gain of a responces to the detected forces. Anyone can slap a sensor to a microcontroller and write little piece of code that says, if your turn rate is left, feed in right rudder or if your turn rate is right, feed in left rudder and have an autopilot system.

Your absolutely right, you don't want continual rudder corrections but and average of corrections. But if a rogue wave comes through, you would want your autopilot system to be able to detect this rough wave and respond quick enough before it pushes you right off course and require large rudder corrections to get back on course. And to say that the boat is not capable to stop itself from falling off a wave is silly, as every sailor that is skippering will do this automatically, who here has senced a larger wave than normal and automatically steer to compensate, I put my hand up.

What i'm trying to bring to the party is to get away from the use of rate gyro's, they are ok for very simple systems, but if you want more you will start to need to sence force along an axis not just around it, otherwise you get the problem i've shown in my crude drawing. Why would anyone go out and spend $2000+ on an autopilot system when a piece of shock cord attached to your helm is going to provide roughly the same effect.

I do feel your concern, and i do question myself, am i make it more complicated than it needs to be, maybe i am, maybe i'm not.

Tim B
02-04-2010, 02:05 PM
Dave,

I think I'm seeing two (new) widgets here... One collects data from your accelerometers/rate gyros etc. and the other does the actual calculations and emits rudder required, course error etc. The GPS data and Serial IO is already available.

The way I look at it is that the autopilot should recognise whether it has the IMU (Inertial Measurement Unit) connected, then if so, it may be used, otherwise a standard GPS+Mag based system is used. Regardless of the input, the output is presented in standard NMEA Autopilot control sentences, which can then be used on any commercial autopilot hardware.

You might want to consider investing in the IMU, as there are a few pieces of kit around which will perform better than you can homebuild (been there, done that).

Cheers,

Tim B.

DaveJ
02-04-2010, 04:37 PM
Tim: Sounds like a plan, though as soon as you start moving the GPS will give you speed and heading, and you wouldn't engage the Autopilot unitl your moving, so i don't see the need for a compass. This way can keep the cost of the system and the power drain required down. And for an upmarket version add the IMU/SAS for better handling.

My problem is i'm a noob at programming, also the cost to buy the NMEA2000 standard is like around $2500+, so i'm stuck if i want to make the rudder drive system myself if using the NMEA command strings. But if openpilot pumps out a PWM signal with 0% full left rudder and 100% full right rudder, a servo system is more simplistic to build.

Tim B
02-05-2010, 02:20 PM
Ok, three widgets (one for PWM!). GPS will give you a track, which is not a heading. The simplest example of this is that in tidal waters, the difference between you track and magnetic heading is your leeway angle.

The whole point of writing OpenPilot in a modular format was to keep each module (known as a widget) as simple and task-specific as possible. It is heavily based on the QT4 libraries, and therefore the inter-widget communication is very simple (you emit signals which contain data, and recieve them in slots). There are plenty of smaller widgets for you to pick up and convert to your needs, and I can support you with any problems you may have. The language is C++, which I don't think is too complex.

For the servo, it would be less processor intensive (and possibly more useful in the long run) to set a digital potentiometer, through the parallel port, and then use a 555 timer IC to produce the PWM signal. I have some other projects where I would like to use exactly this technology.

I was thinking of sending an autopilot NMEA0183 commands at the moment, as I have no NMEA2000 interface at present.

Cheers,

Tim B.

CaptBill
02-05-2010, 03:23 PM
If you listen to the professor you could figure it all out by yourself in a couple hours...

http://www.youtube.com/watch?v=zLy0IQT8ssk
or Youtube search "MIT physics gyroscopes" look for a chalkboard

Here is your homework assignment...
Using the principles observed during the chair turning demo:
1) Build a mechanism to mount the wheel on an arm under the seat of the chair which hold the wheel affixed. Same thing only your arms are now free. Mount it out as far as possible. Now make a simple lever mechanism which will push and pull duplicating the act of the professors arm turning the spinning flywheel.
Extra Credit: rig a small sail that pulls the lever insted of your hand

CaptBill
02-05-2010, 08:58 PM
...But in the meantime you will be surprised what this little setup will do.

www.jsward.com/steering/index.shtml

... and in action
http://www.youtube.com/watch?v=tUcYQCKP7CU

Can you find out where the 12v plug is? I dont see one.

CaptBill
02-05-2010, 09:57 PM
1PhBRB1qkpk

Why try and reinvent the wheel? Save your arduinos to make a good MOB system... Cause if you ever fell out you are gonna need one. She might not ever stop!

DaveJ
02-07-2010, 04:52 PM
GPS will give you a track, which is not a heading. The simplest example of this is that in tidal waters, the difference between you track and magnetic heading is your leeway angle.

Cheers,

Tim B.


Hmmm, we might have a different interpretation of what the word heading is, when i say heading, i really mean bearing, by calucalting the difference between your current long/lat with the long/lat you recorded a second ago you can then calculate your bearing and speed.

Tim B
02-07-2010, 05:20 PM
Ah, yes... this could cause a problem... My take is as follows.

Heading - Angle of vessel centreline to magnetic north. When the bow is pointed north, this is taken to be 0 degrees.

Track - The angle between the vector created by your current and last measured position on the ground, relative to a vector of constant longitude (ie. north/south at your current location.).

Bearing - The angle of a target object from magnetic north.

Other opinions may be valid, but this is the terminology used in OpenPilot. Hope this helps,

Tim B.

goboatingnow
02-08-2010, 06:46 PM
Dave J.

Most modern rate gyros are in effet 2 or 3d accelerometers. In fact the term gyro really shouldnt be used at all as no gyroscopic effect is being used.

There is no need to detect lateral movements, yaw, roll and pitch are all that is required.

However I say it again, you mentioned a "stability augmentation system" and drew on aviation comparisons. Helicopters for example have multiple control surfaces, hugely expensive fast reaction control systems and actuators and have a design requirement that requires they maintain for example hover with high precision in the face of extreme perburbations.

Yachts have a slightly souped up flat plate...ie a rudder. Equally the response times are huge in comparison.

The current crop of accelerometer based autopilots are getting close to what the mechanical system is actually capable of. Theres not much more that can be achieved, without fundementally changing the control surfaces.

PS: GPS technology can give realtime heading not required any forward movement, I have such a unit sitting on my desk. Its typically called a satelitte compass. ALso calulating heading from two lat/lons is not accurate. the inherent damping in the underlying calulations makes for quite a wide error and and even wider response time. certainly its no use for autopilots, ( if it was we wouldnt see any compass fed autopilots would we!).

DaveJ
02-09-2010, 12:03 AM
goboatingnow: yer, i mentioned ealier to Tim B that i suspected the rate gyro's where accually accel's setup to output rate of turn. I didn't think anyone in there right mind would make the spinning wheel gyro's anymore. But i'll agree to disagree in saying that in an autopilot system that doesn't have GPS input that it doesn't need to sense laterial movement. By doing that it goes against all the teaching that i've recieved over the years of learning internal navigation.

As to your desktop compass, it is a speical GPS in the fact that it has multiply antenna's in it that are arrange so the unit can sence the phase relationship difference with the incoming signal, and then can compute what direction with respect to itself the signal came from. What i was talking about is using an everyday run of the mill GPS. The inherent damping is accually there to stop wide errors, its used to average out the position data and lessen the errors, but its responce time is slow due to the damping/average of data.

goboatingnow
02-11-2010, 06:45 PM
Thanks for the explanation on the compass, I'll go back and update the software so!

The reason I made the comment on lateral movement, is (a) your example ie your drawing is nonsensical, Lateral movements like that dont occur on sailboats and they do its very small and you cannot compensate for it. Any so-called lateral movement is actual the result of a series of yaws as the underwater body is not symetrical. Again in your drawing and talk of lateral movements , you are controlling a mechanical system that (a) cant respond and (b) Theres no user need to make it respond to perburbations like that.

Tim B
02-12-2010, 02:15 PM
I'm not actually convinced that the control surfaces are an issue, and I see more uses for an IMU than just augmenting the autopilot for steering. If we are dealing with yachts, then we need to concern ourselves with heading, track, Wind angle, and cross-track error. However, if we were considering a powerboat, we may wish to use the SAS/IMU to reduce roll motion (for instance).

If we take Dave's diagram to be in world co-ordinates, then actually, it's not nonsensical at all. It's dead right. What it shows is the classic difference between heading and track, which in non-tidal areas will be the leeway angle. The only question, is how does the autopilot compensate. Taking the case for non-tidal waters for a moment... Typically, the leeway angle shows up as a cross-track error, and the system will try to minimise that error, but only if you're using a half-intelligent autopilot. Often it is a case of setting the magnetic heading and leaving it. In tidal waters you have the same situation, but the XTE due to the tidal stream becomes dominant, and the leeway angle does not actually increase.

So do we need the IMU? well, suit yourself, but it does have some uses. I suggest we start with the simple algorithms, then add refinement later. There are certainly other people I know who would find provision of an IMU useful.

GBN: what software are you using? Also, if you opened up your GPS you may find that there are magnetometers in it, which is the traditional way to work out heading.

Cheers,

Tim B.

CaptBill
02-12-2010, 03:07 PM
What if you could make an adjustable plane at the bow of the boat. Spin a bike wheel at the bow (on a sprit) fast enough,end would it not serve the same function as a tail rotor on a helicopter? Only in reverse. Like having an invisible braking force on chosen plane. More than that, this force can be "pulled" left or right,up and down, and if my understanding is correct, she will be pulled around as if you had a forward rudder. Seems moving the bow around with an adjustable force like this would be the most efficient way to turn a vessel.
What about storm tactics- could you not ,with a system like this, heave to on a BEAT? (turn the spinning wheel broad side to dead ahead, so now you have a braking force forward and backward. You could tune your speed in by the RPMs causing a forward drag momentum.

By the way, onboard computers probably crash so much due to this angular momentum effect. We are asking the hard drive to double as a "shock absorber". The spin causes it to want to remain stationary, forcing the bearing to absorb loads evertime the boat rolls. Get a solid state digital drive or at least you want to mount your drive on the optimum plane.

DaveJ
02-13-2010, 08:12 PM
CaptBill: the harware i'm talking about useing is all solid state, no moving parts what so ever, it uses SD cards as soterage, and you can get them upto 32 gig is size, so thats alot of storeage for maps and charts.

As to your gyro, the old battle ships used hugh gyro is the centre of the boat and they where used for stablization, they use torque motors to process the gyro platform with the end result compensating the ship movement. The battle ship where flat bottom so they could sail into sheltered shallow waters which means in rough sea they need the stablization, now with better hull shapes they just use trim tabs so to speak.

Tim B: has explained better what i was trying to say. You can use the output to drive a set of trim tab's to reduce pitch and roll.

bertho
02-14-2010, 06:52 AM
hi guys,
i follow the thread with a lot of interrest!! look more rocket science than i was thinking..:rolleyes: ,, in fact , it's for a sailboat, so, to follow the wind will be perfect, and when no wind, just follow the magnetic direction, anyway, if not doing a cafe below, i will be there, and if it's strong wind, i will just enjoys sailing and surfing !!!
so.. need to pass under the raymarine or navman(northstar) $$$$ machine to do that...:mad:
thanks a lots for all your clevers questions and answer..i learn a lot about this misterious elctronic...
cheer's
bertho

DaveJ
02-16-2010, 05:07 PM
Here is a versatile IMU with 9 deg of measurements

http://www.sparkfun.com/commerce/product_info.php?products_id=9623

The g rating for the accel's is alittle high for whats required, but its a all in one board.

Tim B
02-17-2010, 05:00 PM
Very neat. There are commercial units with built-in smoothing and Kalman filter techniques as well, but they are more expensive).

Tim B.

goboatingnow
02-17-2010, 05:39 PM
GBN: what software are you using? Also, if you opened up your GPS you may find that there are magnetometers in it, which is the traditional way to work out heading.

No mine's a GPS RTK unit, using two sensors. no need for magnetometers, ( though I have a unit so that it can continue getting heading in the event of no GPS signal. ( but thats differnet).
then actually, it's not nonsensical at all. It's dead right. What it shows is the classic difference between heading and track,

Yes but such errors build up slowly and are quite easily handled by XTE calulations ( as most AP do now). Theres no need for SAS systems to handle this. These are not small fast acting perburbations. Leeway build up over time as does other heading/course issues. Equally accelerometer based systems arnt much good here as the acceleration forces are small over time.

The copper guy
02-18-2010, 09:11 AM
It is necessary to first install the best wind vain steering available with a paddle servo,
This will supply the power required and damping, Remember you will wont this to work in bad weather????
Remove wind vain and attach your gadget or a cheep autopilot!!!!!!!!!
When you get don attach a TV dish and you now have follow me TV!!!
It is possible to run both at the same time???
Have fun guy"s

Silic0re
03-22-2010, 10:42 PM
(Can't say I read the entire message)

I've written an industrial auto-pilot for vessels and I used a dual-PID controller approach. The first PID controller does rate limiting and feeds what is referred to as a "rate suggestion" into another PID controller that selects the appropriate rudder angle.

The key behind a good auto-pilot is filtering on the input side and calculating turn rate. You only need GPS if you are doing track following or taking NMEA input for waypoint following. Adding an IMU and wind bird can help with counteracting environmental forces.

Running tests on my somewhat similar autopilot setup shows that even without a wind input and in high seas the autopilot will achieve a steady rudder angle to hold against the environment, it just takes a little longer to settle out. Tuning on the front end takes a lot of work.

bigkahuna
06-27-2010, 07:49 AM
Pardon me for resurrecting an old thread, but I ran into this topic while doing some homework for a project I hope to start soon. Basically I would like to build a PC computer driven autopilot for an autonomous boat. I was thinking about using a simple charting app (such as Polar Navy http://www.polarnavy.com/ assuming they add NMEA out), a cheap USB GPS, a cheap USB 3 axis compass, and a Serial Servo Controller (such as this by Pulolu http://www.pololu.com/catalog/product/207 ). The boat will weigh less than 50 lbs and will be driven by a trolling motor (or similar). The loads should be small enough so I can either direct drive steering to a heavy duty servo or use a simple lever. Essentially how it would work is that you'd pick waypoints in the charting app to create a track, and the autopilot would steer along the track until the final destination is reached. All I need now is some software to turn NMEA XTE into control data for the servo controller which, although I haven't started digging into this yet, I feel shouldn't be too hard. For anyone who's written code of this type, any pointers / advice?

Silic0re
06-27-2010, 10:10 AM
The question would be, have you written any code yourself? You can find a lot of theoretical "code" for autopilot's that really revolves around a lot of math and usually stops short of the actual control signal.

It might be better for you to take something like this:

http://diydrones.com/profiles/blogs/ardupilot-main-page

And reverse-engineer it to run on the PC. All the code for it is free, but it's more tailored to flying auto-pilots than floating ones. That's not too big of a deal though, the planes use rudders, you just have to take the third dimension out of the equation.

bigkahuna
06-27-2010, 10:23 AM
Thanks SilicOre. Although I'm a software developer by trade, this will be my first project of this type. I'm familiar with ArduPilot and frequent DIYdrones, but what I'm hoping to do will be considerably simpler. As I understand it (and I'm just starting my research on this), the charting software does the bulk of the work (taking the boat's current position and plotting it against the intended track) and essentially what I will need to do is to translate the XTE into a new course for the rudder to steer. I'm hoping this will be a fairly simple thing to do so I'll probably do it in Visual Basic or some similar easy to use language.

Silic0re
06-27-2010, 10:29 AM
Well then that makes things considerably easier :)

Here's what I would do:

1. Start out with a PID controller. The input to the PID controller is the position error (the XTE, positive or negative), the output would be a steering angle.
2. Write a program that implements the PID controller in software, and uses the output to control the servo through the Pololu controller.
3. Start tuning gains.

You can read my article on PID controllers in .NET here:
http://www.codeproject.com/KB/recipes/IndustrialDotNetPID.aspx

I've used a similar PID controller for an industrial auto-pilot using 2 nested PID's to control both turn rate and course.

bigkahuna
06-27-2010, 01:26 PM
Thanks SiliCore,

I gave your article a quick read and even that's more complicated than what I was envisioning. A PID controller is probably the better way to go, but for the first iteration of this project I think I'll keep it super simple, ie. keep the bow of the boat pointing towards the next waypoint. ;) I may even go so far as to add a "fudge factor" if the XTE is too big and have it over steer back towards the track line.

Silic0re
06-27-2010, 01:39 PM
Unfortunately that won't work out as well as you hope, as I've found out.

The problem is that a boat doesn't always (more specifically - usually) move in the direction that the bow is facing. That's why there is a difference between heading and track. What you will need to do is adjust the track (calculated as the bearing from the last measured location to the current location) to be pointing at the next waypoint. If you just do heading and there is any kind of a wind, especially with a small boat a high ratio of air draft to water draft, you will "slip".

bigkahuna
06-27-2010, 01:48 PM
Understood. Although this will be the first autopilot I will design, I've got several tens of thousands of miles experience using them. In addition to set caused by the wind, there's also current, etc. to think about. I'll eventually have to factor all this in and go the route you suggested, but for now it's all a bit over my head... that is, unless you happen to have a Vbasic autopilot app laying around? ;)

Tim B
06-27-2010, 02:27 PM
There are a few Open-source autopilots around. Notably, YBWOpenPilot. This has nothing to do with my OpenPilot project, but may be worth looking into. You might also want to consider my OP work as a starting point (C++ & QT4). I have recently picked up a VIA EPIA 5000 board, so at some point I will be developing a chart plotter using that, however, OP should run on pretty much anything that supports QT4.

I would suggest a simple heading-hold system would be a good starting point.

Best of luck,

Tim B.

bigkahuna
06-27-2010, 02:51 PM
I would suggest a simple heading-hold system would be a good starting point.
Thanks for your input Tim, that's exactly what I plan on doing.

DaveJ
06-28-2010, 11:12 PM
Bigkahuna: I might be able to help you in what you need. A simple way of correcting for xte is to calculate the amount of xte, is the xte error increasing or decreasing, and what side of the line do we have the error.

The side of the line is to work out if we should rudder left or right to fix the error.

The amount of error determines how much we should change the angle of rudder.

Is the xte increasing (getting worse) or decreasing (getting better), if its getting worse we need to feed in more rudder angle change to quickly correct it. If its decreasing we need to stop inputting change, or even take some off.

So basically what i'm trying to say is, you use your amount of xte to change your rudder angle and you use the rate of change of xte to control the gain of how much you change the rate of rudder angle corrections. IE if your xte is increasing you want to put in bigger adjustments to get the boat heading back onto track quicker, also if the xte is falling just as fast, you will want to block or lessen the rudder angle change inputs as to prevent hunting and make the track of the boat back onto its intended track smoother.

Notice i haven't used a sensor to measure rudder angle, i don't care what angle the rudder is on, i only care about the effect it has on the boat. This means with a single error that comes from your GPS/chartplotter in the form of a XTE you can compsensate for wind and tide drift, as well as course change in the chartplotter when it changes over from one nav point to another.

Hope this helps.

bigkahuna
06-29-2010, 05:11 AM
I think what I will do for the first iteration will be similar to how the tiller pilot on my last sailboat worked:

1. I will use a 3 axis, tilt compensated compass to determine the boat's current heading.

2. Desired rudder angle will be determined by number of degrees boat's heading differs from desired heading times some variable up to a preset maximum angle.

3. The servo I will be using will give me rudder angle.

4. The desired heading to steer will come from the GPS + charting program.

5. When the boat comes within "x" meters of a waypoint, the system will drop the old waypoint and then calculate based on the next waypoint.

I'm pretty clear on how to do numbers 1 through 3. I have an idea how I'll do number 4, I believe this can be had from a simple NMEA sentence. I'm not sure about number 5 yet, whether it's something included in charting apps or GPS's. The GPS I have at the moment doesn't include support for waypoints or tracks, so it'll either have to come from the charting software or I will have to calculate it separately.

Silic0re
06-29-2010, 08:49 AM
The amount of error determines how much we should change the angle of rudder.

Is the xte increasing (getting worse) or decreasing (getting better), if its getting worse we need to feed in more rudder angle change to quickly correct it. If its decreasing we need to stop inputting change, or even take some off.

So basically what i'm trying to say is, you use your amount of xte to change your rudder angle and you use the rate of change of xte to control the gain of how much you change the rate of rudder angle corrections. IE if your xte is increasing you want to put in bigger adjustments to get the boat heading back onto track quicker, also if the xte is falling just as fast, you will want to block or lessen the rudder angle change inputs as to prevent hunting and make the track of the boat back onto its intended track smoother.


What you described here is the PID controller. The heading error (the P term), the increasing/decreasing the angle for the rudder angle is the D term, an the I term is the rate of change described in your last paragraph.

Let me know if you need any help, designing and writing control systems for vessels (big and small) is what I do for a living.

Tim B
06-29-2010, 04:01 PM
OpenPilot could be extended to handle 4 & 5 quite easily. However, I cannot do it due to time constraints. Feel free to download the source and have a play. It requires the latest GDAL libraries (for S-57 charts and grib only) and QT4.

Cheers,

Tim B.

bigkahuna
06-29-2010, 04:13 PM
Thanks Tim. One of the things I did before posting here was to look at your project and to be honest it's way over my head. I will probably do something really simple in Vbasic that reads the NMEA stream and then sends simple ASCII control code to a serial servo controller.

I also considered using ArduPilot, similar to what Harald Molle did here: http://www.diydrones.com/profiles/blogs/ardupilot-goes-into-the-water.

He's already posted a fairly complete solution, but I would rather drive everything directly from my netbook instead.

Tim B
06-30-2010, 02:03 PM
Ah, sorry to hear that. OpenPilot is written in a very modular manner, so it should be a case of "plugging" the bits together. For this you need to understand how QT4's signals and slots work. There are some very good sources for this (not least the QT4 documentation). The presentations in the source-tree should give you a good idea of how it goes together. Looking at the bits in isolation could be quite confusing.

Tim B.

tspeer
07-01-2010, 03:16 AM
Thanks for your input Tim, that's exactly what I plan on doing.

Good idea. You'd want a heading-command loop as the basic function of the autopilot. An inner heading rate loop would be a good idea, too, to give you better damping and bandwidth.

Then you can wrap other loops around your heading loop to navigate waypoints, etc. A change of heading corresponds to the rate of change of cross-track error, so a heading loop has the effect of adding damping to your waypoint tracking.

When you do get to waypoint tracking, don't just use a heading command that is proportional to cross-track error. Instead, think of a greyhound running after the mechanical bunny on a race track. You want to have a virtual bunny that is a fixed amount of time ahead of the boat on the desired track, and continuously aim the heading for that point. The shorter the time interval, the higher the effective waypoint tracking gain will be, with the attendant issues of over-controlling, etc., if the time is too short. If the time is too large, you'll have sluggish response.

Chasing after the virtual rabbit is especially useful for large cross-track errors. A pure proportional system can get into the situation where it just circles continuously if it doesn't intercept the path right away. It only knows to turn if there is an error, and as long as the error persists, it keeps turning. So if the boat is more than the turning diameter from the track, it's hosed.

With the virtual rabbit approach, if the boat is a long way from the track, the along-track lead of the rabbit is negligible and the boat will come in at 90 degrees to the track from a along way out. As it gets close, the lead becomes apparent, and it makes a nice exponential capture of the track, with no need to have a separate mode for capture vs tracking. You also don't need turning circles for turn-short waypoint sequencing because you can just switch to the new waypoint and the transient response of tracking the virtual rabbit does it all for you.

The waypoints themselves are always the eternal trilogy of past, current, and next. When the boat passes (fly-over waypoint) or approaches (turn-short waypoint), the current waypoint becomes the past, the old next waypoint becomes the current, and a new next waypoint is fetched from the planned route. If the boat passes directly over a waypoint before it sequences, then there will be overshoot when progressing to the next. The turn-short waypoints avoid this by turning early so as to straighten out on the new course.

Spend a lot of time working out how to detect failures in the equipment. This accounts for the majority of the software in a safe and available control system. If you don't have physical redundancy, you can still take advantage of analytical redundancy. For example, rates can be integrated to get angles and angles can be differentiated (or filtered) to get rates. So if you have both heading and a rate gyro, for example, you have redundant information that can be used to detect when one of the sensors has gone bad. You may not be able to isolate it to the specific piece of hardware, but at least you'll know to stop using suspect information and get human assistance.

Bad sensors can be especially invidious because they can really drive the system into la-la land. Communication errors you can detect with parity bits, checksums and wrap-around words. Actuators can be compared with models of their response to commands to see if they are working as intended. Computers tend to work or not work at all. But unless you have either physical or analytical redundancy, you don't know if a sensor is lying to you or not. Sensors are getting cheaper and lighter all the time, so physical redundancy is more and more attractive. Parity checks can both detect problems and isolate them to the right hardware.

bigkahuna
07-01-2010, 05:25 AM
Thanks Tom, you've given me quite a lot to think about.

Ulrich
07-01-2010, 07:32 AM
I am joining late to this discussion. I programmed an AP years ago (VB6); it works very well but I am still not done! My approach was to convert the rudder readout into digital data and to process those data along with compass course and rate of turn, both NMEA 183, 10 readings/second. The rudder actuator is then controlled by two digital ports.
Another approach is to use an analog sine/cosine output of a compass and cross link it directly to the rudder follower and the actuator. This requires some good electronic knowledge and (in my opinion) it is a lot more difficult to let the AP "learn" about the environmental conditions such like wind drift, current, waves etc.etc.
The way I choose to go fully digital works for me but I faced problems I was never aware off, such like the unpredictable behavior of timers under windows not to talk about the "preemptive" operating system which does not allow to set task priorities. To overcome this problem I am using Labjack's U3 analog / digital processor board to collect data streams, average them and feed the processing software. Bottom line: good programming knowledge is not sufficient, good electronic skills are needed as well. If you write your software don't run just one .exe file! Split into two applications, data acquisition and data processing. Else you may find your rudder all over sudden "hard over" because your trigger signal to stop the actuator was delayed or the actuator can't find rudder mid ship. As usual in software development: 10% functionality coding and 90% control and safety algorithms.
Ulrich

bigkahuna
07-01-2010, 07:56 AM
Interesting post Ulrich, especially your advice on separating the application into different pieces. In my case I plan on using a heavy duty RC servo such as this one:

http://www.servocity.com/html/hs-805bb_mega_power.html

Which is like combining the rudder sensor and drive motors into one, thus simplifying the hardware side substantially.

Ulrich
07-01-2010, 11:18 PM
bigkahuna:
sorry, I may have missed something. I am talking about an autopilot to steer a displacement hull vessel of 80t where hydraulic actuators are needed. For a small craft an electric actuator might work well to position the rudder provided it can deliver the torque continuously i.e. 100% duty cycle. The servo you are pointing to stalls at a torque of about 25KG.cm so what is the application you have in mind?

Tim B
07-02-2010, 03:09 AM
Ulrich,

Whether you need to split up the software or not depends on where the feedback loop in your control system resides. In bigkahuna's case that feedback loop is in hardware, so there is no issue. If you bring the feedback loop into software, then there may be cause to run the "Servo" algorithm in a separate thread or even program.

Bigkahuna:
Can you give any dimensions for this vessel? Particularly on rudder geometry, stock location and operating speed? For any significant size of vessel I'd be surprised if an RC servo would be sufficient. Some of the linear servos they have look quite good, though. There are a lot of industrial linear servos which you can pick up for pretty much any task you need.

Cheers,

Tim B.

bigkahuna
07-02-2010, 05:00 AM
Sorry I didn't realize that I neglected to mention this in my first post. I haven't designed the boat yet, but it will likely be around 40 - 60 inches LOA and under 50 lbs displacement. I would guess the loads on the tiller will be measured in ounces, not pounds and consequently the servo I linked to is over kill, I'll probably be able to use something smaller.

Tim B
07-02-2010, 01:00 PM
No problems with the actuator then! You will have the problem of fitting a waterproof autopilot in, though, and that might limit your choices a little.

Cheers,

Tim B.

X7JAY7X
06-21-2011, 11:18 PM
Been a while since this thread was posted to. Is anyone still working on this?

Tim B
06-22-2011, 04:07 PM
No idea, however, for another computer-control task I have written a servo-driver utility for OpenPilot to drive the POLOLU Maestro range of boards. I have also been looking at using a very auto-pilot-like system on an Embedded ARM TS7550 board, with some sucess, so the general area is still active.

Tim B.

X7JAY7X
06-22-2011, 10:05 PM
I am working on one and I came across this thread. I was wondering if anyone else was still working on something.

I bought a autopilot drive motor for my boat last year. To get the project started, I wrote firmware for the microcontroller to control the motor driver IC. It allows servo control of the drive motor. I took it one step further and wrote code to allow me to control my boat from an RC remote control. That worked great.

I am now back on the project and I have written microcontroller firmware that can read and parse the NMEA autopilot string from OpenCPN. I have a little more code to work on then it will be very close to a fully automated autopilot. I will hopefully be ready for sea trials in the next few weeks.

farjoe
06-23-2011, 12:58 AM
I am working on one and I came across this thread. I was wondering if anyone else was still working on something.

I bought a autopilot drive motor for my boat last year. To get the project started, I wrote firmware for the microcontroller to control the motor driver IC. It allows servo control of the drive motor. I took it one step further and wrote code to allow me to control my boat from an RC remote control. That worked great.

I am now back on the project and I have written microcontroller firmware that can read and parse the NMEA autopilot string from OpenCPN. I have a little more code to work on then it will be very close to a fully automated autopilot. I will hopefully be ready for sea trials in the next few weeks.

This is interesting. May I ask which drive motor you bought and from where?

I always get stuck when I need to do or get the hardware stuff.

Tim B
06-23-2011, 05:37 PM
And also which microcontroller?

Tim B.

X7JAY7X
06-23-2011, 07:51 PM
I bought an older Octopus drive for cable drive steering off of criagslist. It didn't have the feedback sensor so I had to add a potentiometer to it with some gears. It works well.

I am using a Arduino currently. I was thinking about switching to a 32-bit processor but for now I decided against it because alot of the code is already written for the Arduino. If I handle the cross-track error calculations in the micro I may consider switching. I am only using GPS data, no compass. That may be a later addition.

To avoid oscillations in the steering due to slow update rates from OpenCPN, my GPS is cable of updating at 5, 8, 10, and 20Hz. I had to modified the OpenCPN source code and then recompile it to a allow a faster update rate to the micro.

CaptBill
07-01-2011, 07:29 PM
I am working on one and I came across this thread. I was wondering if anyone else was still working on something.

I bought a autopilot drive motor for my boat last year. To get the project started, I wrote firmware for the microcontroller to control the motor driver IC. It allows servo control of the drive motor. I took it one step further and wrote code to allow me to control my boat from an RC remote control. That worked great.

I am now back on the project and I have written microcontroller firmware that can read and parse the NMEA autopilot string from OpenCPN. I have a little more code to work on then it will be very close to a fully automated autopilot. I will hopefully be ready for sea trials in the next few weeks.

Hi Capt,
Is she a powerboat or sailboat? I have been working on a small code library which I plan to drive a hybrid system for a sailboat. By hybrid i mean it is driven mainly by the sail/sails themselves which are cam geared directly to the tiller. The arduinos job will be to simply make small corrections, mainly by a simple (but much smaller) linear screw drive along the length of the tiller, changeing the angle to effect the amount of tiller ratio. With this setup there is no need for a power source. The larger force (from mainsail) is much higher than the demand of the tiller correction so much so that placing a GENERATOR in-line is needed instead of a power source(same motor and mount it is just a braking force now). so essentially now, we have two circuits that need to be controlled. One varies the tiller ratio/angle and one to vary the braking force (a dynamically tunable dampening force too). Two potentiometer knobs is the heart of this system, working constantly 'dialing in' a mechanical camed arrangement.

Autopilots shouldn't need to be powered if you boat posses a 'Helm'. Your helm allows a small force to correct a larger force. So if you can connect the larger force to the helm you can make necessary corrections for course AND produce power. In fact the producing of power on top of taking some for the helm will affect overall 'trim''. Equalize the forces instead of trying to fight them with dc power. a mechanical autopilot just works better and harder in situations your dc autopilot can't handle.

Concerning the code library its job is to calculate fairing curves (beziers,bsplines etc) set on a tuned scale (as opposed to equidistant grids). The idea is to get away from 'digital' and get 'hi-fi analog' ramp curvatures that can be adjusted dynamically at will by sensor readings. The mechanical setup is 90% of the system and works excellent on its own,by a super sensitive direct connection to the tiller. It just needs slight tweaking every few minutes or so to maintain perfect trim(power consuming) and/or to track an exact course with GPS.It also will double duty to sense optimum dampener (power producing) abilities of the system.

The library is developed in Freepascal/Lazarus which is the opensource version of Delphi for Windows. It is the ultimate cross/compiler development environment. A steep learning curve up front but the object model is where it's at... the Mazaratti of programming languages, all in all. Perfect match for the Arduino because you can compile THE SAME CODE to power it from your iPhone with bluetooth wireless and have the option to power it from windows, linux, even Mac as well. Write once, compile anywhere.

The library consists of objects/components that simplify curve calculations by eliminating unneeded point data an targeting 'golden ratio' or 'Hi-Phi' points set up a scale ratio. Instead of all points on a line (which are technically infinite) it computes, say 7 chosen points from the phi value and stores them in an array. This is important with arduinos because you have 'analog' curvature from 7 key points. One simple call to move along the scale...

x:=THiPhiCurve.create(50,30,7);
THiPhiCurve.setIDX(6);

//create curve 50 inches long by 30 in high store 7 indexed 'hi=phi ratio #s'
//this sets the ThPhiCurve object value to 6 which an integer index of the array pointing to a high resolution number stored in the array...THiPhi.indexVal[1]:=30.95123 etc.

The library is is intended for hi-resolution as well as low-resolution usage(for arduino etc), just set the resolution property of the object.

I have no access to an Arduino to play with and would be interested to see if this code does what I'm hoping. Would be great to see someone like yourself DIY your own killer autopilot system/ride dampening/power generating setup.

Even a powerboat could leverage this by integrating the concept via stabilizer fins, I would imagine.

Frosty
07-01-2011, 09:29 PM
I gather this discussion is for model boats and not real ones.

If there is one thing I consider seriously important its any electronic device that navigates my boat.

-----------------------------------------------------

Lucifers horns found on mount Sinai Luciferstuff.com

CaptBill
07-01-2011, 10:53 PM
I gather this discussion is for model boats and not real ones.

If there is one thing I consider seriously important its any electronic device that navigates my boat.

-----------------------------------------------------

Lucifers horns found on mount Sinai Luciferstuff.com


Hi Frosty,

Long time no see. This is scalable if we are talking RC boats too. Just smaller. Fishing line, and mini servos (generators).

And as far as electronic devices controlling your boat i say is a bad idea when your boat can control itself without any electronics. Electronics are optional as a matter of fact. Any sailboat can dial in it's own high power windvane...just cam off the main directly to the tiller. Or how about just wick the power from the backstay? The electronics serve in a totally different way now. The Arduino will drive the amount of power generation instead of driving the whole system. A variable braking force (dc generator) augmenting a simple old,old, old school autopilot from before DC.

This is from old school sailing tricks from before DC power was invented, fellas.

Your boat is already 'wired' for the ultimate windvane. Just plug the freakin' mainsheet into the friggin tiller handle. Hello!

...and Voila

300 square foot windvane. (but with ZERO LATENCY, unlimited power band yet generates power instead of consuming it)

I see plans around using simple block and tackle arrangements that work well and none that use cams which I believe may be all that's necessary for a totally mechanical solution...electronics or not.

Frosty
07-01-2011, 10:59 PM
A wind vane will sail a sail boat in the direction you have set it in relation to the wind. Calling it an auto pilot is incorrect.

So many of these ugly contraptions for sale in the junk shops and boats with visable holes epoxied on the transom where history once was.

---------------------------

London bus found on the moon

Moonbus.com

CaptBill
07-01-2011, 11:08 PM
http://www.jsward.com/steering/index.shtml

http://www.solopublications.com/sailariq.htm

http://www.youtube.com/watch?v=tUcYQCKP7CU

http://www.youtube.com/watch?v=2-CYP6GMkwM&feature=related

Frosty
07-01-2011, 11:16 PM
Dangerous stuff, nothing more than hands off device for a minute or two to drink your tea.

Or lake sailing where you can see your destination no more than 1 km away.

Auto pilot this is not.

Like putting some string on your throttle pedal and saying you have cruise control.

----------------------------

3 wise men found in America

wise men .com

CaptBill
07-01-2011, 11:27 PM
Dangerous stuff, nothing more than hands off device for a minute or two to drink your tea.

Or lake sailing where you can see your destination no more than 1 km away.

Auto pilot this is not.

Like putting some string on your throttle pedal and saying you have cruise control.

----------------------------

3 wise men found in America

wise men .com

Well if it is connected to a sail and the sail pulls the string pressing the pedal AND controlling the steering wheel in the correct direction the i would say that's one fine automobile you have there.

XyCEEne2bmg

CaptBill
07-02-2011, 02:19 AM
Here is a good testimony on a $3 autopilot...
(autopilot about halfway into video)

http://www.youtube.com/watch?v=ZN3MS1vYv_4&feature=mfu_in_order&list=UL

CaptBill
07-02-2011, 02:33 AM
I think i found the best one yet! ....(lot's of new vids of self-steering systems on youtube here lately)

This man is loving life i can tell ya with his set up.

look at this right here...

http://www.youtube.com/watch?v=PY1qx3PfUS0&feature=related

X7JAY7X
07-05-2011, 09:10 PM
Frosty, my setup is for a 24' powerboat. I agree that an autopilot is serious. This may be a hobby but that doesnt mean that I take it lightly. So you think only a team full of people at well known autopilot companies can make autopilots? I do not think so. I am an electrical engineer, not someone who is new to hardware/software and is doing this on a whim.

Frosty
07-05-2011, 09:14 PM
I was refering to the bits of string tied to the tiller of a sail boat.

I have a power boat and dont have an auto pilot. A 44foot cat at 22 knots needs constant surveillance of the water ahead and debris or fishing stakes but that a different issue.

CaptBill
07-06-2011, 12:31 AM
Actually i had much more in mind than these $3 setups. This is cart and buggy days stuff compared to what i have in mind....but look how well the $3 cart and buggy performs....can't beat the amp draw!

Dave911
08-03-2011, 03:19 PM
I have a home made navigation chart plotter / autopilot that I assembled. I do industrial control engineering as my business but I love boats.. I looked at the available autopilot systems and I am not impressed. They seem very expensive and not really state of the art unless you want to pay $3000 plus which is outside of my budget. If you break it you can send it back for a flat rate repair fee which is hundreds of dollars. Not much is user serviceable. I wanted something more generic.

What I came up with is a PC running OpenCPN under Linux. The PC runs off the boats 12 volt system and can survive an engine start without rebooting or having problems. I have an industrial programmable logic controller which communicates with the PC and receives the Autopilot NMEA sequences. The PLC also receives the NMEA sequences from Fluxgate compass. The PLC controls an electric linear actuator to steer the boat. The actuator has a feedback device built in that supplies the tiller position back to the PLC. I have a remote pendant setup for this also for use in the cockpit that has a joystick on it, along with an on-off-auto switch and status light for the autopilot controls.

I believe that I can fit the PC, PLC, power supply boards etc into a 10" plastic enclosure. I'm going to use a LCD display mounted on a swingarm so it can swing into the companionway or back into the cabin.

I wanted a multifunctional system that can do a lot for not much $ and I think this is going to work very well. The PC is powerful enough to run multiple programs at the same time, ie play music into some stereo speakers, while charting the progress, while typing an email to Aunt Millie etc..

Power consumption is minimal. The PC draws about 20 watts, the PLC just a couple of watts. The actuator only draws power when correcting the tiller position. The screen power consumption depends on the size and type of screen.

Everything is working well and the first mockup is ready for testing and tuning on my 29 ft sailboat.

What I am wondering is if this system works as I believe it will, would this be something that some of you would be interested in buying whole or in some portion?

Tim B
08-03-2011, 05:20 PM
This is along the lines of what I'm intending to do with OP. Although I do not expect to make any money. You might like to talk to the OpenCPN guys before selling it. I'm sure they'd be happy, but you have to be clear in your sales terms. You would not be selling an autopilot, you would be reselling the hardware to run an autopilot, tested with a particular chart-plotter.

Do you have pictures?

Tim B.

X7JAY7X
08-03-2011, 09:01 PM
Dav911. I used to do PLC programming as my main job for a few years. Now I mainly do HMI's. What PLC did you use? Just curious as most require 120vac or 24vdc. I would also be concerned about moisture. If I was to use a PLC I would make sure it was conformally coated. But this does drive the cost up. I planned on potting mine when I was happy with it.

Dave911
08-03-2011, 10:30 PM
Tim B.

>>You would not be selling an autopilot

Well, actually I would be. What runs on the PC is pretty much irrelevant. OpenCPN or SeaClear II could be included free of charge or the end user could install it themselves. SeaClear II also supports the same autopilot sentence. If Open Pilot output an autopilot sentence that could be used as well. The PLC really doesn't care or know where the data is coming from. The PLC is actually piloting the boat and directing the boat according to whatever desired heading is delivered by the PC/Chartplotter software.

I would not sell something without an intention of making a profit. If I am not going to make money, I might as well simply give it away. On the other hand saving time and effort by buying a pre-assembled and tested system is worth something. Selling and supporting equipment and software also takes effort. I already work too many hours (I have three CNC machine part programs that I still need to generate tonight and test and it is past 10pm. :-/ )

I'm just wondering if there is an interest in purchasing something like this as a assembly or ?.....



I don't have any pictures yet and there is not much to photograph at this point. The PC, power supply boards, PLC are all attached to a mockup board sufficient to keep things in order. The mockup is going on board in the next few weeks for some testing on the water. I'm sure the PLC code will undergo some changes along the way. But I think it is very close.

Tim B you sound like a busy guy. Are you still renovating a house? I've done that and while it saved a bunch of money it is hard work. Say did the Open Pilot UAV guys swipe your name or did it come about at about the same time? Or is it all somehow connected?

X7JAYX.
This PLC runs off 24 volts and I am using a 12 to 24 volt converter to get the 24 volts. They are hard to find but they are available. The one I am using now is not the best unit so I will be trying another one. Very little power is required at 24 volts. There are a few 12 volt powered PLCs available but I don't like their instruction sets. Moisture can be a problem but I am really not very concerned about it down below during the sailing season. If the boat went into storage (as mine does every winter) I would pull the control box out of the boat. Conformal coating and potting can create other issues.

X7JAY7X
08-03-2011, 11:26 PM
Conformal coating and potting can create other issues.

Please explain. Potting is one of the easiest ways to waterproof electronics. There are some things you have to watch for when potting. If not done properly it can lead to issues. All new (and most old) outboard and jetski ecu's and other electronics are potted. I wouldn't want to take a box of electronics out of my boat because I am worried about them getting ruined by moisture.

farjoe
08-04-2011, 12:11 AM
The PLC controls an electric linear actuator to steer the boat. The actuator has a feedback device built in that supplies the tiller position back to the PLC.

I am wondering can your linear actuator handle the outdoor salty environment? If yes, may I ask which model?

also.... what on earth is "potting"?

regards

Dave911
08-04-2011, 01:22 AM
Boards (like motherboards) are designed and tested so no components on the board exceed a certain temperature range. Applying any type of coating or potting without considering the ramifications of how the chips on the board will be affected can cause problems. Also capacitance issues can arise from potting or coatings on the boards that can screw up high frequency circuits.

I've built many control panels that live outside all of the time and condensation issues are really not as bad as you might think. In fact some of the control panels are in areas that I would consider very hostile both from a temperature and humidity standpoint and we have never had any problems. Look at all of the sail and powerboats that routinely keep laptops and TVs on board. I'm sure the failure rate is greater than a laptop that lives in an air conditioned home environment, but for the most part they do quite well.

Dave911
08-04-2011, 01:33 AM
farjoe: I have a cheap IEI actuator right now for testing. It seems to work fine, but I'm looking for a better one with a ball screw rather than a acme screw. However the one I have was really cheap - about $90.00. If it lasts for a while I could afford to keep a spare on board. I think I will just use it and see how it holds up. There are a lot of actuators out there to chose from.

Dave911
08-04-2011, 01:37 AM
farjoe:
http://www.pottingsolutions.com/my%20site/Technology/overview_of_potting.htm

X7JAY7X
08-04-2011, 10:22 PM
You have to accomadate for heat issues and other things that can lead to problems while potting. The biggest drawback to me is that once potted it cannot be repaired or altered. I have been looking and the cheapest waterproof enclosure w/waterproof connectors I could find was 3-4 times more than a potted solution but it is way more flexible. I would have to make a custom PCB for all my components as well if I went with an enclosure.

BTW, are you using a micrologix?

Dave911
08-05-2011, 10:00 AM
Fancy waterproof equipment/enclosures can get expensive fast. But unless your boat cabin-less why not just put the electronics down below? The autopilot remote I am making is simply a PVC box with oil tight industrial switches.

I see that you are in Toledo... My boat (the test boat) is at a marina just east of Toledo near Reno Beach.

X7JAY7X
08-05-2011, 06:20 PM
Lol. You really don't want to tell me what PLC you are using do you?

I do not have a cabin in my boat but that is not the only reason I want to use a waterproof enclosure. It is the right way to do it. I don't want a mess of parts thrown in a tupperware box. I want a "commercial" looking solution. If this all works out, I plan on getting a waterproof enclosure and a custom PCB made for my microcontroller and motor driver.

I actually used to dock my old boat at Meinke marine. Not far from you. Reno is about a 1/2hour drive for me. Maybe once we both get ours working we can meet up and check each others out.

Dave911
08-05-2011, 11:26 PM
PLC ..I missed that... I'm currently using a Siemens S7-200, but that is subject to change. I had the hardware on hand.
I program a lot of different brands of controllers. Anything that can do a decent job of handling serial communications, ASCII processing and floating point numbers would probably work. I work with AB Micrologix controllers frequently but if I am spending my money, there are better controllers available for less $.

If you don't have a cabin then a water proof unit makes sense. If you do have a cabin then a fully waterproof unit is overkill. Would you buy a waterproof laptop if you didn't have to?

Life is too short to make it overly complicated. :) Besides, my marine radio is not waterproof.

Yep, my boat is at Meinke.. good guess.
>>Maybe once we both get ours working we can meet up and check each others out.

That would be good.

Dave911
08-25-2011, 04:11 PM
I have been working on this off and on over the last couple of weeks and I have added in all of the features found in an older Auto Helm 4000 model except for the wind vane input. Everything seems to work well on land. I am putting together a pendant for remote control. I was going to make everything run off the PC screen, then I realized that perhaps I don't want this to be PC dependent. So now I have three control modes, steer to a waypoint sent over from the GPS/course plotter software, steer to a heading set via the pendant, and manual steer (use a joystick on the pendant to steer the boat). I also have jog target heading right and left in increments of 1 degree and 10 degrees. Finally I added in an auto tack function, which can be controlled via the pendant or little screen. The little screen needs to be loaded and debugged also. (I just ordered it) I have most of the screens developed but I need to add some alarms - heading deviation, loss of compass or waypoint input etc.

Does anyone have any list of the "bells and whistles" desirable in an autopilot??

Does anyone know of a commercial windvane that outputs an analog signal? Perhaps 0 to 10, or 0-5 volts for position? Perhaps I could find a single turn pot and remove the internal stop? Add a couple of bearings and make a vane..

Has anyone found a good source of small PC screens that are reasonable in price? Trying to find a 10" screen that costs less than an entire Netbook computer seems near impossible..

Dave

CDK
08-26-2011, 03:48 AM
Here is an example of an analog angle sensor: http://www.google.com/url?sa=t&source=web&cd=9&ved=0CG0QFjAI&url=http%3A%2F%2Fwww.turck-usa.com%2Fillustrations%2FM1590822%2520(sheet_1).pdf&rct=j&q=analog%20angle%20sensor&ei=ck1XTpn6K4TssgaV1LHWCg&usg=AFQjCNFwONof0rsXWs81lKqUQIFlslGgzg&cad=rja
I would also look at Bourns, automotive devision. A single turn pot isn't a great solution because there is a dead zone of at least 30 degrees.

For small LCD screens, look at DVD players and vehicle backup displays.

Tim B
08-26-2011, 08:20 AM
Why not use a standard wind-vane with NMEA0183 output. That would seem to be the simplest COTS solution, and additionally, a good number of sailors will already have one.

For displays, look around at in-car entertainment generally. There are plenty of 7" sunlight readble TFTs around, though they are not super cheap. While you're testing why not pick up an old TFT from ebay or an office if they're throwing them out. Alternatively, for really small screens OLED might be useful.

Dave, yes I'm still busy doing the house (it's starting to look a bit better now). I haven't had much time to develop OP over the last year or so, but I have started to look at SBCs, and I can confirm that at least a few modules of OP will run quite happily on the TS-7550 that I'm using with no change of source code. The naming was a complete co-incidence with the UAV guys, and the YBW OpenPilot marine autopilot guys.

Cheers,

Tim B.

Dave911
08-26-2011, 09:16 AM
CDK: nice link to that Turck sensor.. I didn't realize that they made analog output rotary sensors.. I'll have to check on prices..
I've looked the DVD player screens and they are all NTSC input but maybe I need to think out of the box more.... I should relook a those as they are cheap. >>Bourns.. I'll take a look. >>30 degree dead zone.. true but I was thinking that I can't sail directly into the wind anyway.. so perhaps if I put the dead zone directly ahead?? Better not to have a dead zone though...
Thanks for the ideas ..

TimB: I can't find many windvanes or windvane displays that directly output NMEA 0183. I'm thinking this might be a simple thing to make. Besides I have a 0-5 volt analog input available and I am out of RS232 inputs and I am too cheap to include a mux. :-) I don't want the windvane to cost more than the rest of the autopilot. I'm thinking about something simple to mount to the stern rail. >>TS-7550 That board is very interesting.. Do you have any experience with their touch screens? Anything sunlight readable seems to be very expensive in low volumes. Am I missing something?? I've got plenty of TFTs just for testing... that isn't a problem. But it sure would be nice to be able to buy a 7-10" sunlight readable screen for less than $200. Hang in there on the house. Work on and around the house seems to be endless.

Tim B
08-26-2011, 03:29 PM
I haven't used the TS touchscreens, but I see no reason why they would be hard to work with, you just need to program a GUI app for Linux and the input and display should work as normal.

I don't think you'll get a one-off sunlight readable display for less than about £300 ($500?). If writing OP has shown me anything it's why chart plotters are so expensive.

X7JAY7X
09-12-2011, 11:34 PM
An update. I tried the autopilot with using GPS only and the way I orginally intended was not going to work. That was pretty apparent within 5 minutes of testing. For this to have a chance of working it would have required alot of rework to my system. I decided to add a compass to my system instead. With little work I had a compass integrated into my system. I took it out for sea trials over the weekend. I tested it by having it maintain a heading. This worked fairly well but my navigation PID loop needs some tuning. I plan to make some improvements to the code and test again maybe this weekend.

tspeer
09-13-2011, 12:38 AM
Incorporating a compass is a great idea. If you are off course by a small angle, the cross-track error will be changing as the speed times the course error. So at a constant speed, heading corresponds to cross-track rate.

When you add heading feedback to a course-tracking loop, you're adding damping, and things smooth out considerably. Simply feeding back cross track error will create an oscillator, with the boat wandering back and forth across the desired track.


Here's a nonlinear technique that will give you good tracking and works for large crosstrack errors as well as small ones. Pretend the boat is a greyhound chasing a rabbit around the track. The rabbit is always just out of reach ahead of the dog, whose attention is focused 100% on catching that damn rabbit. What you want to do is to generate a virtual rabbit and point the boat right at it.

First compute where you are along the desired track and the crosstrack error from that point. Choose a time interval for how far ahead the rabbit is on the desired track, and multiply that by the boat's speed to get the lead distance for the virtual rabbit. Compute the position for the rabbit that is the lead distance ahead along the tangent from the current position on the desired track. Finally, compute the heading from the boat's position to the rabbit. That becomes your command to the heading loop.

This results in a pursuit trajectory. From a long way off the track, the lead distance will appear negligible, and the boat will steam in at nearly right angles to the track, which results in the fastest cross-track rate and a very fast capture. As the boat gets closer in (or if you are near the path to begin with), the boat will start to turn more down the intended track. Eventually, it will fall in behind the virtual rabbit, but like the greyhound it can never actually catch it.

The shorter the lead time, the higher the effective cross-track gain and the tighter the boat will track the course. But it will tend to oscillate if the lead time is too short. The longer the lead time, the smoother will be the tracking, but it won't be as precise. So the lead time is your tuning parameter to get a suitable compromise between precision and stability.

This technique does not need separate capture and tracking modes. You can turn it on from anywhere and it will smoothly capture the track and follow it.

Similarly, you don't need turning circles for turn-short waypoints. At a suitable time prior to reaching the current waypoint, you can simply switch to the next waypoint. (I assume you are using the holy trinity of Previous/Current/Next waypoints, where Current becomes Previous, Next becomes Current, and a new Next is provided from the route. The desired course always runs from Previous to Current.) The boat will make a smooth exponential capture of the new course.

You can apply the technique to continuous curved paths and even waypoints that are themselves moving, too, (think rendezvous) but the math gets more intense (http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&r=1&f=G&l=50&s1=7,228,227.PN.&OS=PN/7,228,227&RS=PN/7,228,227).

Dave911
09-13-2011, 08:04 AM
Yes, a compass is definitely required. I realized after thinking about it further that there are many times when I will not want a GPS involved, at least directly. For instance - tacking towards the waypoint. So I have three modes manual (manual rudder control), Auto (to the compass) and Waypoint (to the waypoint). But in all cases, the compass is in the loop.

I have my rig setup for the boat and I was planning on testing on Labor Day but 5-7 foot waves hampered my plans. :-( But I should have time for testing this week.

I also added a small display that mimics the Pilot control heads that Raymarine sells. I thought that just using a PC screen would be ok, but I want another small dedicated display also.. plus it is going to be useful as a digital compass display in the cockpit.

X7JAY7X
09-13-2011, 11:56 AM
It can be done without a compass, but it is not ideal. As tspeer stated, it would oscillate between the cross track error. There is little documentation on the AutoPilot string that OpenCPN outputs. The documentation I did find showed that the crosstrack error is a value with a precision of 3 decimal places 0.001, it is only 2 though. So the oscillation would have been almost negligiable at a high precision but not desirable. At first I wanted simplicity and I orginally designed this around being connected to OpenCPN. As I soon realized it was too much work and not the best way to go about it without a using a compass. The compass adds more flexibilty as well.

Dave911, what display did you go with? What size is it?

michael pierzga
09-13-2011, 12:16 PM
Im kind of curiuos why you even need to interface the auto with the GPS. I have that function but I never , ever, ever, use it. Im sailing at this very moment...auto steering compass course. What course ? who knows... SW.... but since I see a pack of ships ahead Ive dropped south, and since I see some fish bouys foreward Ive cracked off another 10 degrees to stay clear. In an hour or so Ill climb backup to course, or maybe I wont. I simply never use the GPS link.

Another weak feature of GPS steering is that when you leave port A for port B and steer waypoint you will be traveling on the same pencil thin track as everyone else who is auto GPS steering point A to point B. After a few hours dodging a hundred vessels you will be convinced that everyone is trying to run you down and that the sea is one big traffic jam.

Dave911
09-13-2011, 02:22 PM
I wanted to be able to do it both ways. If you are sailing in open water and your gps is up and running and you can sail directly towards a way point then why not? If you are doing a lot of dodging and tacking then I think it makes little sense to link the two. I wanted the option of doing either and it wasn't hard to grab the heading info from the GPS NMEA data string and feed that into the desired heading to the next way point. The autopilot really doesn't care where the heading value comes from. It would be nice to be able to dispense with the Nmea fluxgate compass. They aren't extremely expensive but I am cheap. ;-) Once I get it going with the compass I may try and work the compass out of they system and see if I can get that to work reasonably well.

michael pierzga
09-13-2011, 02:47 PM
I guess what Im saying is that since I never use it, why complicate your home built autopilot project. My autopilot has a compass input that supplies no digital data. Its simply a magnetic compass that has been modified. The modification is a light source and a photo sensor . The auto seeks the light source. Very simple and this system has been used for decades. The compass is a sestrel moore . The autopilot system and compass modification is German...Segatron. Very simple robust, user serviceable and its been working flawlessly for nearly 20 years.

Perhaps you know more about electronics and the NMEA signal than me and find it easier to use NMEA.

Dave911
09-13-2011, 08:59 PM
I program controls for industrial machines. Interpreting the NMEA data string from the compass was not difficult. I have seen some of the methods of detecting a compass needle. Some are very clever.

michael pierzga
09-14-2011, 01:49 AM
Then you have an advantage and probably access to the off the shelf products so go for it. Autopilots are three distinct components. Control head that recieves the input data for course then transmits it to a relay box which energzed pulses of DC to a drive unit. The drive unit may be off the shelf. Looks like the relay box..alternatly changing polarity output and strength... will be another challenge to construct.

Dave911
09-14-2011, 08:50 AM
Yes, everything is "off the shelf". I believe the hardware I am using is going to work fine. Now it is just a matter of testing and tweaking the software on the water. Once I get this in better form I will post some pictures.

michael pierzga
09-14-2011, 09:45 AM
What will be your drive unit ? For me on direct drive...non hydraulic,...steering , The most reliable DC motors have been pancake motors.

http://www.printedmotorworks.com/wp-content/uploads/GSR-16FD-LR-Printed-Motor.pdf

Dave911
09-14-2011, 11:15 AM
I'm using a linear actuator which has a 12 volt DC motor on it. The actuator has a acme threaded rod in it. The nice thing about it is that it draws zero power when it is not moving. It is constructed in a similar manner to the Tiller pilots that Raymarine sells which IMO are not very robust, but it is cheap. Cheap enough that keeping a spare on board would make sense for longer trips. If this actuator is not robust enough, there are a lot of others available but they cost more. This autopilot could be easily adapted to a hydraulic pump drive or rotary motor for wheel control. But my boat has a tiller so the actuator setup is the first design.

michael pierzga
09-14-2011, 12:12 PM
Thats about the simplest for tiller steering. Do check out the gran prix Mini class arrangements...they are robust.

http://www.minitransat650.com/html/autopilots.html

X7JAY7X
09-14-2011, 01:55 PM
I have a rotary cable drive steering system on my boat (powerboat). While the easiest thing to do would have been to get a linear actuator, it was not ideal for what I wanted. Without some easy way of disconnecting the actuator, I could not steer the boat by the wheel. I had some ideas to use a linear actuator but they would have taken more time and work than I was willing to put into it. I started to built a rotary drive with a clutch. I had all the parts and I built the frame to hold it all but it was very bulky. I got about half way through and actually found a good deal on a commercial octopus cable drive. It was an older model without the feedback sensor (potentiometer) so I put one on. Dave911, do you have feedback from your actuator?

Dave911
09-21-2011, 12:58 PM
>>Dave911, do you have feedback from your actuator?

Yes, I think that is really important. I think an autopilot without some type of rudder position feedback/wheel position feedback would be a huge compromise. A lot of electric actuators have options for built in potentiometer feedback. Feedback sensors (potentiometer types) are not that expensive.

Dave911
10-12-2011, 01:23 AM
Did some autopilot testing yesterday on Lake Erie.. All of the hardware is working great. No hardware issues at all. The cockpit display is great and works in sunlight much better than I expected. This is now all about software. A straight PID loop does not work well. I could get it to steer within about 10 degrees of my target bearing, but it was wandering back and forth. I realized that I need to apply a bunch of rules to the software for this auto pilot. The PID calcs will end up being only part of the control results. My boat is a cruiser/racer and it has a very sensitive tiller. A lot more sensitive than I realized. I was motoring for the testing which makes the tiller even more sensitive since there is prop wash over the rudder. But I could do some drastic things that are pretty near impossible under sail, like allow the autopilot to lose control.

My experimenting with the loop tuning/testing/tuning/testing also made me realize that a rudder position sensor is absolutely necessary. I realized that at some point I need to be able to shove the rudder back to center position. That would not be possible without a rudder position sensor - good thing I have one.

I also found some other minor bugs but that was expected. I'm going to make some corrections and try them out later this week.

Tim B
10-12-2011, 08:13 AM
I'm not sure what's happened to the YBW OpenPilot project (no relation to my OpenPilot project), their site is down, but the project is hosted on Sourceforge, so you can get at the source-code. It would be worth taking a look at thier source, as I think they had their system pretty well set up.

http://sourceforge.net/projects/ybwopenpilot/

Tim B.

Dave911
10-12-2011, 09:11 AM
I looked at that before, but I went back and looked at it again also, just to check. It uses a straight PID loop.

Do you know of any other published control loop schemes for marine autopilots?
I think I can dig through some aircraft autopilot software but that would probably be only marginally adaptable.

I may have to simply try programming in some rules, and use the PID controller as a contributor to the tiller control. The PID controller was lacking much more than I expected. But my tiller is very non linear. I definitely have to include limits to the tiller throw in the software. I have a 12" stroke actuator and with the tiller extended or retracted 4" I am doing tight circles in the boat. I could have gotten by with a 8" stroke actuator.

Petros
10-12-2011, 02:23 PM
Hi all, I have been monitoring this thread for some time and now I have a comment. It has been many years since I have worked on feedback control systems, but I remember it is not really possible to simply program an actuator to bring the system back on "center" because the response of the system is dependent on the behavior of the areo/mechanical/hydro interactions. like on an aircraft, you had to analyze the control inputs, the structural deflections, and the aero response in order to make an autopilot that will give smooth course corrections and keep it safe.

It sounds like the problem you are facing with the tiller input is similar, it the autopilot is over correcting faster than the "system", your boat, can respond. It might be possible to correct this with trial and error programming, but without an understanding of how quickly the course changes with tiller input, this would be a very difficult thing to program. You can have both primary and second order response affects than mathematically can be very complicated. It is likely that the yaw of the vessel is not liner with tiller input either.

So you first need to consider exactly what and how fast the change in course will be when there is input on the tiller. You should slow the autopilots response some and put in more dampening I suspect (we used to call damping the zeta function). If you are going to attempt to improve it by trial and error, this is what I would attempt first, the mathematics of a sail boat underway are very complicated (and usually unstable). Be aware however that it is possible to put too much dampening and too slow a response as well, which will give you a different kind of problem than the overshoot-zig/zag problem you have now.

Good luck with it.

Tim B
10-12-2011, 02:39 PM
Petros, the mathematics of a sailing boat underway are only an issue if you wish to simulate the boat for testing purposes, though I think you are right regarding the over-control issue. I think the PID loop should be a good basis, as it takes the same form as the dynamics equations that the boat is responding to.

It sounds like you need to limit the rudder angle (in software preferably), and significantly reduce the gain. Also, you should log all the parameters (speed, heading, track (lat & long), rudder angle, rate of turn, rudder demand etc.) then plot them so that you can start to see where the problem is. Post the plots here and we'll give you as much input as we can.

Tim B.

Dave911
10-12-2011, 06:48 PM
>>but without an understanding of how quickly the course changes with tiller input, this would be a very difficult thing to program

Bingo! Many commercial autopilots require that a boat is run through a number of tests to tune the unit. One test I have heard of is to let the autopilot make a controlled 360 degree turn. I think they do that to determine the rudder response - basically the turn rate of the boat, such as in degrees per minute when the rudder is at x displacement. The rate of turn per displacement of the tiller is definitely non linear.

So part of my new programming will include a tiller displacement to rate of turn look up so I can predict how the boat will respond given a certain rudder displacement.

I don't think the problem is incredibly difficult. After all I have been steering this boat by hand for many years. :-) And I have been predicting when the bow will come onto the desired heading all along. I need to do the same with this autopilot. I just need to program in what I have been doing. I have programmed in an auto-tack function already which I think will be very important as I am single-handing this boat most of the time now. (The kids grew up) So the autopilot must be capable of handing a major upset - like a 120 degree controlled turn to tack without loosing control. I am already ramping the turn, but it needs to be fairly fast to allow a successful tack in light air.

X7JAY7X
10-13-2011, 10:49 PM
Dave, glad to hear you're making progress. I am done with mine for this year. The boat is almost ready to be pulled out. I had mine working but it didnt work great with a simple PID loop. I had about the same results you did. I could get into about 10° of my bearing but it would never get to my desired bearing. Next season I am going to look for a different motor driver. I do not like the one I have at all and I think it is making my control loop more difficult to trouble shoot. The driver I am using uses communication protocols to tell the motor how fast to run and in what direction. Instead I want a more low level approach where I have complete control over the speed and direction without comm protocols.

Either way it is very apparent that it needs more work to maintain a bearing with minimal error. If you come across any papers talking about autopilot control schemes please let me know. That would be very handy.

Dave911
10-14-2011, 12:11 AM
It is getting there.

It is interesting that you also did not have good results with a PID loop. I could adjust the gains so it would never make it to the heading, overshoot, or get there but then fish tail back and forth. I think the non linear action of the rudder is really hurting me and I at least need to at least compensate for that. I should be able to do a couple of experiments and determine just how non-linear it is by displacing the rudder an amount and then measuring the angular rotation of the boat in degrees per min and do that for a couple of different displacements of the rudder. If I can figure out the formula to linearize the PID output to boat rotation rate I should be able to apply that to the PID output to compensate for the non linearity of the rudder.
I am going to program in a couple of different controls schemes and try them out. I need to be careful as there is a limit on how much I can do to make program changes while underway. Hopefully the lake will be fairly calm later this weekend, but they were talking about 35 mph gusts tomorrow which will stir up Lake Erie.

I really want to nail this control software before I have to pull out. I don't have any control over my actuator speed, it is fixed, but it is plenty fast so it easily keeps up the PID loop output in moving to the desired rudder position.

Are you using a motor to spin a wheel or do you have some type of actuator for a tiller?

I think the marina would prefer that I pull my boat out, but I really like cool weather sailing. I asked when they were going to shut down the travel lift (my usual question) and they said Nov 10th, so I will probably pull it out that week. The lake levels are really up this year. I usually start dragging the keel in the canal due to falling water levels but in Nov but I don't think that will be a problem this year. They were suppose to dredge the Cooley Canal this year but they keep cutting the federal $ to do it, so it never gets done. If the water levels drop before they dredge, myself and a lot of other boats will probably be in trouble.

X7JAY7X
10-16-2011, 11:29 PM
My rudder is fairly linear. I didn't have a chance to fully tune my PID loop. It didn't oscillate which leads me to believe that I may just be able to tune my PID better and it may work. I need to get a better motor driver first though.

I have a motor with a clutch that is part of the steering box. An actuator wouldn't easily work for my boat without some easy way if unhooking the actuator or using a bypass. I wouldn't be able to use the steering wheel otherwise.

Dave911
10-17-2011, 01:17 AM
Yep, a wheel is an entirely different story.

I went to the boat this weekend but the weather was wacky. The lake dropped nearly 4 feet in level and then came back up most of the way by Sunday night. Some boats in the marina were hanging by their dock lines. I've never seen the lake drop that much, that fast. The marina staff were running around loosening docks lines.

I was able to modify the software and test simulate some things at the dock by twisting the compass and watching the movement of the tiller and the response "looks" better.
Some on the water testing/tweaking later this week (weather willing) should put me another step ahead.

Dave911
10-25-2011, 12:32 AM
Got onto the water this last weekend and did further testing with the autopilot. After modifying the PID output to closer match the rudder response, the autopilot is working well. I tweaked the P gain and that was about it. We motored the entire time this weekend as the wind was way down on Saturday, and Sunday there was no wind on the way out and then there was lots of wind on the way back and the wind was right on our nose. We were driving into 3-3.5 foot waves on Lake Erie. On the way back the wind was doing it's best to blow us off course and the autopilot would tweak the rudder about every minute or two. We went about 40-50 miles between the two days and almost all of it was autopilot time. I can see why everyone loves their autopilot! It sure makes handling the boat a lot easier.

I found the loop Derivative term totally useless and after thinking about it I realized that a boat in water is pretty well damped as it is. I have mostly P term and a very little I term so the rudder finds it's center position on it's own.

I'm going to add more features this week and hopefully take it out next weekend and use the GPS to drive the autopilot under sail. I know I need to adjust the auto-tack code and the loop response during an autotack to limit the boat rotation rate. But my boat's rudder response is a lot different under sail than when motoring so it will be interesting to see how the autopilot performs with sails up.

One thing that I did not expect: The remote pendant that I put together is an absolute must have. I have a joystick so I can put the autopilot into manual and make some quick course changes via the joystick. It is very simple but very effective. No hands constantly required on the tiller. Also, if I see a log or something I need to avoid, I can put the pilot into manual and steer right or left with the joystick, then put the pilot back into auto mode.

A water proof display unit in the cockpit is another must have. That makes tweaking the autopilot very easy, and allows for easy performance monitoring of the autopilot. It also doubles as my compass display.

Tim B
10-25-2011, 01:21 PM
Good stuff, glad to hear it's going well.

X7JAY7X
10-25-2011, 07:09 PM
Dave, did you modify the control algorithm at all or did you just tune your PID? or both?

Dave911
11-02-2011, 12:42 PM
Sorry, I didn't see your messages until now .. email notifications are apparently inconsistent.

>>Did you modify the control algorithm or tuning..
Both and then some ... I have rewritten a few parts of the program 3 or more times now. I've got a lot of time into this program now. I now have two different tiller modes - one is a linear mode and one uses a scaled square root extraction to make the tiller closer to linear. I use the square root extraction routine on my sailboat and that works well.

I also changed the filtering algorithm again to get rid of some discontinuities in my routine which were driving me nuts (head smack! - interation #4 I think).

I can adjust the tuning parameters from the cockpit display - the gain is by far the most important. The boat has a lot of damping already so the D term is pretty much useless, in this last revision, I took it out of the PID loop entirely. The I value is very very small so that it adjusts but over many minutes.

I put gain limiting in the PID (actually PI loop). I had rudder limits but that is a really bad idea I found. It could work with tons of tweaking but the gain limiting is much better. Many other autopilots have rate of rotation limits in degrees per second. The gain limiting basically does exactly that. You have to limit the boat rotation rate otherwise the pilot will make some seriously sharp turns and likely go unstable. That is a necessary tuning/setup for an autopilot I believe.

I studied some other autopilots setup and realized that I needed to add countersteer after a large course correction. That counters the boats rotational inertia and tends to stop it on the proper course heading. Some power boat pilots change these values on the fly, based on speed. More countersteer at lower speeds etc. I have a sailboat so fast is 6 mph. :-) So no need to alter countersteer values yet for this boat.

If you really study how you normally control the boat, all of this stuff becomes a lot more obvious. I have been countersteering for years, I just didn't realize it! :-) The program logic behind countersteering is pretty complicated. I spent about 6 hours yesterday working that out. How to detect that it is needed, when to do it and what parameters would need tuning. The results look good on my test setup so far.

I added all of the parameters to the cockpit screen so I can test it on the water this week.

I'm feeling pretty confident about the software now.

I am not sure if adding in a wind indicator and another mode to sail to the wind is a good idea after all of this testing. The wind shifts direction a lot of Lake Erie. I don't think I want the winds on Lake Erie dictating my sailing direction! I know that ocean winds are a lot more consistent. I also thought that sailing to a heading supplied by the GPS would be a lot more important even for near shore sailing, but now I am thinking that unless I am shooting at targets 50+ miles away, or night sailing (which in Lake Erie is usually night motoring since the wind often dies) it is not really that important. I'm planning on sailing several of the Great Lakes this next summer, and I think it will be more relevant then but for 30-40 mile day sails the GPS connection to the autopilot is really not very important especially if visibility is decent and I have a chart handy.

One thing is perfectly clear though.... I should have done this autopilot thing a couple of years ago when I first got interested in it. It makes sailing a *lot* easier. I'd throw a lot of things overboard before the autopilot went. With an autopilot larger distances are a lot easier to cover! I've been wanting to cruise all of the Great Lakes for a couple of years now but the thought of holding the tiller for 12 hours per day was a little daunting. That is no longer an issue.

I have a ton of time into this software so far and I want to somehow sell this autopilot using the hardware I am now using and I am trying to determine a good approach. Right now this system is PLC based which I want to stick with it for the next year or so. Everything is off the shelf components. I'm going to package it into a drip proof plastic box for cabin mounting. The question I have is: Should I integrate a PC into the box so it that can run a Navigation program that can feed waypoint information to the autopilot?? A laptop running a navigation program with a USB GPS antenna attached would work just as well. But then you have to secure the laptop while underway.. etc whereas this PC would be integrated into the same box - drip proof and secured to the boat... Right now I am leaning towards putting it all in one box since I think I want a PC on board anyway and securing a laptop so it doesn't fly about the cabin is a challenge in itself. But do most people want a PC on board??? I'm afraid that I am not "normal". I usually have 2-3 PCs in my car at any one time. :-/ So what I think is usually not near the norm. Yes, I admit it. A Geek who likes boats.

The big problem with a PC/laptop is that the screens/keyboard are not great in water/spray. And I have found that having a cockpit display for the autopilot for monitoring/tuning is required. Weatherproof laptops are available but my boat cost less than most of them. So that is not a good solution. However laptops and PC screen work fine in a cabin. Also laptop screens and PC screens suck in sunlight. But work fine in a cabin. If I integrate a PC into the Autopilot box a standard screen could still be attached. I have a really small 7" screen that works fine as well and is a touch screen but once again it is not water proof. It actually works fine with OpenCPN etc so it might be good mounted below in the cabin for waypoint creation etc... Honestly I am not sure which way to go. The PC adds about 25 watts of additional power load to the Autopilot. But having a PC on constantly adds other features like AIS display, playing MP3s for entertainment, etc plus all of the other things possible like GRIB weather data display, a constant internet connection via cell phone service (when near shore).. for email and other data services... the list of neat things goes on and on..

If it works out and I sell enough units to make it worth my time, I could port the program to a PC program but I would need to add an I/O board for steering control, remote control pendant cable interfacing, etc but like I said the cockpit autopilot display is really nice (almost required IMO) and a PC screen is not even water resistant. The water resistant problem keeps nagging at me. Perhaps finding or making a water proof, low cost touch screen PC screen that is at least somewhat readable in sunlight is the key to this.. Like I said, I have a low cost 7" PC touch screen. Perhaps I need to take it apart and see about repackaging it so it is watertight or at least water resistant. But then it sucks pretty badly in sunlight...

I'll take a few pictures so you can see what things look like. The drip proof control box does not exist yet as all components are screwed to a plastic board for the prototype.

This message got very long - tell me if somethings are not clear..
Dave

X7JAY7X
11-02-2011, 07:23 PM
Dave, good to hear you have it all working. I dont think I would have to get that complex with my steering algorithm for a power boat. I will need to add countersteer logic though.

I am a geek like you so I do not mind having a PC on a boat. Although, I have to admit, it is a pain. You constantly have to worry about it getting wet. For most people, I don't think a pc or a pc embedded solution has any place on a boat. Just my opinion though. In the powerboat world, people with big boats that have the wheel inside or under a covered canvas probably wouldn't mind it. It also draws unnecessary power. My thought was to eventually ditch the PC and go with a screen of some sort like you have or a plotting GPS.

So how much do you think your whole system would cost?

frasco
11-02-2011, 07:34 PM
Meh, I'm going to build my own autopilot based on Arduino for next summer. And when I do it, I'll make the project open source.

Dave911
11-02-2011, 08:29 PM
>>So how much do you think your whole system would cost?

I don't know yet. I'm trying to get some better pricing on components. I have already gotten a - "you got to be kidding me email" when I tell them what I want to pay for things.. The hardware costs start to pile up. I need to keep this inexpensive, and use off the shelf components, otherwise what is the point? There are already autopilots available that consume a couple of mortgage payments and are expensive/impossible to repair. I hope that I can work out some pricing in the next month or so and bounce it off you guys.

I need to work out how I am going to do this.... more thought is required. If anyone has suggestions - like: don't do this, do that...I want to see this.. I think your ideas suck because ..... please lay it on me. I have thick skin, so if you don't like my ideas, let me know. You might have a good reasons/ideas that I have overlooked!

At this point I am not going to give away the software. If I do that I won't have much incentive to try and support this development and some installations and like I said before, this is what I do for a living.. and I like to eat. :-)

After going through this development so far I can understand why an open source Autopilot has not been fully developed so far. There are a lot of parts and pieces involved. More than what I first thought. Plus it requires a lot of testing. I have about $2K tied up in development hardware/parts/etc some of which did not work and I don't have a finished "assembled" system yet.. Everything is assembled just well enough so I can make sure it works.

Dave

Dave911
11-02-2011, 09:34 PM
Frasco:

I was thinking the same thing when I started on this. The problem is that when you say Arduino .. you have lost most of the boaters out there as they have no idea what you are talking about and even less desire to buy one so they can load the free software. Let alone any desire to assemble and test it on their boat.

I figure if I do this right I should be able to give the parts to my Dad and tell him to read the directions and he should be able to put the unit together, tune it and operate it. It has to be that simple.

It took him about 2 minutes to figure out how the remote pendant works, so I figure that is a good start. :-)

X7JAY7X
11-02-2011, 10:43 PM
Meh, I'm going to build my own autopilot based on Arduino for next summer. And when I do it, I'll make the project open source.

Frasco, I was thinking about doing the same thing. The user could build a system with parts from Sparkfun. I am not interested in selling the firmware. The biggest problem I have with selling a complete system is liability. Frasco, maybe we could put our resources together?

It will still be based on the arduino programming enviroment, but I have my eye on the new 32bit arduino microcontrollers coming out soon. 32bit microcontrollers are more "commercial" grade and not "hobby" grade as the current 8bit arduino. The beauty of this is a low cost system based on a platform that has tons of user support. Even if I design my own board, solder all the components on it, and put it in a waterproof commercial grade enclosure, it would still be alot less than a PLC solution.

I was thinking the same thing when I started on this. The problem is that when you say Arduino .. you have lost most of the boaters out there as they have no idea what you are talking about and even less desire to buy one so they can load the free software. Let alone any desire to assemble and test it on their boat.


Disagree. I can make a Arduino solution that would be just as easy, or easier to work with than a PLC. I have found software that simply loads firmware to the micro without the need for the full blown IDE. This would allow the user to update the autopilot at any time. Dave, is your PLC programming software free? If not, how do you plan on handling software upgrades?

Dave911
11-02-2011, 11:21 PM
>>I can make a Arduino solution that would be just as easy, or easier to work with than a PLC.

Easy for who? Pretend your Mother is the user and you are trying to talk her through a problem with the autopilot.
Unless there are indicator lights on all of the I/O, I doubt it. Indicator lights are really nice for debugging things when the people doing the debugging don't have a DVM or don't know how to use one. (For instance - when you press the resume button on the pendant, does the light next to X3 come on?)

>>Dave, is your PLC programming software free? If not, how do you plan on handling software upgrades?

Excellent question.

The program loader is free, so having a user do an upgrade is simple if they know their way around a PC. But since I use my Dad as a baseline user, and there is no way he would be willing to do a program load himself, he would send the PLC to me (all of the I/O plugs in for easy swap out), I would reload it and send it back to him.

I have no doubt that an Arduino could do the control job, my point is that supplying a program for an Arduino that can do an autopilot function does not solve the "inexpensive autopilot" problem.

An autopilot has a bunch of parts besides the controller or control board itself.

frasco
11-02-2011, 11:38 PM
Dave, let me start by saying that I've been following your project here with keen interest and I've learned a lot by your efforts!

That said I fail to see the difference between buying an Arduino, actuator, sensors etc.. and building the autopilot following instructions compared to buying the parts to your autopilot and assembling it according to yours..? Not that it matters really, it's not like we're competitors. Your code might be very sophisticated and easily adaptable to different boats. My plan is to build something that works for me.

I'm mostly interested in the DIY part of it. The flexibility. If I want to add an IR remote I can just do it. Or a touch screen interface. Or if I want to add a wind direction sensor I buy one, plug it in and write some code. If I'd just want an autopilot I'd buy an ST1000 or something.

I'm also definitely interested in the challenge. I've been programming as a hobby since I was 15 but my experience with electronics is very limited. I just got my Arduino about a week ago and have only been playing around with LEDs and a pot so far due to lack of components. I'm currently waiting for a load of toys from China to arrive. My brother (a sound engineer) is interested in building a preamp based on the Arduino so that's probably the first bigger project and hopefully by springtime I'll have the chops to design an awesome autopilot. :)

As I said, my initial goal wasn't to make something easy for everyone to adapt, I was going to build it mainly for myself but leave the project open sourced. That said it's likely - especially if people like Jay here are interested in working together on it - that adaptability for different types of boats might be implemented (and/or at least considered) right from the start.

frasco
11-02-2011, 11:43 PM
Easy for who? Pretend your Mother is the user and you are trying to talk her through a problem with the autopilot.
Unless there are indicator lights on all of the I/O, I doubt it. Indicator lights are really nice for debugging things when the people doing the debugging don't have a DVM or don't know how to use one. (For instance - when you press the resume button on the pendant, does the light next to X3 come on?)


Hmm. As I said, we're not competitors. If you want to build and market an autopilot that can be built, operated and debugged by your mother then go ahead. :) My target audience is DIY-minded people who don't mind getting their hands dirty writing/changing some code and figuring out how stuff works.

X7JAY7X
11-02-2011, 11:51 PM
Dave, I am offering constructive criticism. Like Frasco said, we are not in competition. There are features your system will have over mine but I am just trying to point out the cost effectiveness and necessity.

Easy for who? Pretend your Mother is the user and you are trying to talk her through a problem with the autopilot.
Unless there are indicator lights on all of the I/O, I doubt it. Indicator lights are really nice for debugging things when the people doing the debugging don't have a DVM or don't know how to use one. (For instance - when you press the resume button on the pendant, does the light next to X3 come on?)


It is a nice feature to have but not necessary. I can have the built-in led flash based on faults or status. In addition, I could write diagnostic software to let the user see everything I/O wise (including analog) that the micro does. This would give ALOT more information that just I/O lights, albeit it would require a computer.

I have no doubt that an Arduino could do the control job, my point is that supplying a program for an Arduino that can do an autopilot function does not solve the "inexpensive autopilot" problem.

An autopilot has a bunch of parts besides the controller or control board itself.

So far I have about $150 in my electronics. Thats micro, compass, and motor driver. I have an enclosure but I am looking for an alternative. The firmware is just time. Since I am doing this as a hobby, my time is "free".

frasco
11-03-2011, 12:11 AM
So far I have about $150 in my electronics. Thats micro, compass, and motor driver. I have an enclosure but I am looking for an alternative. The firmware is just time. Since I am doing this as a hobby, my time is "free".

Alternative to using an enclosure? How about having the "pilot" separate from the "captain" instead of having to build a waterproof enclosure ie. you could rig the main electronics somewhere weather safe and have wires going to the tiller and use a rugged linear actuator.

What kind of motor were you planning on using? I've been looking at this linear actuator (http://www.ebay.com/itm/270685918551?ssPageName=STRK:MESINDXX:IT&_trksid=p3984.m1436.l2649#ht_1610wt_1037). The stroke should be enough as I'm probably connecting it to a trim tab instead of the tiller. Something more lightweight (and cheaper) might suffice (and be more energy-efficient) but haven't found anything awesome yet.

Dave911
11-03-2011, 12:53 AM
Wow guys... thanks for the rapid feedback!

Hi Frasco:

I don't think we are in competition. I don't even have a product done yet! :-) We are talking about two different things. When I say "sell a kit", I mean boxes that plug together. Most boat/sailboat users don't do "wiring". Seriously, we are "not normal". Normal "boat owners" are not into Arduino's, PLCs etc. Most of the boat owners at my marina don't even winterize their own boats. Maybe 50% of them repaint the bottoms.
>>>If you want to build and market an autopilot that can be built, operated and debugged by your mother then go ahead.
That is the current plan.. :) Subject to change of course. It should be Mother friendly. :-)
>>>My plan is to build something that works for me.
That is cool also...

Hi Jay:

>>Dave, I am offering constructive criticism.
And I appreciate that. :-) I sense I came across a little harsh - my apologies.

Lights on the I/O...
>>It is a nice feature to have but not necessary.
True. Good point.

Frasco:
>>How about having the "pilot" separate from the "captain" instead of having to build a waterproof enclosure ie.
That is the approach I am taking. And that is what the major autopilot manufacturers do. None of the Ray Marine autopilots are waterproof.

>>I've been looking at this linear actuator.
Good choice. That is the one I have been using. I think they are cheaper directly from their website. I bought a 12" stroke unit but I am only using at most 8" of stroke. So far the unit has worked fine even when splashed.

Dave

Dave911
11-03-2011, 12:56 AM
Jay,

What are you using for an electronic compass? I have $100 in the compass and that seems to be dirt cheap from what else I can find. There are a couple compass suppliers whose board level compass prices start at just above $500 each. Add an enclosure and you are above $600.

Dave

Joakim
11-03-2011, 01:53 AM
I don't think we are in competition. I don't even have a product done yet! :-) We are talking about two different things. When I say "sell a kit", I mean boxes that plug together. Most boat/sailboat users don't do "wiring". Seriously, we are "not normal". Normal "boat owners" are not into Arduino's, PLCs etc. Most of the boat owners at my marina don't even winterize their own boats. Maybe 50% of them repaint the bottoms.


Why would people like that buy your autopilot? They can buy ST1000 for $400. Probably your autopilot steers better and maybe it is even more reliable, but it will be more expensive, less integrated to very common Raymarine instruments, not as attractive looking and brandless. For $1000 they can get SPX5, which most likely outperforms your pilot. Can you even sell considerably under that price?

I have no doubts that you can make a very good pilot and I was seriously thinking about building my own as well when I had a ST1000 and was not at all happy with its performance. Now I have a Raymarine S1 system pilot (came with the boat) and see no need for changing anything.

But making it commercial is another thing! I don't think you can compete with mass production in China. You have to pay much more for each part, you can't afford to make taylor made displays and plastic parts and most importantly you don't have a brand.

frasco
11-03-2011, 11:00 AM
Good choice. That is the one I have been using. I think they are cheaper directly from their website. I bought a 12" stroke unit but I am only using at most 8" of stroke. So far the unit has worked fine even when splashed.

I'm sure it's good, the specs are better than the Raymarine tiller pilots as far as I can tell. I'm mainly concerned about power consumption.

Jay,

What are you using for an electronic compass? I have $100 in the compass and that seems to be dirt cheap from what else I can find. There are a couple compass suppliers whose board level compass prices start at just above $500 each. Add an enclosure and you are above $600.

How about cheap sensors like this one (http://www.ebay.com/itm/130545582172?ssPageName=STRK:MESINDXX:IT&_trksid=p3984.m1436.l2649#ht_3292wt_1139)? It might not work properly when the boat heels? I'm probably going to try different cheaper units when I start building prototypes so if you have time to wait until spring then I will surely have more information about them. :)

Why would people like that buy your autopilot? They can buy ST1000 for $400. Probably your autopilot steers better and maybe it is even more reliable, but it will be more expensive, less integrated to very common Raymarine instruments, not as attractive looking and brandless. For $1000 they can get SPX5, which most likely outperforms your pilot. Can you even sell considerably under that price?

Price is definitely a dealmaker or -breaker here I would say. As the Raymarine and Simrad tiller pilots start at 4-500€ here there would definitely be a market for a cheaper unit. And I have no idea about the complexity/sophistication of the code in those autopilots. If you can pack in a lot more features for the same price there might also be a market.

I have no doubts that you can make a very good pilot and I was seriously thinking about building my own as well when I had a ST1000 and was not at all happy with its performance. Now I have a Raymarine S1 system pilot (came with the boat) and see no need for changing anything.

Well that's one thing. If you would've had Dave's autopilot instead of the ST1000 you could've mailed him and described the issues you were having and a few days later have a personal software update in your email.

But making it commercial is another thing! I don't think you can compete with mass production in China. You have to pay much more for each part, you can't afford to make taylor made displays and plastic parts and most importantly you don't have a brand.

I've done some research into this and you can also send your schematics to China and have them "mass-produced" (100+ units) for much cheaper. For example a certain PCB I tried with cost $40 as a one-off but went under $10 a piece when ordering 100+ units.

Dave911
11-03-2011, 11:17 AM
Joakim:

>>Why would people like that buy your autopilot?

Good question:

Because it works, it is user serviceable, replacement parts are off the shelf, you can afford to buy a spare actuator and keep it on board. Most items are plug in replaceable and again cheap enough to keep a few spares in the box for longer trips. It is almost self-diagnostic, it has features way beyond a ST1000 which from what I have read usually does not work as you have verified. It has an integrated PC which makes it a chart plotter, AIS display unit, 12 volt battery monitor (built in). It has a power conditioner to allow the PC/PLC to run through engine cranks. It can be equipped with a 7" touch screen or your choice of screen. It can also play MP3s into cheap computer speakers or buy some weather proof speakers for a few bucks more.. If you added a DVD drive you could watch a movie in one window, while watching your Nav chart in another while monitoring battery condition in a 3rd. It has a LCD cockpit display which is water proof and visible in sunlight. The display doubles as a compass display as well with large numbers. All Autopilot functions can be controlled and monitored from the display. If something goes wrong the display alarms and shows the error by flashing the screen backlight. The system is extensible, meaning that users can add software to the PC. I can add features to the PLC. Users can request changes and they can be added with a new software load into the PLC. For instance, I want to do a lot of singlehand sailing this next year, so I am gong to add a keep alert function to the system - when turned on it will beep every 15 minutes and require a reset - just to make sure I don't fall asleep. That is a very simple change. The system I have now has a remote control pendant which is wired, and waterproof. Equipped with a joystick for manual course correction mode changes and starting autotack sequences. (I could make it wireless also.. but not sure it is worth it)

Beyond that, the system is extensible. What would you want to add, tie in, or integrate?? I'm looking for ideas?

These devices are not closed devices like RayMarine instruments. If I want to alter their behavior I can simply reprogram them.

The PLC and PC have a lot more capabilities than what I have described so far. The PLC is only utilizing about 25% of the memory space capacity so far..

I think that some people might want to be able to add a GSM-Cell phone modem to their units also so they can receive GRIB weather data and emails via the internet. Or you could stream music from Pandora. Or stay on top of the latest happening on Facebook and Twitter... but that won't be me doing that! Just an idea.

I need to find a reasonably priced weather proof PC screen. I might have to make that though, as everything out there is big bucks. :-( The market for weather proof PC screens must be very small.

Here is a SPX5 tiller for $1150
http://www.amazon.com/New-RAYMARINE-E12203-SPX5-TILLER-RAYE12203/dp/B004YQL4GK

How does this compare to what I have just described?

I suppose I could have this made in China, but the volume is not there. I doubt that Raymarine is making everything in China. Unless the volume is pretty high China does not work well for manufacturing. The way it is now, if a newer, better PC motherboard came out, it could be easily swapped without replacing the entire unit. Same with the PLC. If the user decides they want to run Windows instead of Linux on the built in computer so they can run different software or visa versa, that is also possible. If you break the pendant and want to replace it with something you find better. Just buy the parts or pendant and replace it. I can supply wiring diagrams.. The only thing I want to maintain control over at this point is the PLC program. I would recommend running some open source software on the PC part of the unit. OpenCPN works well and I think that SeaClear would work fine as well.

>>you can't afford to make taylor made displays and plastic parts and most importantly you don't have a brand.

I agree... everything is off the shelf.. if I wanted to buy 100 cockpit displays I could have them in a couple of days... They are very common.
The cockpit display is an industrial unit - waterproof - Nema 4x, as is the remote pendant and controls.

Brand... true. I do not have an Autopilot brand. But if I had a brand and I priced this thing low I might have a major problem making them fast enough. So perhaps that is ok for now. However all of the components that are used in this autopilot are off the shelf devices and they do have a brand and a reputation. So the hardware itself should not be an issue. the build quality should not be an issue, as I already have a reputation in the industrial world with an established industrial controls business. The software is still being worked out, but so far everything works.

If you look hard at the really high end Raymarine stuff they are starting to go with embedded PCs tied to PC displays with custom software. But that equipment is hyper expensive right now.

Certainly this autopilot will not be for everyone. Some people will not buy anything other than Raymarine or Garmin or Simrad equipment.

Thanks ...

Keep it coming.. :-) I need to think these things through carefully.

Dave

Dave911
11-03-2011, 11:55 AM
Frasco:

On my boat that I have been testing this autopilot on - a 29' Ericson Sailboat, with the autopilot tuned properly, the tiller moves just a couple of seconds every every few minutes. So say it moves 5 seconds in a two minute period. The actuator draws 3 amp at full load and 300 ma at no load, and say it averages 1.5 amps during the moves (partial load). 5 seconds/120 seconds =.041 duty cycle. .041 x 1.5 amps = .062 amps average current draw. A group 27 battery can typically deliver about 50 AH before being 50% discharged. So the actuator can run like this for 50/.062 = 806 hours before the battery is 50% discharged. So the actuator is no problem.

The rest of the controls are on all of the time though. With the PC portion of the controls running with the autopilot PLC and the small screen connected everything draws about 30 watts - that is about 2.5 amps at 12 volts.
50AH/2.5 = 20 hours of continuous operation. I have two group 27 batteries in my boat and I usually cannot go for more than 8 hours or so of sailing before I need to start the engine for some reason, which recharges the batteries so current draw does not seem to be a problem so far.
I'm adding a battery voltage monitor to the PC part of the system so it can monitor battery voltage and alarm when it goes too low just in case!

>>I'm probably going to try different cheaper (compass) units when I start building prototypes so if you have time to wait until spring then I will surely have more information about them. <<

I have looked at a few of those. I'd really like to find an off the shelf unit that does not cost an arm and a leg and that is already sealed up in a mounting enclosure and cables etc.. But I may need to buy a couple of those board units and try them out as they are cheap. The compass I have now has an NMEA data string output but I could easily adapt the software to a non-NMEA data string message. The compass I have now has to be more than 3 feet from the engine or else it gets really unstable due to the iron mass nearby. So chances are the compass will have to be a separate box in most systems. I'm also a little concerned about some of those boards availability in the future. Even some of the specialized Arduino boards seem to come and go pretty quickly. Introduced in 2010 and obsoleted in 2011 etc. I guess if they don't get the sales volume they sometimes drop them as a product. Accuracy during pitch and yaw is also a concern and those specs are oftentimes not very clear.

frasco
11-03-2011, 12:43 PM
Good discussion going on here!

About the PC drawing 2.5 amps; it's def. a no-no for me. I rarely use the engine, I often sail to the pier and to/from anchorage so I mostly use the engine for leaving the harbor. This means I'll have to power the autopilot mainly by solar power, which I don't have at the moment. And I don't feel like buying large expensive panels just to power the pilot so I'm looking to construct an energy-efficient solution. 0.6A for the actuator sounds reasonable but I'm wondering how/why you only need to adjust the tiller once every two minutes or so, that's mainly while motoring or sailing in light weather and/or in favorable conditions where the boat practically steers itself, right? I've been using a tiller lock similar to the one pictured here (http://i.imgur.com/EwN06.jpg) for self-steering which works very well when close hauled by trimming the sails (easing on the main) but not so good (or at all) when reaching.

As for the compass, if you have a flexible code base you can easily patch the software to use a different unit (if the old one goes out of stock) so I don't see that as a huge issue. Also, isn't it possible to paint the circuit board with epoxy or something to water proof it?

Joakim
11-03-2011, 12:49 PM
Dave:

All the things you list are wonderful features, but mostly for geeks only. I don't think "average" boat owners would like to have such a complicated autopilots. They buy just Raymarine or Simrad even though yours may steer better and have tons of more features.

Industrial brand doesn't help much, since boat owners don't know them. They do know Raymarine.

I wouldn't like to have a PC in my boat and 30 W power consumption is huge for a sailboat. Your boat seems to be very easy to steer. Most modern boats need much more active steering.

Dave911
11-03-2011, 01:45 PM
Joakim:

>>Industrial brand doesn't help much, since boat owners don't know them. They do know Raymarine.

Following your logic everyone but Raymarine and Simrad should just hang it up and quit! ;-) Fortunately, that isn't how marketing works fortunately.

I don't think that Simrad or Raymarine is in danger of losing their customer base to me anytime soon. :-) But I think I have something that has a unique appeal.. I might be wrong.. but I only need to be partially right to be successful.

An aside:
A couple of years ago Raymarine did not exist... It was Raytheon. I bought a Raytheon fish finder before they got rid of their marine division and the unit broke just after the warranty period ended. Raymarine would have nothing to do with it. Basically they said throw it in the trash. No repair, no service, no options. As a result I don't buy Raymarine equipment. So I know Raymarine also... and I don't buy from them as a result of our past dealings.

>>Your boat seems to be very easy to steer. Most modern boats need much more active steering.

On the contrary: Actually it is very difficult to steer, especially when motoring in rougher weather. The prop wash across the rudder greatly amplifies the rudder while motoring (Lake Erie - 3.5 foot waves was the recent test with 25-30 mph wind off the port bow - these conditions were not planned! )

Steering while sailing is simple in comparison on my boat even in rougher weather. The sails tend to stabilize my boat.

I just didn't realize it when I started all of this. My original autopilot setup used a linear output routine to drive the tiller. As a result the autopilot could not steer the boat. If things were really nice, not much wind or waves it was stable - a large wave would throw it off and it would go unstable. After some serious head scratching - I applied a scaled root function to the PID output and the thing motors now like it is on rails. I also applied some fancy filtering to the error so the pilot doesn't over react. Even in the nasty weather we had the other day while motoring, the rudder only corrected about once per 30 sec to once per minute. Like I said before, the autopilot makes operating the boat a *lot* easier.

>>30 W power consumption is huge for a sailboat.
Well... my navigation lights draw about 30 watts...


Frasco:
>>that's mainly while motoring or sailing in light weather and/or in favorable conditions where the boat practically steers itself, right?

Read above... it does correct more than once every 2 minutes in rougher weather, but the truth is that the autopilot steers a lot better than I do. There is no way I could do as well it was doing into those 3.5 footers the other day. One reason is that it holds the rudder from a solid base. When the boat is being pitched and yawed due to the waves and wind, the rudder does not move, whereas if I were holding the rudder it would definitely be moving since I was moving as the boat was being pitched and yawed. The other thing is that the error filtering I have in place takes out the repetitive yawing errors so the tiller is not trying to correct for each repetitive yaw rotation.

The PC is the big power user. Without the PC running the PLC and cockpit screen consume about 5 watts.

Hmm.. that makes me think... Perhaps the PC can go to sleep, wake up ever 5 minutes or so, update things and then go back to sleep. That would save a lot of power. That could lower average power consumption tremendously.

Tim B
11-03-2011, 03:51 PM
Dave,

Congratulations, you have automated and obsoleted yourself in a single shot! Seriously, though...

There is certainly scope for using a PC for initial course-plotting, but once done you'd really like to download all the waypoints and let the autopilot sail you there. This to me sounds like a job for an SBC and a low-power PC. The low-power PC can be whatever you want. For SBCs, I'm sure I have mentioned Technologic Systems (who I don't work for) before.

I have a TS7550 board and it's a lovely bit of kit, even if you'd need to build an interface board to plug things in. It has more than enough capability for this task, and it is cheap too! Since I bought it, TS now have various macrocontrollers with multi-core ARM CPUs, which should give loads of capability at low power. eg. http://www.embeddedarm.com/products/board-detail.php?product=TS-4800

For a simple display, there are alpha-numeric and graphical LCD displays available, as well as OLED displays. Also, don't forget the usefulness of WiFi and a web-server, for those with smart-phones to connect and view progress or settings/tuning.

Interesting stuff, indeed.

Tim B.

Joakim
11-03-2011, 04:40 PM
Joakim:

>>Industrial brand doesn't help much, since boat owners don't know them. They do know Raymarine.

Following your logic everyone but Raymarine and Simrad should just hang it up and quit! ;-) Fortunately, that isn't how marketing works fortunately.

I don't think that Simrad or Raymarine is in danger of losing their customer base to me anytime soon. :-) But I think I have something that has a unique appeal.. I might be wrong.. but I only need to be partially right to be successful.


No, I'm not saying there is room for only Raymarine and Simrad. And there are also B&G, NKE, NEXUS/Comnav, Garmin, Navman etc. Also there seems to be a market for brandless or new brand chartplotters and VHF etc., but those are cheap and these bradless ones are clearly cheaper than branded ones. Chartplotters and DSC VHF units used to be very expensive just a few years ago, like gyro autopilots. Now even that $1000 SPX5 has a gyro.

Your system sounds expensive to you. If you are not going to sell it for charity, it will be more expensive than any other tiller pilot. Are people willing to pay extra for those features? The more expensive ones like NKE sells only to serious single hand racers etc. You don't see them in average boats at all.

I make special marine transducers. It started as a hobby, but I have sold 40 of them. The difference to your project is that there was a clear need for these (no mass production units could do the job due to high accuracy demand, only very expensive ones were available) and I sell to professionals only for clearly cheaper price than the "competitors". I have thought about going to consumer markets as well, but I don't think I would have a chance against bigger players. E.g. you can buy a Raymarine Fluxgate compass for less than $100, I couldn't make it to that price and no one would pay much more for mine even, if it was more accurate or reliable.

I really think 30 W consumption is a problem. At least around here navigation lights are very seldom used (only few hours dark in sailing season) and LED lights are becoming popular. Why would an autopilot need a PC in the first place?

Tim B
11-03-2011, 05:52 PM
I think it's interesting to note that the one part you here about breaking more than any other is the autopilot. I can't believe that it's actually that hard to find actuators that are the right size for the rudder, which seems to be problem No. 1, and stopping water getting into the electronics, which seems to be problem No. 2.... However ,solving these problems costs money and means you can't charge for a new unit; consequently, there is no incentive for manufacturers to get this right.

Joakim, what sort of transducers have you produced?

I'm not sure that 30W consumption is a real figure. The base load of the autopilot is of interest, but leave the PC to the end-user.

For compasses, how about going triple-axis? http://www.sparkfun.com/products/10619 and http://www.sparkfun.com/products/10530 being good starting points?

Tim B.

frasco
11-03-2011, 07:22 PM
Trim Slice (http://trimslice.com) would also be a good alternative for a PC-based system. And why not for a general boating computer assuming you can find an energy-efficient monitor.

Specs (http://www.trimslice.com/images/Trim-Slice-brochure-low-res.jpg)

Dave911
11-03-2011, 08:08 PM
Tim B.: >>Congratulations, you have automated and obsoleted yourself in a single shot! Seriously, though...

Yes, it was a rather strange sensation when I realized that it was steering a lot better than I could have... I felt a bit like a passenger..

There are a number of ways to implement an autopilot, that is certainly clear to me now.

>>usefulness of WiFi and a web-server

I thought of that.. the idea of using a tablet connected to a PC via Wifi for a screen is also interesting. But I have heard of some serious heat problems in tablets when exposed to the sun, which is probably a transitional thing that they will work out. A lot of this is all very new.

My reasons for including a PC along with the Autopilot is that I really need an onboard chartplotter. Once you get into chartplotter land then you have to have an AIS equipped chartplotter. OpenCPN has that capability already. I believe that SeaClear also has that capability.

Do they have AIS in the UK waters? That is known as "poor mans" radar here. All of the commercial ships over a certain tonnage, which is pretty low, must have an AIS transponder. The transponder broadcasts the ships coordinates, speed and heading. An AIS charter like SeaClear or OpenCPN can receive those signals and plot them on a map showing projected courses, possible collisions and even signal an alarm if a collision is possible. It is rather amazing. As Jay knows there is a lot of freighter traffic in Lake Erie and for that matter the Great Lakes. And they can move very quickly. So the PC should be very useful once I get an AIS receiver which will happen this spring as there are some new Standard Horizon radios that have built in AIS receivers. Of course the Chartplotter software can also create waypoints and I already have the waypoint outputs tied into the Autopilot controller using OpenCPN. So as my system stands now, I can chart a series of waypoints across Lake Erie for a couple of hundred miles, tell it to go and the autopilot will steer the boat along the route created by the waypoints.

I really need more than just an autopilot for my boat and that is why I included a PC in my design in the first place.

So I think I will keep the PC in the mix for now and see how this all packages into a box and go from there.

>>I'm not sure that 30W consumption is a real figure

I'll attach a good digital ammeter to it and let you know what I find. I got the 30W figure as the amount of AC power being fed to a power supply that was powering everything (PC included), so it might be less than that.

I should know a more exact figure also..

Dave

X7JAY7X
11-03-2011, 08:27 PM
I have a commercial Octopus drive that is a cable steering box. It has a motor and clutch in it to engage/disengage the motor. I got a good deal (well good deal compared to new) on it so I bought it. That is the most expensive part of my autopilot project but at least I know that it will be reliable.

The compass MUST be tilt compensated. All of the links that were posted here did not have tilt compensation. I did alot of searching and came across one that does tilt compensation for $35. It has a 16bit micro on board that does the tilt compensation calculations. Most that I found cost ALOT to get this feature. I can post pictures of mine soon.

Dave, don't get me wrong, I think your doing a great job and we are all learning from you but I think your system is way too costly for the average person. This is one reason I went with an arduino and also the ease of programming it. I can't even imagine programming in ladder, I mean I can because I work with PLC's as well but sometimes C is just alot easier. Like Frasco said before, we are making a system for us with the features that we want. That is exactly what you did, you loaded it with features but to sell these alot of people don't want or need all that functionality. Have you thought of a "poor mans" version? I am still very concerned about waterproofing. Throwing parts in a water resistant box is not waterproofing.

I have a powerboat so 30w is no big deal to me but if I had a sailboat I wouldnt want that power draw.

X7JAY7X
11-03-2011, 08:39 PM
My compass. The enclosure could be alot smaller but it was something I had laying around. The enclosure and the connector are waterproof.

http://x7jay7x.webs.com/PICS/compass/IMAG0427.jpg
http://x7jay7x.webs.com/PICS/compass/IMAG0429.jpg
http://x7jay7x.webs.com/PICS/compass/IMAG0430.jpg
http://x7jay7x.webs.com/PICS/compass/IMAG0431.jpg
http://x7jay7x.webs.com/PICS/compass/IMAG0432.jpg

Dave911
11-03-2011, 09:55 PM
I like your compass. Does it meet your expectations?

Yes, tilt compensation is a requirement and apparently it is not easy to do electronically as a lot of the marine electronic compasses still have a liquid float system that levels itself to compensate for roll and pitch. If that could all be done on a chip you'd think they would drop the mechanical compensation immediately, but perhaps not.

>>I think your system is way too costly for the average person.

You may be right. But I haven't figured the cost yet!

Don't get to hung up on the CPU cost by itself. There are a lot of parts and pieces besides the CPU. If you spend too much time trying to make everything really inexpensive you might end up with a lot of really inexpensive things that don't work well and are hard to program and debug. Your time, and even more so, your on the water testing time is valuable.

I have to balance how much time I spend on development with how difficult it is to work with the equipment. (This is a common dilemma I get to deal with ) More than a few times I have made changes to the PLC program while onboard the boat. Making changes are quick and fairly painless. If the PLC cost is an issue, I can rewrite the program into another platform. Doing this in ladder was pretty easy as the PLC does floating point calculations very nicely. The hard part of this has not been the programming, but trying to figure out "what" to program. I don't have any issues writing code in C or C++, but this PLC only supports ladder.

>>Have you thought of a "poor mans" version?
Yes, but I really need to make a unit that I can use first (like you and Frasco) and then see where it goes. This would be easy to break apart - the PC from the PLC. For me though, having it all in one box has a lot of benefits on my boat as I mentioned.

>>I am still very concerned about waterproofing. Throwing parts in a water resistant box is not waterproofing.

Unless you have water sloshing into your cockpit you really should not have big problems dealing with water infiltration.

If you use a plastic box that is gasketed - Menards has some 8" Carlon type boxes for about $20, and you mount your box vertically, then run all of our cables into the bottom side of the box, it will be very hard for water to migrate into your box. If you want to really seal it up, use cable glands with gaskets. If you do that then you are basically meeting Nema 4X which is "washdown proof with a high pressure hose".

Dave

Joakim
11-04-2011, 03:54 AM
Joakim, what sort of transducers have you produced?


It's an inclinometer with 0.001 degree resolution and 0.01 degree accuracy used for replacing a pendulum or water scale in stability measurements.

Joakim
11-04-2011, 04:14 AM
AIS is used in Europe as well and you can buy a 300 €/$ chartplotter that shows AIS targets, if you have an AIS receiver, which you can buy for 100-200 €/$ or it may be included in a 300 €/$ VHF.

I think that Seaclear/Open CPN is really just for geeks (I have both, but don't use them while boat is moving).

At least NEXUS has a compass transducer called HPC which doesn't have a float system. It uses a three axis fluxgate and shows heel and pitch as well.

What does a PLC-system cost? I have no experience of PLC. I'm certain a AVR 8 bit microprocessor (e.g. Arduino) would be enough for an autopilot controller and many other jobs. I think there are model airplane and helicopter autopilots made using Arduino platform. They can easily be programmed in C while testing as well. They have to do floating point in software, but that is fast enough anyway. One option might also be an ARM-based Linux computer like NSLU2. I had one in my previous boat, it only took 3 W. Unfortunately NSLU2 is no longer made, but it used to cost about 80 $/€ and it had USB and ethernet. You can also use WLAN-boxes with Linux.

Dave911
11-04-2011, 10:14 AM
>>you can buy a 300 €/$ chartplotter that shows AIS targets

With maps? Where? Send me a link please! Things must be cheaper in Finland.

>>I think that Seaclear/Open CPN is really just for geeks
I think that if you had a waterproof/water-resistant platform to run this software on it would be the standard. The problem is that laptops suck in the cockpit. There is no PC hardware that is cockpit friendly that I know of that does not cost a fortune.

>>What does a PLC-system cost? I have no experience of PLC.
Saying "PLC" is like saying "Computer" - they come in all sizes, shapes and costs. If you do a google search you will find "PLC" that cost as little as about $50 up to Modular units with distributed I/O that costs many thousands of $.

This PLC I am using is basically a packaged microcontroller. It draws less than 4 watts. The cockpit screen draws less than 2 watts. There are slightly cheaper "PLCs" that do the same thing, but they tend to have less mechanical features and the development software gets more expensive and they are made for high volume users. At that point the line gets very blurry between a PLC and a microcontroller. Some "PLCs" are also programmable in C and other languages.

This unit has removable screw terminals, a plastic housing, din rail mount, indicator lights on all of the I/O etc typical of a traditional PLC.

bertho
11-04-2011, 11:47 PM
guys,
I use a chartplotter from seiwa, the "explorer3, is no display, you need to add a standard display LCD LED, 1.5 amp, you can fit a 21 inch display if you like !, work with cmap, cost around 500usd...very happy with this stuff !! work with ais, radar, deep sounder etc...
http://www.seiwadirect.com/Catalogue.aspx?q=IYaakhkndgTHz0e8%7c%7csl%7c%7cxSXYA%3d%3d
all the best
bertho
www.fusionschooner.blogspot.com

Joakim
11-05-2011, 07:04 AM
Here is the chartplotter that came with my boat (350 €): http://www.svb24.com/index.php?sid=8cc50672d838a2b190701a2c0c0710c7&cl=details&cnid=10906&anid=116646&tpl=&listtype=list
It has reasonable AIS features, not as good as OpenCPN, but good enough for normal usage.

I don't think it is the cheapest one.

Maps for Germany, Denmark and the whole Baltic Sea for it are 220 €: http://www.svb24.com/index.php?sid=8cc50672d838a2b190701a2c0c0710c7&cl=details&cnid=13456&anid=117658

For me this map covers about 1000 M from home to all directions, thus I probably will never need other regions.

A much cheaper option is to use IPhone, IPAD or some Android platform, since for those you can buy these (same!) maps and navigational software for 10-20 €.

I don't think there are any legal and cheap maps for SeaClear or OpenCPN for this region. You can find some illegal free maps for both, but I don't think you can sell devices counting on illegal maps.

Can you buy and use legal maps easily with SeaClear or OpenCPN? Until this is made as easy as for chartplotters (just insert a map card) I think these are only for geeks. And as you said there are no cheap and easy to use marine PC available.

For AVR (Arduino) microcontrollers the programming platfrom for C is free. There is also a free platform for ARM Linux.

Dave911
11-07-2011, 01:29 AM
>>Here is the chartplotter that came with my boat (350 €): http://www.svb24.com/index.php?sid=8...&listtype=list
It has reasonable AIS features, not as good as OpenCPN, but good enough for normal usage.
Maps for Germany, Denmark and the whole Baltic Sea for it are 220 €:<<

Adding those two numbers together and multiplying by 1.6 dollars per euro (about) is about $900.00. Not cheap by my standards.

>>I don't think there are any legal and cheap maps for SeaClear or OpenCPN for this region. <<<

I never thought about that...

>>Can you buy and use legal maps easily with SeaClear or OpenCPN?

Yes, they are free for all of the coastal areas of the US and most of the major waterways inside the USA. The government maintains the download website and they are easy to load into OpenCPN and I think they are easy to get into SeaClear also. That is one of the big attractions to OpenCPN and SeaClear for me. Free, frequently updated charts for life!

I found a similar Standard Horizon 190i for $557 which has all of the coastal and inland waterway maps for the USA preloaded. Not too bad! And it also shows AIS targets! Nice... And it has a sunlight readable color screen.

>>IPhone, IPAD or some Android platform, since for those you can buy these (same!) maps and navigational software for 10-20 €.

Cheaper .. true but then if you want to link your Navigation system to the autopilot to load waypoints, that becomes an issue .. The other thing is water resistance... I get quite a bit of water spray in my cockpit during rougher weather so everything has to be at least drip proof in the cockpit. I think I would trash an Ipad or Android based tablet in short order. I have a water resistant cell phone for the same reason.

I did more autopilot testing today. I had the mainsail up only - which is the worse case for my sailboat as it tends to push the back end of the boat around due to the missing headsail. The tiller becomes very unbalanced with only the mainsail. (Manually handling the tiller with just the mainsail is a workout!) We had steady 15 knot winds with gusts beyond 25 knots at times... The Autopilot worked fine. At certain times it was working pretty hard to maintain control of the boat.. but that was due to the unbalanced sail situation. With only the mainsail up, the boat was reaching hull speed, which is about 6.2 mph. I tested the autotack feature and it worked very well since I added in counter steering at the end of a big course correction to brake the boats rotation as it gets near the new target heading.

The boat has to come out of the water on Thursday though so testing is done for this year. But there is not much I would change. I am going to add a few more controls to the screen so I can tweak the autotack. I can see that it would also be nice to have an adjustable rotation rate limit just for autotacking. I also need to make the autotack angle adjustable. But those are pretty minor changes.

I am surprised how fast I have adapted to having an autopilot. When we were dropping the mainsail we just started the engine and set the autopilot to drive the boat directly into the wind and I climbed up to the mast to pull the sail down - I never really gave a lot of thought to it. Previously, that used to be a two man job. Not this time. :-)

Singlehanding the boat is suddenly a lot easier.

After thinking about all of the comments .. I think I will package this autopilot as a stand alone device, yet maintain the ability to connect to a navigation device like the Standard Horizon 190i, Seaclear, or OpenCPN. If I could find a waterproof - sunlight readable small LCD PC display that was reasonably priced, I would package it all together and use the PC display as a cockpit screen, but I just can't find one yet. Perhaps someone will come up with something reasonable in a few years..

Dave

Joakim
11-07-2011, 03:38 AM
Most marine electronics seem to have about the same price in $ and €. The prices I linked to include EU TAX (20-25% depending on country, you can buy tax free to US) and the exchange rate is about 1.4. Why would you multiply with 1.6?

Do you know which graphical LCD displays (black and white) are visible in sunlight? I'm looking for one for my AVR project. What type of displays do marine instruments use? E.g. Raymarine ST60 graphical display is not very good in visibility compared to segment ST60 display. It has worse contrast and angle of view.

Do you have a gyro in your pilot? If not, you should add one. You can buy a good enough gyro sensor for 30$, thus it will not add the cost much and then you will have something more than any sub 1000$ pilot on the market. I think it would be much easier to limit the turn rate and slow down the rate before reaching the new heading using one. Also it will be necessary in bigger waves etc. See this: http://www.cruisersforum.com/forums/f13/raymarine-gyro-sensor-upgrade-for-25-a-53175.html

Dave911
11-07-2011, 12:33 PM
>>and the exchange rate is about 1.4. Why would you multiply with 1.6?

Hmmm... I have no idea where I got that number now! My mistake.


>>Do you know which graphical LCD displays (black and white) are visible in sunlight?

I think you almost have to look at them to figure out which ones work best. But the White LED backlit Monochrome LCDs "seem" to work well. I think the brighter the backlight, the more readable it will be in sunlight. If you look at a lot of the sunlight readable color displays - they seem to take two different approaches - 1. Use a transflective display which is inherently readable in sunlight but expensive. Or 2. Use a conventional color LCD screen and raise the backlighting to extremely high levels to improve the contrast in sunlight.

Then they also do things to reduce the reflection problems but that probably applies to both screen technologies.

Anyway, I would look for a monochrome LCD screen with white LED backlights.

Gyro/Yaw velocity feedback - I think that is a good idea. I have read a lot of things and gone over most of the autopilot manufacturers websites regarding their technology. Some of the current manufacturers are using technology which is really old. Of course those pilots don't have anything like gyro technology built in.

Rate gyros seem to be much more applicable for faster power boat applications where the rate of turn can be a lot faster than a sailboat. Many of the commercial autopilots don't have rate gyros simply because the boats can't turn that fast. But I think you have a good suggestion since I would like to make this autopilot more generic and flexible. I think that adding the ability to close the loop on the rate of turn would be very useful. Even on a slower moving boat it could make the steering more accurate. I found this tutorial on the Sparkfun website which is pretty extensive. http://www.sparkfun.com/tutorials/167

One of the possible problems I see with those sensors, is that alone, they are not tilt compensated. So if the boat goes over a large wave and pitches down, rolls, and also yaws, then the rate sensor will be inaccurate in the vertical yaw direction since the boat will also be pitched forward and partially rolled to the side a bit. One possible way around that is to get a fast 3 axis tilt compensated compass and derive rotational velocity from the change in compass heading per time. The compass I have can run at 10 hz, so I could derive a yaw rotation velocity every 100 ms which would probably be plenty fast. I'm looking at some other possible compass solutions which can run even faster than 10 hz. It would be nice to be able to determine yaw rotation velocity without adding another device.

Joakim
11-07-2011, 01:14 PM
I have a monochrome transflective display (FSTN) and it was not expencive (15 € for 64x128 70x40 mm view area). It has a backlight too. I haven't tested it yet in sunlight. What is a conventional type? Transmissive?

What kind of compass transducer are you using? Is it a floating one like most marine compasses? Do you really get such noisefree and fast signal that you could derivate yaw rate from it?

I think rate gyro is important to sailing boats as well or even more important than to motor boats. You need guick responses to waves and gusts in many boats and without a rate gyro you don't know what is happening until your heading has already changed considerably.

Dave911
11-07-2011, 02:14 PM
I think the one I have is simply a monochrome STN display with LED backlighting.

http://en.wikipedia.org/wiki/Super-twisted_nematic_display

Quote for the link above:
>>New CSTN displays offer 100ms response times (for comparison TFT displays offer 8ms or less), a 140 degree viewing angle and high-quality color rivaling TFT displays - all at about half the cost. <<

I wonder if I can find a CSTN display with LED backlighting to use as a PC display?? Hmmmm.. I'll have to look.

Compass - I am using a fluxgate compass that is floating for tilt compensation.. I think it is a military surplus unit. New it goes for something close to $1000. KVH still makes them. I think the compass was dumbed down to spit out data at 1 hz. It can be set for 10 hz easily. It seems to have zero noise. So deriving a rotation velocity should be easy with this compass. But for near $1000 it should be pretty nice. :-) Unfortunately the compass is way too expensive. But some of these new 3 axis solid state compass boards can spit out headings a lot faster than 10 hz... So as long as they aren't noisy I should be able to get the velocity out of them also.

Joakim
11-08-2011, 11:04 AM
Here is an interesting and cheap compass + heel/pitch sensor: http://robot-electronics.co.uk/acatalog/Compass.html

Dave911
11-08-2011, 01:21 PM
Yes, I saw that one. I think that may be the one that Jay is using.

I think I will order one of those and see how it performs.. Hook it up and drive around with it in the car... etc. See how much nearby iron affects it etc. It will be interesting to see how fast the device can be polled for data.

I found an oem that makes compasses for a few autopilot manufactures and they are just a little over $100 if ordered in quantities of 100. http://www.autonnic.com/enclosed-compass.html If you buy them from the retail sellers they are about $325-400 each. A bit of a markup!

I sent them an inquiry to see if I could buy them in lesser quantities.

Dave

X7JAY7X
11-08-2011, 09:46 PM
Joakim, that is the compass I am using. The little bit I used it it seems to work great. I am polling it pretty fast but I noticed if I poll it too fast it stops responding and requires the power to be cycled for it to start working again... at least this was my experience. Dave, let me know the results of your testing. I dont have any other compass to compare it to so I would like to know how it compares to your other compass. BTW, your probably going to need a TTL <-> RS232 converter for the serial.

Dave911
11-09-2011, 07:11 PM
Here is a video of sailing on Lake Erie on Sunday with the autopilot steering the course...

http://www.youtube.com/watch?v=GuVcg3vkVn8

We were out for a few hours and the autopilot did all of the steering except for leaving and returning to port.

It was really nice sailing weather. Low 60's and full sun. We only saw 3 other boats in about 3 hours. I had a hard time getting the angle right so the camera did not pickup glare off the cockpit display. It is a lot more readable than it shows in the video. My Dad, who was in the boat, could read it from the back of the cockpit where he was sitting.

Time to put everything into a proper box and clean up the wiring. The tape over the cockpit display was there since I didn't have the display screwed in place and I didn't want water spray to run into the unit.

Dave

Tim B
11-10-2011, 08:34 AM
Looks good. Congratulations on getting it so far.

Tim B.

Dave911
11-12-2011, 10:36 AM
Thanks.

I'm happy with the progress so far.

Once I get everything mounted into a box I will take a picture of it and put it on my website.

I ordered and received the compass board that Jay was using. Wow is that small! The board cannot cover up a Quarter dollar coin. I may try and get it talking this weekend so I can take it for a ride in my car and check it out.

The boat is in the cradle, so further water testing may have to wait until spring. April is 20 weeks away. It is going to be a long winter.

I'm already plotting out a long sailing trip for this next summer.

Having an autopilot has changed my perspective. :-)

Jay:
>>your probably going to need a TTL <-> RS232 converter for the serial.
I think the serial ports on this PLC are all 5 volts, so I should be ok. But I need to check that so I don't blow the board.
Thanks for mentioning that!


Dave

X7JAY7X
11-12-2011, 07:03 PM
I think the serial ports on this PLC are all 5 volts, so I should be ok

I have never seen that. So these are serial ports that cannot be used for programming or communicating with other RS232 devices? Strange.

Tim B
11-12-2011, 07:34 PM
Nothing unusual in that. The three common specs are 3.3v, 5v and RS232 (+-12v?) just use a max232 to convert signal levels.

Tim B.

X7JAY7X
11-12-2011, 11:12 PM
Nothing unusual in that. The three common specs are 3.3v, 5v and RS232 (+-12v?) just use a max232 to convert signal levels.

Tim, I was referring to a PLC. RS232 is defined as the logical states being -3 to -25 and +3 to +25.


You do not need a MAX232 either. It can be done with transistors. Check out RS232 shifters. Common RS232 is +12/-12 but some laptops I heard are +5/-5.

Dave911
11-13-2011, 12:17 AM
http://en.wikipedia.org/wiki/RS-232

Look down the page at voltage levels.

RS232 has gone the way of many standards - it is like the original, but not quite the same.

I've plugged into many 5 volt RS232 ports with my laptop (via a USB to RS232 converter which also probably only does +/- 5v). The original compass I have only puts out 5 volts on the RS232 port also. Actually I think that NMEA 0183 specifies a 5 volt RS232 connection.

I usually don't pay much attention to port voltages on RS232 unless something does not work.

Still I want to make sure I don't pop the compass.. I just need to check carefully so I don't blow it. Better to be safe...

Dave

X7JAY7X
11-13-2011, 09:26 AM
I've plugged into many 5 volt RS232 ports with my laptop (via a USB to RS232 converter which also probably only does +/- 5v). The original compass I have only puts out 5 volts on the RS232 port also. Actually I think that NMEA 0183 specifies a 5 volt RS232 connection.

I think you guys are misunderstanding what I am saying. TTL is NOT RS232. Even if RS232 is +/-5v, TTL is 0-5v. Dave, you will need some sort of converter. You can talk 5v RS232 to 13v RS232 and vice versa. That doesn't matter. Check out http://www.sparkfun.com/tutorials/215

I usually don't pay much attention to port voltages on RS232 unless something does not work.

That is fine as long as all the devices are RS232.

frasco
11-13-2011, 10:14 AM
Dave, some basic questions here.. what are you using to switch polarity on the actuator? Would this relay do the trick? http://www.ebay.com/itm/TAKAMISAWA-RY5W-K-5V-DPDT-Signal-Relay-/300620050816?pt=LH_DefaultDomain_0&hash=item45fe59f180#ht_1309wt_1270 And if so, should I (over)size the relay to match the actuator's max current draw? I'm planning on powering the actuator from the 12v batteries.

I also looked at H-bridges, first the L293D (http://www.ebay.com/itm/IC-ST-DIP-16-L293-L293D-/260845200092?pt=LH_DefaultDomain_0&hash=item3cbb95e2dc#ht_1935wt_1037) but again it's only rated up to 1A, would it work or would this LMD18200T (http://www.ebay.com/itm/1PCS-NSC-LMD18200T-3A-55V-H-Bridge-/320758448625?pt=LH_DefaultDomain_0&hash=item4aaeb181f1#ht_2159wt_905) (3A) be better?

Dave911
11-13-2011, 12:24 PM
Jay,

Thanks for pointing this out.
http://www.robot-electronics.co.uk/htm/cmps10ser.htm

I missed that this is a TTL level serial link. Yep, I need a level shifter chip in there. I really didn't want to have to do that. But I do have some level shifter chips here that I use to adapt TTL level encoders to RS422 levels. If I use one leg of the RS422 end and ground the other, I might be able to get this board talking so I can test it. Chips are cheap, but this compass is getting more complicated.

But I already have it, so I might as well wire it up and see how it works.

Dave

Dave911
11-13-2011, 12:35 PM
Frasco:

I think the actuator I have is rated at 3 amps at 12 volts at full load. I would look for some heavier relays that what you quoted. 6 amp contacts would not be too heavy. An H bridge would work, but that will not be easily serviced if the actuator motor fails and blows out the H bridge.

Dave

X7JAY7X
11-13-2011, 11:31 PM
Frasco, I would go with an H-Bridge. Some have overcurrent and overtemp protection so the chance of blowing them is slim. The relay is a cheap option but I would go solid-state over a mechanical relay. There are tons out there, but to start check out what Pololu has.

zorbas
11-24-2011, 08:44 AM
Hello,

I have been planing to build my own autopilot for a while now. Mostly because I think it would be fun. I have everything more or less sorted except for the drive system. Since it will be operating directly on the quadrant below deck I need to find a linear actuator that has a clutch. But I simply can't find one.. any ideas?

X7JAY7X
11-24-2011, 09:06 AM
zorbas. I looked for a long time and could not find one. I had a few ideas on how to make my own clutch to use with a linear actuator but I ended up going with a steering box instead with integrated clutch. You may want to look at a hydraulic solution. Some sort of a bypass on the hydraulic cylinder may be your best bet.

Fanie
11-24-2011, 09:14 AM
Hello,

I have been planing to build my own autopilot for a while now. Mostly because I think it would be fun. I have everything more or less sorted except for the drive system. Since it will be operating directly on the quadrant below deck I need to find a linear actuator that has a clutch. But I simply can't find one.. any ideas?

Wiper motor with a rack & pinnion like the gates use. I think a push pull cable to your steered component would be best.

The position encoder can be a bunch of resistors in series with reed switches between each resistor. So as the magnet slides back and forth over the switches the on switces will output a voltage proportional to the position. You can add as many as you want, and waterproof the encoder by potting it. I made some and it works great, if you use 101 resistors and 100 reeds you have a 1% encoder...

Fanie
11-24-2011, 09:30 AM
So if you have a wind vein with a pot in it and the position encoder as above you can use a comparator to control the motor left or right. To drive the motor you need a H-bridge - attached.

I use a micro to do the controlling with but an analog circuit will do as well. You have to provide 'dead time' between swirching motor direction or the FET's will short circuit the supply - which isn't fun ! Easy to do with a micro but as I said can be done with analog also.

Fanie
11-24-2011, 09:45 AM
This is what the encoder looks like. I had PCB's made and use SMD resistors to increase resolution. The long position encoder is 400mm long for rudder steering (or outboard) and the smaller one is 100mm for outboard throttle or gear position control.

The slots in the PCB is where the reed switches fit in for easy soldering to the PCB. The reistors sit on the side of the PCB, I use 1206 resistors. The encoder's current can be calculated by counting the amount of resistors and devide the 5V supply by it. ie 5V / 100 x 1k = 5mA. The lower the resistors the higher the current, and vice versa. 5mA to 15mA should be good enough.

The housings are thin SS sheet I laser cut with holes for mounting, folded, put PCB in and pot water proof.

Fanie
11-24-2011, 10:09 AM
This is a simple drive I made before. It uses one motherly big 24V bus wiper motor, even at 12V I cannot physically stop the drive when pushing or pulling, so it is strong.

The encoder will simply mount along the moving arm and a magnet gets fitted to the arm. It will output it's position as the magnet moves with the arm.

X7JAY7X
11-24-2011, 10:55 AM
Fanie, how do you have a clutch with that?

Why did you make a linear encoder over buying one? They can be expensive but if you look hard enough you can find one for a good price.

Fanie
11-24-2011, 11:45 AM
Fanie, how do you have a clutch with that?

Why did you make a linear encoder over buying one? They can be expensive but if you look hard enough you can find one for a good price.

Making the encoder wasn't THAT cheap - in SA everything is a ripoff :(

Also, I kinda design and manufacture electronic things ;) I can however make my encoders any size I want - even meters long if it comes to that. Some of my friends also wanted some custom ones and I made them without problems.

As for a clutch, depends how much movement and how rigit you want it. A push-pull spring can perhapa work with a spring centering the 'cluth'. The clutch is then two sleeves (pipes) one sliding into the other and the spring keeps the two parts centered. The advantage would be that the position right itself in case your rudder gets hooked on a submerged container :D

There may be other ways of doing it also - one would be a force sensor (like in a load cell) that would, when the push or pull force exceeds a certain amount, reverse the motor or rather rotate it in the direction of force to prevent breakage.

X7JAY7X
11-24-2011, 07:12 PM
The clutch is then two sleeves (pipes) one sliding into the other and the spring keeps the two parts centered.

This was one of my clutch ideas but instead of the spring, the pipes would lock together. I don't like the idea of the spring because you will be fighting the spring when you want to steer the boat.

Fanie
11-25-2011, 01:08 AM
A little spring movement will have a shock absorber effect. The spring should be stiff enough to be affected only slightly under normal conditions. I think the drawback is the size rather than the working.

I also ditched the idea and am looking at flip up rudders instead, perhaps make it so they can be replaced more easily. Haven't got any final ideas yet but it's in the back of my mind (somewhere...).

zorbas
11-25-2011, 07:37 AM
It is so strange that there simply doen't seem to be a linear drive with a built in clutch.

Maybe I'll have to install a cogwheel on the quadrant and make it chain driven. Then it would be easy to install a electromechanical clutch. Or install a clutch on the pole itself and connect the cogwheel to the clutch. How to get the clutch onto the steering pole is of course not tthat easy :(

View Full Version : homemade autopilot