homemade autopilot

Discussion in 'OnBoard Electronics & Controls' started by bertho, Nov 8, 2009.

  1. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    Looks very nice!

    Looks very nice!

    Dave
     
  2. X7JAY7X
    Joined: Jun 2011
    Posts: 28
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Toledo, OH

    X7JAY7X Junior Member

    Dave, I have had no time to work on mine. I dont even have my boat in the water yet. Hopefully this weekend. I did order a different motor driver for mine since the one I had I didn't care for. It was not easy to work with and I think that wasn't helping my control loop. I think when I do get around to working on it, I am going to scrap my current firmware and do a complete rewrite. I think I can make it better especially since mine oscillated a little last year. Glad to hear you have yours working well.
     
  3. frasco
    Joined: Jun 2011
    Posts: 41
    Likes: 1, Points: 8, Legacy Rep: 15
    Location: Finland

    frasco Junior Member

    Thanks!

    I have this motor driver: http://www.sparkfun.com/products/9457

    And I'm looking for some kind of compass unit. I don't want to spend a fortune so I'm thinking about ordering this one: http://www.sparkfun.com/products/10703

    And I'll have to think of a way to 'know' the actuator position. The Plastimo has a built-in function that I could use/modify, or then get a cheap Raymarine one that someone posted on the last page.
     
  4. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    Compass

    Frasco,

    I'd go with the CMPS10 unit. I think that X7JAY7X is using that module also??

    You can get it here - look in the bottom left corner: http://www.robotshop.com/search/search.aspx?locale=en_us&keywords=compass

    These guys also sell it in the UK.
    http://www.robot-electronics.co.uk

    This board has an onboard processor that processes the xyz components of the accelerometers and flux vectors and outputs compass heading along with pitch and roll in degrees. It also has a compass calibration routine built in, the unit you linked to would require your processor to do all of the correction for pitch and roll. Well worth the additional $7 or so.

    The night before last I put together a test compass using the CMPS10 module and a Maxim Max203CPP+G36 RS232 to TTL converter chip. The converter chip has onboard capacitors to generate the RS232 voltages, so there is little wiring.

    They had a program on the UK website to show the compass data on a PC via their USB-ISS device which is a USB to I2C bus bridge device.
    Last night I hacked the VB 2008 Express code so I would display the compass data on a PC via RS232. The program .exe file and hacked development code is at ftp://dc9.tzo.com. Log on as anonymous.

    The CMPS10 board looks good. The heading output varies by about 2 degrees just sitting still which is about as good as the expensive KVH compass I have been using. The board is $45 with shipping in the US. The little plastic box I have for it was about $7, a perf board is about $1.00, the Maxim chip was $8.00. I'm going to add a 7805 regulator so I can feed it with battery power at 12 volts. Add $5.00 for a cable and $1.00 for a gland connection and my total is $68 plus my time and some bits of wire and a couple small screws. The output updates every 640 ms.

    The raw values from the accelerometers and the flux sensors are also available every 75 ms.

    The bad thing about doing stuff like this yourself is that the development process can be never ending.. I keep seeing things I can further improve.

    I'm going to try out this new compass on the boat tomorrow. We have a very hot day today (forecast is for 102 degrees :-( )

    I agree that you really need to know the actuator position. I know that some autopilots say that they don't need actuator feedback now, but I think that is a huge compromise. Knowing rudder position is very valuable information. Actually I am not sure if any slow boat (sail boat etc) autopilots can operate without rudder position feedback. I know that some of the powerboat autopilots operate without rudder position feedback but after working on my sailboat autopilot I think that doing a powerboat autopilot would be a lot easier. There is a lot of variability in a small sailboat due to wind speed. Tiller sensitivity changes a lot on my boat due to wind speed and angle of sail.

    X7JAY7X:
    >>Dave, I have had no time to work on mine. I dont even have my boat in the water yet.

    That sounds like me last year! I got my boat in the water in early May this year and I have been making time to use the boat this year. I've been hoping to catch some fish but my timing has been horrible. I get to the fishing "hotspot" when they turn cold! Are things busy at your marina this year? Meinke is slow. Slower than last year, and last year was slow. A lot of boats were never put in the water this year - mostly big power boats. I would not want to be in the marina business these days.

    >>I am going to scrap my current firmware and do a complete rewrite

    My current code looks nothing like what I started out with. I think I am on major revision 8 or something like that. If my gain is too high I can get the autopilot to oscillate as it over-corrects. I also found that slop in my rudder is affecting my autopilot. I never noticed that before, but the finer I tune it in, the small things start to show up as issues. But these autopilots can be over tuned. If I back off on the gain, the rudder slop becomes insignificant. I plotted the boats path on a GPS and even with the gain backed down the path was a straight shot on the chart over a distance of 8+ miles. It steers a lot better than I can do by hand. A week and half ago I went out sailing with a friend and we had the autopilot engaged and we were doing about 5 knots sailing upwind in very light winds with every square foot of sail up that I had. I wanted to adjust the main sail so I went up to the mast and started working on that and I needed a second hand so my friend climbed up to the mast also we were talking and making some adjustments for a good 5 minutes or so - meanwhile the autopilot is silently steering the boat alone.. gosh it is nice not to be tied to the tiller!

    Dave
     
  5. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    I have been using my homemade autopilot a lot this summer and it has been very reliable.

    I was going to tie in a gyro chip to "gyro stabilize" the autopilot. This would add rotational velocity input to the controls along with the current compass heading. So in effect this would measure how fast the boat is turning.

    I have done a lot of research on this and apparently the X5 unit that is sold by Raymarine has a gyro in their autopilot and it works "just ok" for downwind sailing with the criticism being mostly that the autopilot works really hard keeping the boat under control, and that sometimes it cannot turn the tiller fast enough to properly control the boat and it that case it is ineffective.

    Does anyone have any experience with the Raymarine X5 autopilot and it's downwind control characteristics?

    Dave
     
  6. frasco
    Joined: Jun 2011
    Posts: 41
    Likes: 1, Points: 8, Legacy Rep: 15
    Location: Finland

    frasco Junior Member

    I've gone hippie and will feature a minimal amount of electrical gear on my boat. Windvane steering will do it for me. :)
     
  7. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    Well my hair is pretty long at the moment..and I lived through the 60's.. but... :)

    Windvanes are great, but they don't work well in light air. And I see a lot of light air.

    If I could rely on a windvane, I'd be making or scrounging one of those. :)
     
  8. Joakim
    Joined: Apr 2004
    Posts: 892
    Likes: 53, Points: 28, Legacy Rep: 422
    Location: Finland

    Joakim Senior Member

    I have Raymarine S1 system pilot, which I have upgraded with a homemade gyro chip. Now it works very well downwind. I can let it steer in conditions requiring 100% concentration from me. The difficult part is to reach out and press the auto button.

    When you let it "autolearn" it will set up its parameters. For my boat it set the "Response level" rather high, which is good for sharp steering in difficult conditions, but is maybe overly active in easier conditions. You can easily adjust that during use and I often do that.

    I have only sailed one season without the gyro ship with this boat, but I think it was a big improvement in difficult conditions. Last summer my family always started complaining about unstable steering when I put the autopilot on in wavy or gusty conditions. This year they didn't even notice it.

    There is also a very clear difference when you press +10 (once or a few times). Earlier the boat turned quite slowly and there was a clear overshoot before the new heading was reached. Now the boat starts the turn quite sharply and stops spot on to the new heading without any overshoot. It may even be too sharp for someone standing in the bow...

    I think X5 has about the same control unit, but it has gyro as standard (there was also S1G with gyro).

    I don't have any experience on tiller models with gyro. My earlier boat had ST2000+, which was almost unusable. Even in calm conditions it didn't steer well and it could not be used in waves or with spinnaker.
     
  9. Rolf Koehoorn
    Joined: Feb 2012
    Posts: 5
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Lemmer Holland

    Rolf Koehoorn Junior Member

    realy self made autopilot

    I have uploaded a Youtube file a while ago but am wondering about the fact it isn't viewed more often. Reading this thread made me decide to put the link here: www.youtube.com/watch?v=Fgpny7ItcV0
     
  10. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    Hi Joakim,

    Thanks for the info!

    Very interesting... and really good info.

    >>There is also a very clear difference when you press +10 (once or a few times).

    I was wondering how much of a different a gyro would make for a course change like that. I have a really nice compass on my homemade unit made by KVH (like $800 list price, that I got off Ebay years ago) and even with that compass, as stabilized as it is, the compass data is insufficient to derive the rotational rate info about the Z axis/Yaw that can be obtained with gyro chip.

    My homemade unit limits the rudder angle to limit the Yaw rate but that really is not effective in some situations. To stop the rotation after a course change, the software counter steers the rudder as the new course position is approached and that also works but is once again dependent on sea state and boat position to the wind. (The Autohelm 4000 had this functionality)

    My biggest concern was working the actuator too hard during downwind sailing. Your actuator must be below on a quadrant or something similar. Is it working hard when going downwind?

    I am beginning to think that my "working too hard" concern may be misplaced. I sail singlehanded at least 75% of the time and having to hang onto the tiller all of the time when downwind sailing, is a big problem.

    I can totally understand your 100% concentration being required - my boat acts the same way.

    So what level of trust do you put in your autopilot when downwind sailing?

    Do you trust it enough to leave it alone for minutes?

    Doing a round up in waves with a lot of sail up can be a little more exciting than most of my passengers want to endure. And honestly when sailing with passengers there are usually none on board, other than perhaps my one daughter, who can control the tiller sufficiently to maintain a stable course when sailing downwind. It is that difficult.

    I've read where many offshore sailors simply refuse to trust their autopilot in downwind conditions (and these guys are not constrained by the cost of an autopilot.) Do you think their fears are warranted?

    >>My earlier boat had ST2000+, which was almost unusable.

    That is why I decided to do my own autopilot. I kept reading about how unusable they are. I think I am now way ahead of the ST2000 functionality as it steers to a heading in most conditions better than I do, but my unit does not do well downwind.

    Sounds like I must add a gyro. I already have the hardware, but it will be a bunch of work to make it work properly with the software. The good thing is that it will require a lot more testing on the water. :)

    Thanks, Dave
     
  11. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    Rolf,

    Interesting video. I don't have a GPS tied into my autopilot. How do you use that data in your autopilot software?

    My autopilot is running on an inexpensive Industrial PLC, since I wanted to keep it really simple, yet robust and at least for the rest of this year it will stay that way, but I am considering using a small Linux computer like the Raspberry Pi that could possibly run something like OpenCPN and the Autopilot software on the same platform. That could further cut down the overall cost and combine the screens into one. If it becomes cheap enough, carrying a spare autopilot box would not be an issue in case of a failure.

    Regarding the number of views seen - I must admit that I have searched Youtube and I did not find your video before. So thanks for posting that link. I think there are very few people who are interested in doing their own autopilot. Technically it can be a challenge and it is very time consuming. Testing especially.. but I like to sail. :) This forum is the largest discussion I have found on homemade autopilots.
     
  12. Joakim
    Joined: Apr 2004
    Posts: 892
    Likes: 53, Points: 28, Legacy Rep: 422
    Location: Finland

    Joakim Senior Member

    I don't sail "real" offshore. Just around the Baltic Sea. This summer our longest leg was 200 M. We sailed the whole leg with spinnaker and 90% with the autopilot. At most we had around 20 knots of wind and we were sailing almost dead downwind (up to 12 knots in waves). I had no problems going inside for a while with autopilot steering. Last summer without the gyro (and less experience with this boat) I was much more concerned about the autopilot.

    Raymarine seems to use the gyro for calculating the compass heading. The actual compass seems to be just used for keeping the average heading accurate. I noticed that when my first gyro chip failed last autumn. It suddenly started showing rather high yaw rate. This resulted to very sharp turn and afterwards the compass reading went around 360 degree circles even when the boat was stationary.

    Certainly the drive unit is working hard in wavy downwind. So am I, if I steer. If the drive unit is well dimensioned, that should not be a problem. But of course working hard uses also a lot of current from batteries. I haven't measured, but I think the 32 hours we sailed was close to maximum without charging. The boat has a 150 Ah battery, but also instruments take maybe 1 A.
     
  13. Rolf Koehoorn
    Joined: Feb 2012
    Posts: 5
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Lemmer Holland

    Rolf Koehoorn Junior Member

    gps functionality in my autopilot

    Dave911

    The gps signals are used for positioning on Oziexplorer and WinGps.

    Also for compensating drift in my own visual basic autopilot program in case I am sailing a specific compass course. Sailing in a small canal the resulting course has to be a straight line in stead of a long curve.
    I can instantly change the influence of compass turning and gps turning in 10 steps. In a small canal where a straight line is more important I choose to give the gps more influence.

    The signals are used to constant show s.o.g.

    At last I use them for correction on the calculated rudder position; When the boat is turning at a specific rate it makes a difference what force is on the rudder / what is the s.o.g.
     
  14. Rolf Koehoorn
    Joined: Feb 2012
    Posts: 5
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Lemmer Holland

    Rolf Koehoorn Junior Member

    sailing downwind

    Dave911

    I can imagine sailing downwind one would like to draw a straight line through the water.
    Sailing by hand the line would be a repeating swing.
    Sailing downwind from hand one would automatically use more force on the rudder if the off course becomes to big.
    I thing this last is very important. How to translate this greater off course into your software. Maybe the speed of turning should influence the pilot's reaction.
    A autopilot should permit a certain slingering and therefore react with delay on this slingering.
    The trick is how much off course is permitted to the autopilot and to translate the normal human reaction on an off course in some program lines.

    I don't think this is any new to you but my reaction is because of I'm thinking it's very interesting.
     

  15. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    >>I don't think this is any new to you but my reaction is because of I'm thinking it's very interesting.

    Technically I think it is an interesting problem also..

    >>I thing this last is very important. How to translate this greater off course into your software. Maybe the speed of turning should influence the pilot's reaction.<<

    Looking at it from a "hand on the tiller" normal response, it is true that the speed of turning naturally makes one correct more quickly. If I sense the boat beginning to go sideways, I immediately steer to correct. And you have to be quick in a sailboat since the sails will greatly worsen the problem. That is what makes a "round up" so "exciting" :-( on a sailboat.

    >>A autopilot should permit a certain slingering and therefore react with delay on this slingering.<<

    I have a gain setting in my current non-gyro setup that allows more or less "slingering", the problem with my current setup is that the response from the compass is way too slow to sense the quick yaw rotation when sailing downwind.

    I think the addition of a gyro input could be added into my PI loop control as a Feed Forward component. A Yaw velocity would applied with some gain component directly to the rudder position to counter the new found velocity. I'm sure it is more complicated than this, but that is probably where I would start.

    Of course that means that every change of the boat yaw velocity would tend to move the rudder and that is where the criticism of this type of control comes in - it tends to work the actuator very hard since it tends to respond to every wave.
     
Loading...
Similar Threads
  1. Deering
    Replies:
    2
    Views:
    1,791
  2. Bumbleguy
    Replies:
    3
    Views:
    3,298
  3. missinginaction
    Replies:
    1
    Views:
    4,969
  4. sv alexandra
    Replies:
    2
    Views:
    3,466
  5. missinginaction
    Replies:
    1
    Views:
    1,947
  6. missinginaction
    Replies:
    2
    Views:
    2,067
  7. Jdawg
    Replies:
    9
    Views:
    2,594
  8. Tony.R
    Replies:
    0
    Views:
    2,097
  9. Steve W
    Replies:
    0
    Views:
    1,749
  10. cal_d_44
    Replies:
    0
    Views:
    2,094
Forum posts represent the experience, opinion, and view of individual users. Boat Design Net does not necessarily endorse nor share the view of each individual post.
When making potentially dangerous or financial decisions, always employ and consult appropriate professionals. Your circumstances or experience may be different.