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

    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.
     
  2. X7JAY7X
    Joined: Jun 2011
    Posts: 28
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Toledo, OH

    X7JAY7X Junior Member

    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.
     
  3. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    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.
     
  4. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    Autopilot development

    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
     
  5. CDK
    Joined: Aug 2007
    Posts: 3,324
    Likes: 148, Points: 63, Legacy Rep: 1819
    Location: Adriatic sea

    CDK retired engineer

  6. Tim B
    Joined: Jan 2003
    Posts: 1,438
    Likes: 59, Points: 0, Legacy Rep: 841
    Location: Southern England

    Tim B Senior Member

    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.
     
  7. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    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.
     
  8. Tim B
    Joined: Jan 2003
    Posts: 1,438
    Likes: 59, Points: 0, Legacy Rep: 841
    Location: Southern England

    Tim B Senior Member

    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.
     
  9. X7JAY7X
    Joined: Jun 2011
    Posts: 28
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Toledo, OH

    X7JAY7X Junior Member

    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.
     
  10. tspeer
    Joined: Feb 2002
    Posts: 2,319
    Likes: 303, Points: 83, Legacy Rep: 1673
    Location: Port Gamble, Washington, USA

    tspeer Senior Member

    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.
     
  11. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    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.
     
  12. X7JAY7X
    Joined: Jun 2011
    Posts: 28
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Toledo, OH

    X7JAY7X Junior Member

    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?
     
  13. michael pierzga
    Joined: Dec 2008
    Posts: 4,862
    Likes: 116, Points: 0, Legacy Rep: 1180
    Location: spain

    michael pierzga Senior Member

    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.
     
  14. Dave911
    Joined: Aug 2011
    Posts: 70
    Likes: 2, Points: 0, Legacy Rep: 16
    Location: Indiana

    Dave911 Junior Member

    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.
     

  15. michael pierzga
    Joined: Dec 2008
    Posts: 4,862
    Likes: 116, Points: 0, Legacy Rep: 1180
    Location: spain

    michael pierzga Senior Member

    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.
     
Loading...
Similar Threads
  1. Deering
    Replies:
    2
    Views:
    1,759
  2. Bumbleguy
    Replies:
    3
    Views:
    3,285
  3. missinginaction
    Replies:
    1
    Views:
    4,939
  4. sv alexandra
    Replies:
    2
    Views:
    3,449
  5. missinginaction
    Replies:
    1
    Views:
    1,923
  6. missinginaction
    Replies:
    2
    Views:
    2,052
  7. Jdawg
    Replies:
    9
    Views:
    2,580
  8. Tony.R
    Replies:
    0
    Views:
    2,080
  9. Steve W
    Replies:
    0
    Views:
    1,746
  10. cal_d_44
    Replies:
    0
    Views:
    2,085
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.