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

    CaptBill CaptBill

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

    DaveJ Senior Member

    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.
     
  4. bertho
    Joined: Aug 2006
    Posts: 181
    Likes: 5, Points: 18, Legacy Rep: 59
    Location: asean archipelago

    bertho bertho

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

    DaveJ Senior Member

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

    Tim B Senior Member

    Very neat. There are commercial units with built-in smoothing and Kalman filter techniques as well, but they are more expensive).

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

    goboatingnow Junior Member

    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).
    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.
     
  8. The copper guy
    Joined: Feb 2010
    Posts: 85
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Back in the UK

    The copper guy Junior Member

    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
     
  9. Silic0re
    Joined: Mar 2010
    Posts: 10
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Texas

    Silic0re Junior Member

    (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.
     
  10. bigkahuna
    Joined: Jun 2008
    Posts: 53
    Likes: 1, Points: 8, Legacy Rep: 41
    Location: USA

    bigkahuna Junior Member

    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?
     
  11. Silic0re
    Joined: Mar 2010
    Posts: 10
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Texas

    Silic0re Junior Member

    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.
     
  12. bigkahuna
    Joined: Jun 2008
    Posts: 53
    Likes: 1, Points: 8, Legacy Rep: 41
    Location: USA

    bigkahuna Junior Member

    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.
     
  13. Silic0re
    Joined: Mar 2010
    Posts: 10
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Texas

    Silic0re Junior Member

    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.
     
  14. bigkahuna
    Joined: Jun 2008
    Posts: 53
    Likes: 1, Points: 8, Legacy Rep: 41
    Location: USA

    bigkahuna Junior Member

    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.
     

  15. Silic0re
    Joined: Mar 2010
    Posts: 10
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Texas

    Silic0re Junior Member

    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".
     
Loading...
Similar Threads
  1. Deering
    Replies:
    2
    Views:
    1,794
  2. Bumbleguy
    Replies:
    3
    Views:
    3,300
  3. missinginaction
    Replies:
    1
    Views:
    4,972
  4. sv alexandra
    Replies:
    2
    Views:
    3,472
  5. missinginaction
    Replies:
    1
    Views:
    1,948
  6. missinginaction
    Replies:
    2
    Views:
    2,070
  7. Jdawg
    Replies:
    9
    Views:
    2,596
  8. Tony.R
    Replies:
    0
    Views:
    2,098
  9. Steve W
    Replies:
    0
    Views:
    1,750
  10. cal_d_44
    Replies:
    0
    Views:
    2,095
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.