This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help regarding gain configuration
#1
Hello pypilot users,

I would like to describe a behavior of my autopilot which I don't consider satisfactory:
My boat is 35 foot monohull sailing boat (Dufour 4800) and i am using the engine and transmission of a Raymarine ST-4000 autopilot driven by the Sean solution based on tinypilot and a 10A motor controller. Usually i am happy with the way the pilot works except in the following case:
When sailing downwind if a wave and/or a gust of wind makes the boat deviate from the specified heading let us say by 20° upwind, then after the gust of wind vanishes, the boat slowly gets back to the nominal heading BUT if in the meantime a second gust/wave comes up, then the boat will go off by another 20° and i.e. if only 10° were recovered from the first gust the boat is now 30° off...and so on, after a couple of gusts/waves the boat can be 60° off the specified heading or more, I then have to disengage the autopilot and bring the boat back manually to the requested heading. I use compass mode.

Please see below my regular configuration, indeed I would like to know what parameters I should change in order to have the boat getting back faster to the nominal heading after a strong deviation.
Any idea is welcome!


Attached Files Image(s)
       
Reply
#2
Hello,
The screenshot of gains doesn't allow us to read the setting...
Reply
#3
At first glance try changing:

servo.speed.min to 100%
P to .004 the setting .01 is likely too high
DD to .1 (.05 is maybe too low)
D to .1 (.2 is is probably too high)

From here, try tweaking D gain and nothing else to try to improve performance. You will have to adjust P, D, and DD gains for your boat and conditions

It is not clear what version of pypilot this is, but I do not see a profile setting. Consider updating the sd card (or use a new card and keep old one)
pypilot.org/images

This will allow various profiles for different conditions to give better performance for power use, noise and steering. For example, having servo.speed.min set lower to 50% or so will reduce noise with slower movement, but probably wont correct fast enough downwind with your boat. The course error should be +-10 degrees downwind, but occasionally up to 15 degrees... at least this is considered satisfactory as far as keeping the sail pulling. Any worse and the settings are bad, or else the motor is too slow. How long does it take to move the rudder from -30 to +30 degrees?
Reply
#4
OK I'll try this, I am running the last beta version of tinypilot but here I posted a previous setting which gave the behavior described. It may be that the motor is a bit slow it takes about 20s -30°/+30° so I am not expecting miracles...
Thank you for your suggestions I'll give them a try!
Reply
#5
Yes, 20 seconds is very slow, but your settings also made it much worse.

It does depend on the boat, heavy boats can move slower but a faster motor could also really help.
Reply
#6
Hello,
I eventually managed to get something acceptable, 160° downwind the boat goes -5°/+5° around  the requested heading, wind about 10 kts app. However look at the gain configuration below, I had to push D and DD to the top...I am wondering wether you changed the algorithm in the late pypilot version which I am using here (March 2024).

   
Reply
#7
I did not change the algorithm but I did possibly constrain the range, so .25 is likely the maximum value supported.

There is one way around this... You could change "servo.gain" to say 2 instead of 1. This would effectively double all the gains. I am not sure you need this. Maybe it is "ok" with the settings you found?

I am glad you hear it works better, but 10knots is not much wind... What was the boat speed? In higher wind, you might end up reefing the mainsail sooner if you cannot find a faster drive.
Reply
#8
(2024-03-22, 09:03 PM)seandepagnier Wrote: I did not change the algorithm but I did possibly constrain the range, so .25 is likely the maximum value supported.

There is one way around this...  You could change "servo.gain" to say 2 instead of 1.  This would effectively double all the gains.  I am not sure you need this.  Maybe it is "ok" with the settings you found?

I am glad you hear it works better, but 10knots is not much wind...  What was the boat speed?  In higher wind, you might end up reefing the mainsail sooner if you cannot find a faster drive.

OK, thank you for the servo.gain tip, I believe i might have to use it because the test I made was in light wind building up with small waves, the boat was going at 4.5 knots under genoa only (no main sail), in the end the wind came at 90° and up to 15 knots, the pilot started to struggle then...but managed to keep the boat on the course. At this point I still have the feeling that the pilot reacts a bit too late and not enough. Servo.period is set at 0.4.
More tests to come soon...
Reply
#9
For late reaction the DD gain usually helps, but setting it too high will just use more power.

You could try reducing the servo period to .3 or even .2 but I think with a heavy boat 0.4 is probably best.
Reply
#10
Hello
The servo.gain parameter range is now -10/+10 is this correct? I believe it was 0/2 last time...or 1/2
Please see attachment

   
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)