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
First on the water test
#1
Finally did a real test of tinypilot.
Used opencpn 5.0.0 bionic packages on debian buster 64 bit.
pypilot plugin 0.5.0

Set gains to recommended initial settings.
Initially sort of worked, but gains clearly too low as it was OK being as much as 10 degrees off course.

Had trouble setting gains in opencpn as gains only came up the first time and after that showed just one control. Have photo if needed.
I raised the P and D on tinypilot using ir remote.
Started to work much better left but it was hard to tell what it was setting it to.
Gains needs more tweaking.
Probably a bit more gain.
Next problem is in opencpn plugin the 3 port controls all read 429496 and do not work properly. The 3 starboard 1, 10, 110 work properly.

In Standby the buttons turned in the wrong direction.
In AP active mode direction is correct.

Can the web interface only be used on one device at a time?
Had it on notebook and it would not work on phone.
It works on phone now at home.

After test at home built new opencpn pypilot plugin from the get repository.
By the way the path in git clone git://github.com/seandepagnier/pypilot_pi.git
is wrong.

Now  the gain setting dialog comes up every time :-)
The Port turn buttons are still reading 429496.
Will have to put on boat to see what it does in standby.

In gps mode can the turn buttons be used to change course to dodge something?
If so what so you to to get back on course?

John
  Reply
#2
(08-04-2019, 07:21 PM)johnm Wrote: Finally did a real test of tinypilot.
Used opencpn 5.0.0 bionic packages on debian buster 64 bit.
pypilot plugin 0.5.0

Set gains to recommended initial settings.
Initially sort of worked, but gains clearly too low as it was OK being as much as 10 degrees off course.

Often mechanical wind vanes steer +- 10 degrees, so this may be considered acceptable if the sails are full and the power consumption minimal.

You can increase the gains to make it work harder to some extent, but eventually you will need a faster motor to get better performance.

Quote:Had trouble setting gains in opencpn as gains only came up the first time and after that showed just one control. Have photo if needed.
I raised the P and D on tinypilot using ir remote.
Started to work much better left but it was hard to tell what it was setting it to.
Gains needs more tweaking.
Probably a bit more gain.

You can also change servo.gain which is effectively an overall gain. It defaults to 1, so changing to 2 or 3 will get much more response.

Quote:Next problem is in opencpn plugin the 3 port controls all read 429496 and do not work properly. The 3 starboard 1, 10, 110 work properly.

In Standby the buttons turned in the wrong direction.
In AP active mode direction is correct.
probably old version of plugin
Quote:Can the web interface only be used on one device at a time?
Had it on notebook and it would not work on phone.
It works on phone now at home.
It should work on many devices at once
Quote:After test at home built new opencpn pypilot plugin from the get repository.
By the way the path in git clone git://github.com/seandepagnier/pypilot_pi.git
is wrong.
Where did you get the wrong path?
Quote:Now  the gain setting dialog comes up every time :-)
The Port turn buttons are still reading 429496.
It may be from the old version of the plugin? Can you configure the degree angles at all?
Quote:Will have to put on boat to see what it does in standby.

In gps mode can the turn buttons be used to change course to dodge something?
If so what so you to to get back on course?
You could turn 10 degrees, then turn 10 degrees back.

If it is a more immediate obstical you should disengage the autopilot and manually steer around it.
  Reply
#3
(08-05-2019, 05:01 PM)seandepagnier Wrote: You can increase the gains to make it work harder to some extent, but eventually you will need a faster motor to get better performance.

Quote:Had trouble setting gains in opencpn as gains only came up the first time and after that showed just one control. Have photo if needed.
I raised the P and D on tinypilot using ir remote.
Started to work much better left but it was hard to tell what it was setting it to.
Gains needs more tweaking.
Probably a bit more gain.

You can also change servo.gain which is effectively an overall gain. It defaults to 1, so changing to 2 or 3 will get much more response.

I'll try that.

Quote:Next problem is in opencpn plugin the 3 port controls all read 429496 and do not work properly. The 3 starboard 1, 10, 110 work properly.

In Standby the buttons turned in the wrong direction.
In AP active mode direction is correct.
probably old version of plugin

 That was what I was thinking so I built new one.

Quote:After test at home built new opencpn pypilot plugin from the get repository.
By the way the path in git clone git://github.com/seandepagnier/pypilot_pi.git
is wrong.
Where did you get the wrong path?

https://github.com/pypilot/pypilot_pi
johnm@jmtb:~/pypilot/pypilot_pi/build$ git clone git://github.com/seandepagnier/pypilot_pi.git
Cloning into 'pypilot_pi'...
fatal: remote error:
  Repository not found.

Used  
https://github.com/pypilot/pypilot_pi.git
Quote:Now  the gain setting dialog comes up every time :-)
The Port turn buttons are still reading 429496.
It may be from the old version of the plugin?  Can you configure the degree angles at all?

Version I just pulled from git.
opencpn lists as version 0.9
Is there a newer version?

I can remove and add degree angles and it always does the same thing.
Maybe a 64 bit issue?
If you have any ideas I can edit and rebuild.

Quote:Will have to put on boat to see what it does in standby.

In gps mode can the turn buttons be used to change course to dodge something?
If so what so you to to get back on course?
You could turn 10 degrees, then turn 10 degrees back.

If it is a more immediate obstical you should disengage the autopilot and manually steer around it.

Sounds good .
  Reply
#4
Quote:Next problem is in opencpn plugin the 3 port controls all read 429496 and do not work properly. The 3 starboard 1, 10, 110 work properly.

In Standby the buttons turned in the wrong direction.
In AP active mode direction is correct.
probably old version of plugin


Hi Sean, 

i dont think its the version, i have the same error when using the latest avaiable plugin on my ubuntu 16.04 laptop. 
The windows version og the plugin works right.

I only use the plugin to open the calibrate settings, which other way round does not work within the windows plugin, so i did not start to dig for the error source.

Ahoi!
  Reply
#5
(08-06-2019, 04:06 AM)sideluxe Wrote:
Quote:Next problem is in opencpn plugin the 3 port controls all read 429496 and do not work properly. The 3 starboard 1, 10, 110 work properly.

In Standby the buttons turned in the wrong direction.
In AP active mode direction is correct.
probably old version of plugin


Hi Sean, 

i dont think its the version, i have the same error when using the latest avaiable plugin on my ubuntu 16.04 laptop. 
The windows version og the plugin works right.

I only use the plugin to open the calibrate settings, which other way round does not work within the windows plugin, so i did not start to dig for the error source.

Ahoi!

Good to hear someone can confirm this.
I'm taking a stab at fixing it  but it's going slow.
25 years ago was pretty good programmer but even then had minimal c++ experience.

I assume that the button is being created on line 284 of pypilot_pi/src/pypilotDialog.cpp.

  AddButton(-angles[negind], m_fgControlAnglesNeg);

If I change to:
  AddButton(-10, m_fgControlAnglesNeg);
The 3 negative boxes change to 429496.
Tried a few negative numbers and got the same.

If I change to:
  AddButton( 10, m_fgControlAnglesNeg);
The 3 negative boxes come up as 10 as I expected.

Suspecting AddButton.

Running windows is not an option for me.

John

(08-17-2019, 07:17 PM)johnm Wrote:
(08-06-2019, 04:06 AM)sideluxe Wrote:
Quote:Next problem is in opencpn plugin the 3 port controls all read 429496 and do not work properly. The 3 starboard 1, 10, 110 work properly.

In Standby the buttons turned in the wrong direction.
In AP active mode direction is correct.
probably old version of plugin


Hi Sean, 

i dont think its the version, i have the same error when using the latest avaiable plugin on my ubuntu 16.04 laptop. 
The windows version og the plugin works right.

I only use the plugin to open the calibrate settings, which other way round does not work within the windows plugin, so i did not start to dig for the error source.

Ahoi!

Good to hear someone can confirm this.
I'm taking a stab at fixing it  but it's going slow.
25 years ago was pretty good programmer but even then had minimal c++ experience.

I assume that the button is being created on line 284 of pypilot_pi/src/pypilotDialog.cpp.

  AddButton(-angles[negind], m_fgControlAnglesNeg);

If I change to:
  AddButton(-10, m_fgControlAnglesNeg);
The 3 negative boxes change to 429496.
Tried a few negative numbers and got the same.

If I change to:
  AddButton( 10, m_fgControlAnglesNeg);
The 3 negative boxes come up as 10 as I expected.

Suspecting AddButton.

Running windows is not an option for me.

John

Think I may have got it.

In AddButton changed %ld to %i.
Now angles buttons all display properly :-)
Not boat tested and may break 32 bit version.




void pypilotDialog::AddButton(int angle, wxSizer *sizer)
{
    if(m_sAPMode.Contains("wind"))
        angle = -angle;

/*    wxButton *button = new wxButton( this, wxID_ANY, wxString::Format("%ld", angle)); */
    wxButton *button = new wxButton( this, wxID_ANY, wxString::Format("%i", angle));
    button->Connect( wxEVT_COMMAND_BUTTON_CLICKED,
                     wxCommandEventHandler( pypilotDialog::OnControlAngle ), NULL, this );
    button->SetMaxSize(wxSize(60, -1));
    sizer->Add( button, 0, wxALL, 5 );
}
  Reply
#6
Thanks! I think format is different in windows.

I will update and test this.
  Reply
#7
This has been a puzzling bug for me too on my Ubuntu 18.4 64-bit laptop, which is my cruising mainstay below decks. Both it and and the RPi-3B+ (running on OpenPlotter, latest) are set up with OpenCPN 5.0.0, and both have the updated pypilot plugin 0.9 . However, the "429496" error only shows up on the Ubuntu laptop. The buttons have always worked correctly on the OpenPlotter Rasberry pi system.

I made the above-described code change on the Ubuntu laptop in /usr/local/include/pypilot_pi/src/PypilotDialog.cpp.

Then I restarted OpenCPN, but didn't realize I'd need to rebuild the plug-in, so no-go.

After rebuilding the plug-in, the bug is gone on the opencpn pypilot plug-in running on the Ubuntu 18.4 x64 laptop.

Many thanks for fixing this bug!!
  Reply
#8
(08-05-2019, 05:01 PM)iseandepagnier Wrote:
(08-04-2019, 07:21 PM)johnm Wrote: Finally did a real test of tinypilot.
Used opencpn 5.0.0 bionic packages on debian buster 64 bit.
pypilot plugin 0.5.0

Set gains to recommended initial settings.
Initially sort of worked, but gains clearly too low as it was OK being as much as 10 degrees off course.

Often mechanical wind vanes steer +- 10 degrees, so this may be considered acceptable if the sails are full and the power consumption minimal.

You can increase the gains to make it work harder to some extent, but eventually you will need a faster motor to get better performance.


You can also change servo.gain which is effectively an overall gain. It defaults to 1, so changing to 2 or 3 will get much more response.
This is with autohelm 3000 wheel drive.
Timed and it takes  23 sec for full swing which is probably  45 degrees each way.
The autohelm controller does pretty well even in moderately heavy seas  but I try to keep helm balanced.
I'll probably get a better drive at some point.

Do you recommend I raise the servo.gain  first?
Where is that setting?



Been going over the code and it's slowly making some sense to me.
Probably should read up on object oriented programming in python.

One thing I noticed is your using only gps speed.
Any possibility of adding option for water speed for those that have an instrument?
It should be better for predicting rudder response.
  Reply
#9
(09-05-2019, 09:46 PM)johnm Wrote: This is with autohelm 3000 wheel drive.
FWIW I'm also intending my pypilot build to replace an autohelm 3000 wheel drive.  I'll reuse the motor and helm drive.
  Reply
#10
As to the servo.gain setting...
I still can not find it in any of the configuration apps.
Searched through the source and see it once but do not see where it's set.

See servo.gain in the config file and edited with vi after saving the original.
set to 2.
Hope to be able to test this afternoon.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)