homemade autopilot

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

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

    Tim B Senior Member

    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.
     
  2. DaveJ
    Joined: Jun 2009
    Posts: 131
    Likes: 4, Points: 0, Legacy Rep: 66
    Location: Brisbane, Australia

    DaveJ Senior Member

    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.
     
  3. goboatingnow
    Joined: Oct 2008
    Posts: 65
    Likes: 4, Points: 0, Legacy Rep: 74
    Location: Ireland

    goboatingnow Junior Member

    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.
     
  4. DaveJ
    Joined: Jun 2009
    Posts: 131
    Likes: 4, Points: 0, Legacy Rep: 66
    Location: Brisbane, Australia

    DaveJ Senior Member

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

    Tim B Senior Member

    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.
     
  6. DaveJ
    Joined: Jun 2009
    Posts: 131
    Likes: 4, Points: 0, Legacy Rep: 66
    Location: Brisbane, Australia

    DaveJ Senior Member

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

    Tim B Senior Member

    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.
     
  8. CaptBill
    Joined: Jan 2010
    Posts: 184
    Likes: 10, Points: 0, Legacy Rep: 64
    Location: Savannah,Ga

    CaptBill CaptBill

    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
     
  9. CaptBill
    Joined: Jan 2010
    Posts: 184
    Likes: 10, Points: 0, Legacy Rep: 64
    Location: Savannah,Ga

    CaptBill CaptBill

  10. CaptBill
    Joined: Jan 2010
    Posts: 184
    Likes: 10, Points: 0, Legacy Rep: 64
    Location: Savannah,Ga

    CaptBill CaptBill

    This Guy has it all figured out



    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!
     
  11. DaveJ
    Joined: Jun 2009
    Posts: 131
    Likes: 4, Points: 0, Legacy Rep: 66
    Location: Brisbane, Australia

    DaveJ Senior Member


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

    Tim B Senior Member

    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.
     
  13. goboatingnow
    Joined: Oct 2008
    Posts: 65
    Likes: 4, Points: 0, Legacy Rep: 74
    Location: Ireland

    goboatingnow Junior Member

    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!).
     
  14. DaveJ
    Joined: Jun 2009
    Posts: 131
    Likes: 4, Points: 0, Legacy Rep: 66
    Location: Brisbane, Australia

    DaveJ Senior Member

    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.
     

  15. goboatingnow
    Joined: Oct 2008
    Posts: 65
    Likes: 4, Points: 0, Legacy Rep: 74
    Location: Ireland

    goboatingnow Junior Member

    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.
     
Loading...
Similar Threads
  1. bballer
    Replies:
    1
    Views:
    2,888
  2. Deering
    Replies:
    2
    Views:
    399
  3. Bumbleguy
    Replies:
    3
    Views:
    1,700
  4. missinginaction
    Replies:
    1
    Views:
    2,671
  5. sv alexandra
    Replies:
    2
    Views:
    2,022
  6. missinginaction
    Replies:
    1
    Views:
    1,012
  7. missinginaction
    Replies:
    2
    Views:
    1,106
  8. Jdawg
    Replies:
    9
    Views:
    1,456
  9. Tony.R
    Replies:
    0
    Views:
    1,313
  10. Steve W
    Replies:
    0
    Views:
    1,035
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.