Full Version: Adjusting Gains 101
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Perhaps the biggest documentation need for Pypilot will be a description of the various Gain settings, and a description of how to go about dialing in Pypilot in a new installation. 

Sean explained these in another thread:

Quote:D2 -- experimental is the D gain squared. Will make adjustments with very fast boat movement but not much if the boat is turning slower. Is non-linear
FF -- feed forward This gain applies rudder movement with changing heading command. When holding a heading it does nothing, but takes effect following routes, or when you adjust the heading
DD -- rate of rate of change. basically the derivative of the D gain, very useful to reduce overshoot and lag
PR -- experimental Square root of position gain. This makes less movements when the heading is very wrong to avoid overshoot.

What gains should be adjusted and when? How might the on-screen display of the various Gains firing help in finding the right settings? 

A video on this topic might also be helpful. 

Preferably avoiding complex mathematical concepts. Smile
Simple explanation (for now)

Starting out, you mostly need just D gain, and a bit of P to avoid drifting off course. It's possible to hold a course using just these two gains setting all the rest to zero. From there, try adding other gains to see the difference.

1) Using a high value for PR, and cutting the P gain way back can reduce overshoot and oscillation, but some P is usually needed.

2) The I gains is useful if the course held has an offset from the course desired, or following routes is along a parallel line rather than the actual route.

3) The FF gain helps in maneuvering, tacking, and following routes.

4) The DD gain can be useful to reduce oscillation, try slowly increasing it, but not to a value higher than 1.5x of the D gain

5) Lower gains typically mean lower power consumption, but not always. If the gains are too high, the autopilot will track all over.

6) A fairly wide range of P and D gains can yield similar performance, especially in light conditions

In the future I am looking forward to auto-tuning, as well as different options for non-PID control such as neural networks, which can learn and utilize more sensor inputs, but I am not there yet.