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.

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
automatically selecting autopilot gains
#11
Is there some way we can detect the current conditions from wind sensor and inertal sensors and simplify it to a 2 or 3 dimensional space for "current conditions" ?

From here, you could tune the gains and once they are favorable press a button "save" to record these settings.

Once enough settings are recorded in enough sea states/conditions, we can interpolate the gains all the time as conditions change. If the user overrides the interpolation with either manual tuning, or some sort of autotune algorithm, this would allow a new update to be recorded to improve the settings.


This is somewhat tedious interaction and probably would take a while and different conditions until enough is know, but I think it could be interesting. Once we can tune a few boats this way and compare their settings, then a generic default settings, and try to reduce the number of changing parameters, or map the gains to a different state space with less dimensions. This would give a head start and make tuning future boats much faster, but it might even help to enter the boat type or characteristics as well (once we have lots of data)


I like this approach since it uses little processing power and is easy to understand, but I still plan on developing other pilots such as neural network approach because they have potential to do better than human steering which is not really possible with PID (unless human is tired)
  Reply
#12
In fact, the lower left button 'read fom systemk' already takes the current pid settings and stores them in the current cell of the 'gainset matrix', so to speak. One could add a checkbox and a timer to do that periodically. So on openplotter, this facility chooses a preset, sends it to the pypilot; if you make it change on your pypilot, it is remembered for the current circumstance.

Parameters are expected to be not only dependent on the boat, but also on the actuator dimensions, but some persistent thread on this forum on what parameters people use could be insightful.

As for the number of input parameters, I'd stick to 2 for now until I got my setup actually operational. It's also to be seen if the other four gains would need to be part of it.
  Reply
#13
From experience I think you should instead adjust P, D, and DD rather than I. Another idea is to use an overall gain and the value that equals D/P. Capturing the gains this way gives better extrapolated values for gains in new conditions, and allows transferring the table to other similar vessels better.

Eventually DD/D might be considered as well.

The limitation is still the control loop which is not optimal no matter how it is tuned since steering in waves with sail power is a non-linear problem and the basic autopilot is simple.

I think you will find a wide range of P, D values which are acceptable making it sometimes difficult to find the right gain. They can widely vary with similar steering in some cases, so by the time you determine which is best, the conditions are already changing.
  Reply
#14
Good hints these are, thx; I'll add DD then.

One of my ideas with this tool is to automatically improve the gains on a continuous basis. Define a performance indicator, for instance, the ap.heading_error as you already use in autogain.py (the trick is making it a rolling average). Then, at certain intervals, take the current gainset and adjust some of them by a harmlessly small, but random factor. Measure performance for a certain time, and if performance improved, switch to the new gainset. If not, stick to the old one and repeat. This all happens within the context of one gainset. This way, the system learns by itself.

While we are brainstorming, let's touch the subject of non-linearity. To be honest, before I started looking into autopilots I thought it was more advanced than PID contol. I'm talking in general, not only pypilot. There are urban myths going around about autopilots that are in tune with the periodics of the waves and the boat, and I believed them. But reading into it, it indeed seems to be all about these PID gains. Are you aware of any wave modeling going on? If you'd have the imu.heave, you might be able to lock a phase locked loop (PLL) system to it. With some certainty this could predict an incoming wave in some well-behaved sea, if such a thing exists ;-) Would not know what to do with it yet, especially given its stochastic nature, but I do find it an interesting thought. When you're hand-steering, you anticipate waves in some way, and that is feed-forward. You can already do something with the imu.pitch I guess https://liquidsdr.org/blog/pll-simple-howto/.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)