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
Remove Unused Pilots
#1
Hello,
I'm struggling to find the 'sweet spot' with the pypilot gains to get our boat to hold a downwind course with a reasonable swell.  I can fiddle with the gains via the OpenCpn plug-in, but having the 'wind', 'simple' and 'absolute' gains all showing up makes it hard to cross reference the 'basic' settings and I keep mucking it up. 

Is there a simple way to remove them?  Can I just get rid of or hide the code for them in the pypilot/pilots directory?  Does all of the code handle the addition / removal of pilots automatically?  Would I also just need to remove the gains for the unused pilots from the config file?

I suspect that there's more to it than this as there are a number of pilots in that directory that don't show up on the Gains screen.  Any clues would be gratefully received.

I'm using version 0.12 of pypilot which is working beautifully unless we are running downwind, when I can't get it to respond quickly enough to hold a course.

Cheers
Reply
#2
I am not sure about 0.12 but it's a very old version now. In newer versions the opencpn plugin must also be upgraded, and only the gains of the current pilot are displayed.

You cannot just remove the pilots from the config file, but I also don't think version 0.12 had different pilots so I would check the version more closely. You can disable the pilots in the code, but it's very difficult to support old versions.

Some pilots already are disabled by default because they are still in development.


As for responding quickly. Check servo.speed.min. Make sure it is 100%. This may help a bit. Then you could reduce servo.period to 0.3 maybe... try each change and observe the results. Finally increasing gains can help to an extent, but there is a limitation based on the drive motor you are using. There will be a point where it is not fast enough. Is it able to move the rudder as fast as you can? Most cannot.

More info on the conditions, system and expectations would be interesting. I am glad it works at least some of the time.. is it unusable downwind? Sometimes there is an acceptance of "good enough" to keep the sails full. Sometimes downwind you will achieve much better balance (and speed) polling out the head sail and making the pilot work better.
Reply
#3
(2021-09-25, 04:21 AM)seandepagnier Wrote: I am not sure about 0.12 but it's a very old version now.   In newer versions the opencpn plugin must also be upgraded, and only the gains of the current pilot are displayed.

You cannot just remove the pilots from the config file, but I also don't think version 0.12 had different pilots so I would check the version more closely.   You can disable the pilots in the code, but it's very difficult to support old versions.

Some pilots already are disabled by default because they are still in development.


As for responding quickly.  Check servo.speed.min.   Make sure it is 100%.  This may help a bit.   Then you could reduce servo.period to 0.3 maybe...  try each change and observe the results.    Finally increasing gains can help to an extent, but there is a limitation based on the drive motor you are using.   There will be a point where it is not fast enough.   Is it able to move the rudder as fast as you can?   Most cannot.

More info on the conditions, system and expectations would be interesting.    I am glad it works at least some of the time..   is it unusable downwind?   Sometimes there is an acceptance of "good enough" to keep the sails full.   Sometimes downwind you will achieve much better balance (and speed) polling out the head sail and making the pilot work better.

Hello Sean,
Many thanks for the super fast response.

The down-level software is a consequence of the difficulty of getting internet access where we've been cruising, which is my problem to solve not yours.  So don't worry about supporting old versions of the code.

Looking at the __init__.py code in pypilot/pilots it seemed to be looking for bits of python code to import.  I was hoping that by hiding the unwanted pilot code, the modules wouldn't be imported and therefore be ignored by the rest of the autopilot and the OpenCPN plugin.  This would be easy.  As would scrubbing the config file of unwanted parameters.

If the old code isn't necessarily that clever, I'll leave it alone and go down the route of directly updating the config files.  

With regards to the problem we're having, everything is pretty much perfect unless we're running downwind with a reasonable swell behind us (we generally do this with just a poled out headsail).  Most of the time everything is fine, but occasionally we'll get slapped with a big wave that pushes us a long way off course.  The pilot takes a signifiant amount of time to respond, by which time we're on a beam reach, the sails are over-powered and we start getting weather helm.  Which pulls us further off-course.  Or we back the sail and it all gets very loud and flappy.  I've never left the pilot to sort it out itself, but I'm sure that given enough time it would eventually bring us back onto course.  On our last passage I gave it well over 30 seconds and it was still only making small movements of the wheel.

During the day, it's 'good enough' as there's always someone awake enough to take over.  But overnight or when we're short-handed, i need to know that I can trust the pilot and the conditions for 10 minutes whilst we make a hot drink etc.

I've not touched either the servo.speed.min or the servo.period so both will be at their default values.  I'll try reducing the servo.period and see how that helps.  I hadn't realised that it's also used to control the time between wheel movements.  We're using the old Raymarine ram which is pretty quick at spinning the wheel.

Cheers
Reply
#4
It sounds like a difficult test. I am wondering if the gyro signal is saturating. The boat is turned quickly because of a wave, and this would happen with any pilot (that cannot anticipate) but the gyro signal is maxed out for a short time and not fully recognized.

I suggest, increase servo.speed.min and servo.speed.max to 100. You can reduce them in calm conditions to make the motor more quiet. This will give maximum correction. Next increase P, D, and DD gain adjusting slowly and experimenting.

You should be able to get some improvements from adjusting the settings.

Eventually you may need to consider reefing the mainsail or reducing sail to slow down maybe only 0.5 to 1 knots. This makes it much easier for the pilot. I am working on smarter pilots which will anticipate, and learn from past mistakes use video camera (looking at waves and sails) and much more.


You can disable some pilots by removing them (or move them somewhere) then running
. pypilot.build
on the tinypilot

It may be a good idea to clone the sd card first. You can also update the software of pypilot. The new version uses 20hz main loop instead of 10hz so the reaction time is slightly better. Also, you can add "disabled=True" to any pilots to disable without needing to move/delete the file.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)