Sailboat autopilot

This is my construction of an autopilot that, in the end, is supposed to steer a sailboat to a certain wind angle. This history starts a few years ago, and has only been actually tried out on the boat the last two summers. I started and old thread on this forum regarding the use of PID in autopilot construction. That discussion is over and this is the new thread about the pilot itself.

The goal is to have the autopilot following a wind angle. That is, correcting the heading depending on changes in wind direction.

Today is steers the boat really nice on compass course. Now I'm working on the function to take wind angle into account.

Hardware
Tilt compensated compass - LSM303DLH
Arduino Nano on Custom PCB
Wind Vane - based on hall sensor AS5030
Linear actuator - Concentric LACT6-12V-20
Motor position controller - Pololu jrk 21v3

Interesting thread. Looking through your first thread, what became the result? Could you use the sketch as it was first designed?

stenhh

Hmm...I don't know which of the "first designs" you are referring to actually. Its based on the PID-library, which it was from the beginning as well. The D-gain in the PID-function makes the rudder centralize.

Sorry for not being precise enough, I am referring to the sketch in your first thread. I have tried to achieve the same thing - to get a servo acting as a rudder based upon the PID-library with a potentiometer as an input variable. I ran into the same problem as you did, the servo would not return to its centre position. However, setting only the P-value to 1 or 2 and the I- and D value to 0 made the servo react nicely. When the pot was set to the same value as the Setpoint, the rudder went back to its centre position as it is supposed to.

May I ask what became your final PID settings.

stenhh

Sounds good! Right now I'm in the ballpark of P=2.00, I=0.20, D=0.20. But this needs to be dynamically adjusted according to the situation.

Are you working with a scale model boat or a full size ship?

Tobbera:
Sounds good! Right now I'm in the ballpark of P=2.00, I=0.20, D=0.20. But this needs to be dynamically adjusted according to the situation.

Are you working with a scale model boat or a full size ship?

Very close to my own conclusion - the PID values needs to be set in the environment where the PID is doing its work.
I'm on a full scale project. The PID is supposed to control a reversible hydraulic pump through a Pololu Qik 2s12v10 Dual Serial Motor Controller. The servo that I'm using right now is only to validate the output from the test code, and it seems to be working quite well with the proper PID settings.

May I ask about the progress in your own project and your experience using the actuator?

Thanks

My solution works very well. It has steered the boat for several hours. I have even tried to input wind data which works surprisingly well at this early stage.

The electric actuator might be a bit slow in the heavy conditions, but I think I can mount it closer to the rudders rotational center, because its really strong. That way I will gain speed and range of movement.

If a smaller motor controller is sufficient for your hydraulic drive, I have made a custom PCB that accepts Teensy 3.1 and Pololu jrk 21v3 motor controller, plug and play. Can post a picture of it later.

Tobbera:
... Can post a picture of it later.

Please do...

Nowadays its based on Teensy 3.1 for more processing power. My float/double averaging of compass and wind data bottomed out my old Arduino Nano. Now there is a lot more headroom. To this I have added a hefty enclosure and some good buttons.

And here is a video ass well! (Of the old Nano version)

The link seems to be broken. At your convenience - please provide correct url.

Now its OK!

Hi all,

I am in a similar project.
My RabadakPilot is an autopilot Arduino based also.
Please see my Youtube channel to know all my steps on project. Just make a search on Youtube with "rabadakpilot".
I'm very open to share ideas. Please fell free to contact me.

Warm Regards from Portugal

Rabadak Pilot

Checking back in here - did you guys end up with roughly the same PID starting values? I've got a scale autonomous sailboat (3'), and am having a hard time tuning the PID. I've been starting with a much larger D value (P,I,D of 1, 0.001, 5), but will give the ones quoted above a try next time I take it out.

Just for anyone who looks here. I also built an autopilot on a Nano for our 37 foot sailboat. We sail (or motor) about once a week on the autopilot for over a year now.

I have been in all conditions with it, flat calm to waves of 3-4 metres and winds up to 45 knots. Right now it is just a simple PID hooked to a cheap compass board. For the steering I had a steering pump already on the boat from an old Wagner autopilot, so I adapted it to work with that.

I do plan to improve the algorithm some, but I have found that a simple PID also works.

Just for anyone who wonders if it will work. This summer we sailed around Vancouver Island using it That would be approx 700nm which includes the Pacific Ocean as well as thousands of miles around the Strait of Georgia.

I have posted the code I am using here. It is not organized very well, but just in case it helps anyone. GitHub - scottburch/autopilot: Arduino based autopilot

Good luck.

Hi there and thanks for post. Do you have an hardware layout overview to share with us other than the image Diagram1.png.