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
automatically selecting autopilot gains
#15
(2019-07-16, 07:31 PM)ironman Wrote: 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.

Modifying by a harmlessly small amount may improve the gains, but at a learing rate slower than changing conditions.         I don't think a continuous  improvement will work all that well.   Consider sudden wind increases.  If it can use past data, the gains can be radically changed  right away, so this is what is needed.

Quote: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

It is a little more advanced..   There are a few non-linear gains.  I have experimented with about 12  gains in the ocean and only the 6 supported seem to have a useful effect so far.   There is so much more possible though.

Quote: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

Theh imu.heave is basically available as imu.accel, but you might have to apply the fusionQpose quaternion to this vector to get heave and sway.

The frequency is going to be the same for all the inertial measurements.   The scope even can plot the fourier transform of any sensor.    At sea, there are also sometimes 2 distinct frequencies/periods of motion.
Quote:it. With some certainty this could predict an incoming wave in some well-behaved sea, if such a thing exists ;-)

It depends on the type of wave.   I know from passing powerboats that first  you get longer waves with less amplitude before shorter steep waves, so maybe if you know the type of wave you can do something but it's very difficult to predict.    The other approach is to use a camera so the autopilot can see the waves.

Even as a human with eyes, I sometimes duck large waves that don't make a splash, and get soaked from seemingly small ones.

Quote: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/.

Yes.   The basic idea that isn't implemented/proven yet is to add a new gain for wave motion.

This gain would be for a value calculated from the inertial sensors.   For example take yaw rate and find the frequency and phase from the last two wave cycles.    Lowpass these values and output a sine wave with this frequency which is phase shifted an adjustable amount from the yaw rate.  

This might work if the waves are predictable but has the potential to work against you and do the wrong thing if a strange or new wave pattern is encountered.
Reply


Messages In This Thread
RE: automatically selecting autopilot gains - by seandepagnier - 2019-07-19, 03:44 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)