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
Gains.... Need some help lease
So I went out today to run the stabilized gas into my engines and had some time to futz around with gains.  I just cannot get it to change the heading.  It was following my heading of 100deg then I added 20 deg.  But it just ignores the change? I’m sure it’s gains.  Any help.
(2020-11-14, 11:45 PM)rastam4n Wrote: So I went out today to run the stabilized gas into my engines and had some time to futz around with gains.  I just cannot get it to change the heading.  It was following my heading of 100deg then I added 20 deg.  But it just ignores the change? I’m sure it’s gains.  Any help.
Hi rastam4n,

I use this settings.
D=0,1 DD=0,17 FF=0,7 P=0,0032 all other =0
also they are on a sailboat it would react well to a cours change of 20 degrees

I see you have ff=0.5 that should do but maybe your P is to low ?
Save sailing

I can confirm the values from Andreas (xfactor99).
I got nearly the same values simulating my boat here at home on the table.
I have P:0,002 and PR 0,028 others as Andreas wrote.


Thank you for your advice!

Does anyone know what the bars indicate?
Why they change color?
Which gain reduces the acceptable amount of error? Is there such a gain?

In the gains tuning guide it talks about using PR.. "To use it, increase it until it takes effect, and gradually back off on the P gain" what is meant by "takes effect" how would one know it is taking effect?

R...? There is no description of the R gain "reactive" this sounds like something that might help to make quicker adjustments?

Also, where is the servo.gain? I have not been able to locate it in the Tiny Pilot configuration or the plugin. And what does it do?
the bar color indicates if that particular gain is contributing to port or starboard adjustment. If it turns blue it has saturated.

There is no "accepted error" with the basic autopilot algorithm, it does what the gains tell it to. So higher gains would give stronger reactions and lower errors, but tendency to use more power or over correct.

the reactive gain is experimental it is probably best you leave it at 0. I suggest also setting the integral gain I to 0

the servo.gain will drive the motor harder and is essentially the same as increasing all the gains. If it is negative it allows the pilot to steer if the wires to the motor are otherwise backwards.

Can you confirm the reported heading was 20 degrees different from the one you commanded? Because maybe the compass is out of calibration. The P and PR gains react to absolute heading errors and it's likely you should increase them, but if significant over steering occurs you will need to increase D and DD as well to compensate.

The FF gain will react to immediate changes in heading, so this may be useful to increase to get the boat to change course more quickly.

I'm working on/planning alternative algorithms which use different gains and parameters and even can learn as they go but the basic autopilot with these gains has already proven to work well in a wide variety of boats and conditions.
Thanks Sean
Power is not a concern as I am running an engine with an alternator that has plenty of power even at idle.
I will make those adjustments to "I"
interesting about the servo gain, so in calm weather you could reduce this and as the wind or waves pick up increase it? I still cannot find where this is located though? Can someone point me in the right direction? Or maybe the name is slightly different?

Yes I can confirm I set my original heading at 100 deg and then increased it to 120. I felt TP was trying to slowly make the course change but for every few degrees of success it would over correct in the opposite way.
The compass has good calibration. I have gone through great pains to create a nice spot for the IMU it is mounted on the ceiling about 24" from the monitor in the video. I have very little interference from anything, and the imu reading and my onboard compass are usually within 10 degs of one another.

I am curious to see what others are using. I wonder if users would be interested in sharing their gain settings to create a chart. We could very quickly start see a range of what works, we could include boat size and type etc.

I think the current basic autopilot gains is fine, I just think we all would benefit if we better understood what each one does and what works for others. To me at least they are somewhat of a black box, and I always regret making adjustments because I can never seem to get it back to where it was.

I found the servo gain in the pypilot plugin -> calibration -> pypilotclient then scroll down until you find servo gain.


the servo gain was added for boats that could not get the gains high enough, or wanted to reverse the direction without rewiring.. so it's not usually needed to change for most users, you can increase the other gains.

You may benefit from making the servo gain of 1.5 or 2, but again this is basically the same as increasing all of the gains by this proportion.

If it struggled to make the new course as you describe I suggest:
1) increase P gain, if you overshoot too much, increase D, DD, and/or also increase PR while decreasing P
2) increase FF gain, so it gets a larger initial correction to changing course
3) maybe you already read my guide, but review:
4) more patience, maybe?

check the servo.min_speed and servo.max_speed and servo.period settings and let us know what they are set to. This can affect performance and the trade off of noise vs power consumption vs responsiveness.

How long does it take the motor to move the rudder from stop to stop (hard over time) ? If it's longer than 6-8 seconds on typical boats anyway, then the autopilot will not react very quickly, and it may actually consume more power than a faster motor as it constantly corrects in difficult conditions.
Thanks for the advice Sean, I will make notes on this.
3) yes I have read your guide many times, I just seem to be lacking understanding of what it all means in relation to the P's and the D's and what taking effect means and how to tell if something is taking effect.
4) haha, I've been at this with you now for 2 summers, that alone proves my sticktuitiveness... is that the same as patients? Smile

I cannot verify the rudder speed but I believe when I did test, it was just under 8 seconds.

The servo settings are attached. 

What is servo.hardover_time in the config? Would it be helpful if this was correct?

Hi ratam4n,

please try the exactly settings I posted erlier incl. servo.gain !!!

I think it is basicly a to low P.
I remeberd to have read somewere
that if P is to low if will fail in reaching the desiered course and if P is to high it overshoots.

Save sailing

Forum Jump:

Users browsing this thread: 3 Guest(s)