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
Pypilot and a RC boat
#1
Hello,

We have build an RC boat with a raspberry pi 3B+ with openplotter. We are using an RC controller now but we want to be able to sail to a waypoint we have inserted in opencpn. So we want to try Pypilot to navigate our boat to the waypoint.
Setup:
We have a globalsat bu353 S4 and an MPU 9250 imu.  
Raspberry pi model 3B+ with openplotter v2 headless and OenCPN 5.0.0
We use a regular brushless DC motor with an esc for moving forward and a little pwm servo for moving the rudder.
Open CPN works fine we can see the GPS location of the boat. 
The motor.ino sketch is working on the arduino and the arduino is connected to the raspberry by serial and it is communicating.
We can choose in Pypilot between the compass and the gps. 

The Pypilot gives the following information:
SignalK Server: Connected
Servo Flags: DRIVER_TIMEOUT
Autopilot Errors: no motor controller!


Only thing we are missing is to make the motor and the servo working with Pypilot.

So we like to know if it is possible to use Pypilot with a small pwm servo like the SG90 or a H-king HK15338 to move the rudder.
And how can we connect the servo and the motor?

I hope somebody can help us Smile

Regards
Reply
#2
(2020-04-08, 02:29 PM)DvdB Wrote: Hello,

We have build an RC boat with a raspberry pi 3B+ with openplotter. We are using an RC controller now but we want to be able to sail to a waypoint we have inserted in opencpn. So we want to try Pypilot to navigate our boat to the waypoint.
Setup:
We have a globalsat bu353 S4 and an MPU 9250 imu.  
Raspberry pi model 3B+ with openplotter v2 headless and OenCPN 5.0.0
We use a regular brushless DC motor with an esc for moving forward and a little pwm servo for moving the rudder.
Open CPN works fine we can see the GPS location of the boat. 
The motor.ino sketch is working on the arduino and the arduino is connected to the raspberry by serial and it is communicating.
We can choose in Pypilot between the compass and the gps. 

The Pypilot gives the following information:
SignalK Server: Connected
Servo Flags: DRIVER_TIMEOUT
Autopilot Errors: no motor controller!


Only thing we are missing is to make the motor and the servo working with Pypilot.

So we like to know if it is possible to use Pypilot with a small pwm servo like the SG90 or a H-king HK15338 to move the rudder.
And how can we connect the servo and the motor?

I hope somebody can help us Smile

Regards

Hi,
maybe this helps
http://forum.openmarine.net/showthread.p...228&page=3
save sailing
Andreas
Reply
#3
(2020-04-08, 02:29 PM)DvdB Wrote: The motor.ino sketch is working on the arduino and the arduino is connected to the raspberry by serial and it is communicating.
We can choose in Pypilot between the compass and the gps. 

The Pypilot gives the following information:
SignalK Server: Connected
Servo Flags: DRIVER_TIMEOUT
Autopilot Errors: no motor controller!

Just to clarify: you say 'and it is communicating' but if you get NO MOTOR CONTROLLER it probably is not. Just check the lights on the Arduino: if Rx is blinking and Tx is not, it is not communicating and you might solve this by setting DIV_BOARD in motor.ino to 1.

You should connect the rudder servo pwm input to the D9 output on the arduino, and make sure D6 is high, thereby selecting RC style. In the motor.ino code this mode is referred to as pwm_style=1. You might want to check https://www.youtube.com/watch?v=kpq53e97...tu.be&t=81

As for the propulsion motor, there is no standard provision for that. PyPilot is primarily for steering.

Groeten,

-
Reply
#4
Sorry about div_board. Hopefully the next code will autodetect the crystal frequency.
Reply
#5
Thank you all for the replies. I have tried some things and did some research and now I want to give an update. Some things are solved but I have some new problems too. 

I have checked the lights and RX was blinking and TX was not. So it wasn't communicating but this problem is solved now by setting DIV_BOARD in motor.ino to 1

The digital pin D6 should be high to activate RC style (pwm_style=1). So I have connected D6 to the 5V. Maybe this is not ok?
I have connected the pwm input from the servo to D9.
It looks like pypilot only reacts on the movement of the compass, because if I turn the compass the servo receives a pulse and the servo reacts with a short movement to the left or right and goes back to the middle position. 
The signal does not look the same as the signal like in the video from ironman. I have only short pulses of +1 and -1 (saw that in the scope). So it looks like PWM style is not activated. 
How can I make sure that the RC PWM is activated? 

Other problem:
In compass mode it says sync, in GPS mode it says no connection. (There is an error in signal k if I put the gps mode on or activate a route in opencpn: connect ECONNREFUSED 127.0.0.1:20220) Pypilot switches automatically back to compass mode and the signal k connection reconnects after a few seconds.

I have the localhost 10.10.10.1 connection in opencpn and a localhost 20220 connection with “output on this port (as autopilot or NMEA repeater)” checked.
In signal k I have two connections: the GPS as a serial connection inputtype NMEA0183 and TCP Client localhost 20220 inputtype NMEA0183

Last problem I get the message port_fault after the servo has moved in compass mode. But maybe this problem has something to do with the PWM mode.

I hope we can get some help again.
Thank you in advance.

Regards,
Reply
#6
(2020-04-24, 12:25 PM)DvdB Wrote: Thank you all for the replies. I have tried some things and did some research and now I want to give an update. Some things are solved but I have some new problems too. 

I have checked the lights and RX was blinking and TX was not. So it wasn't communicating but this problem is solved now by setting DIV_BOARD in motor.ino to 1

The digital pin D6 should be high to activate RC style (pwm_style=1). So I have connected D6 to the 5V. Maybe this is not ok?
I have connected the pwm input from the servo to D9.
It looks like pypilot only reacts on the movement of the compass, because if I turn the compass the servo receives a pulse and the servo reacts with a short movement to the left or right and goes back to the middle position. 
The signal does not look the same as the signal like in the video from ironman. I have only short pulses of +1 and -1 (saw that in the scope). So it looks like PWM style is not activated. 
How can I make sure that the RC PWM is activated? 
If you want rc style pwm you can make sure pin 6 is not grounded or attached to anything.   It has an internal pullup so connecting to 5v is not needed.

Quote:Other problem:
In compass mode it says sync, in GPS mode it says no connection. (There is an error in signal k if I put the gps mode on or activate a route in opencpn: connect ECONNREFUSED 127.0.0.1:20220) Pypilot switches automatically back to compass mode and the signal k connection reconnects after a few seconds.
A regular RC servo is not intended. Usually the pwm signal goes to an ESC and this drives a motor to move the rudder. The RC servo works on absolute position which has never been used by pypilot. Either, make the servo continuous and greatly limit it's speed. You could then wire the potentiometer from the servo to the A4 rudder feedback pin on the nano.

Even better would be to modify the source code to command the servo in position rather than speed. This would give you the best results most likely. It wouldn't be difficult to implement and would need the user to set this option. The absolute pilot already commands absolute rudder angles and requires rudder feedback.


It seems like pypilot is crashing but I am not sure.   Could you get the output of pypilot when you change to gps mode?
Quote:I have the localhost 10.10.10.1 connection in opencpn and a localhost 20220 connection with “output on this port (as autopilot or NMEA repeater)” checked.
In signal k I have two connections: the GPS as a serial connection inputtype NMEA0183 and TCP Client localhost 20220 inputtype NMEA0183

Last problem I get the message port_fault after the servo has moved in compass mode. But maybe this problem has something to do with the PWM mode.

I hope we can get some help again.
Thank you in advance.

Regards,

The port fault indicates that you reached overcurrent.   You should set the current limit maximum higher if this occurs during normal use.

I will rename PORT_FAULT to PORT_OVERCURRENT_FAULT and maybe it's a better hint.
Reply
#7
(2020-04-24, 06:45 PM)seandepagnier Wrote:
(2020-04-24, 12:25 PM)DvdB Wrote: Thank you all for the replies. I have tried some things and did some research and now I want to give an update. Some things are solved but I have some new problems too. 

I have checked the lights and RX was blinking and TX was not. So it wasn't communicating but this problem is solved now by setting DIV_BOARD in motor.ino to 1

The digital pin D6 should be high to activate RC style (pwm_style=1). So I have connected D6 to the 5V. Maybe this is not ok?
I have connected the pwm input from the servo to D9.
It looks like pypilot only reacts on the movement of the compass, because if I turn the compass the servo receives a pulse and the servo reacts with a short movement to the left or right and goes back to the middle position. 
The signal does not look the same as the signal like in the video from ironman. I have only short pulses of +1 and -1 (saw that in the scope). So it looks like PWM style is not activated. 
How can I make sure that the RC PWM is activated? 
If you want rc style pwm you can make sure pin 6 is not grounded or attached to anything.   It has an internal pullup so connecting to 5v is not needed.

Quote:Other problem:
In compass mode it says sync, in GPS mode it says no connection. (There is an error in signal k if I put the gps mode on or activate a route in opencpn: connect ECONNREFUSED 127.0.0.1:20220) Pypilot switches automatically back to compass mode and the signal k connection reconnects after a few seconds.
A regular RC servo  is not intended.   Usually the pwm signal goes to an ESC and this drives a motor to move the rudder.   The RC servo works on absolute position which has never been used by pypilot.   Either, make the servo continuous and greatly limit it's speed.  You could then wire the potentiometer from the servo to the A4 rudder feedback pin on the nano.

Even better would be to modify the source code to command the servo in position rather than speed.    This would give you the best results most likely.   It wouldn't be difficult to implement and would need the user to set this option.   The absolute pilot already commands absolute rudder angles and requires rudder feedback.


It seems like pypilot is crashing but I am not sure.   Could you get the output of pypilot when you change to gps mode?
Quote:I have the localhost 10.10.10.1 connection in opencpn and a localhost 20220 connection with “output on this port (as autopilot or NMEA repeater)” checked.
In signal k I have two connections: the GPS as a serial connection inputtype NMEA0183 and TCP Client localhost 20220 inputtype NMEA0183

Last problem I get the message port_fault after the servo has moved in compass mode. But maybe this problem has something to do with the PWM mode.

I hope we can get some help again.
Thank you in advance.

Regards,

The port fault indicates that you reached overcurrent.   You should set the current limit maximum higher if this occurs during normal use.

I will rename PORT_FAULT to PORT_OVERCURRENT_FAULT and maybe it's a better hint.

Tank you for the help,

The port_fault error is solved with setting a higher current limit. 
It looks like the servo is working now. If I use the buttons in the pypilot plugin the servo goes to the left and with the other button to the right.

What do you exactly mean with "Could you get the output of pypilot when you change to gps mode?"

I have information from signal k when i tried to switch to gps mode:

Apr 27 13:41:15 GET /webapps 304 278.239 ms - -
Apr 27 13:41:15 GET /signalk 304 20.524 ms - -
Apr 27 13:41:15 GET /admin/fonts/Simple-Line-Icons.0cb0b9c589c0624c9c78dd3d83e946f6.woff2 304 20.395 ms - -
Apr 27 13:41:15 GET /security/access/requests 304 8.676 ms - -
Apr 27 13:41:15 GET /admin/fonts/signal-k-logo-image-text.9fcbd4af20a13fb46f0c2ac6ef87b911.svg 304 26.857 ms - -
Apr 27 13:41:16 GET /admin/fonts/fa-solid-900.55eb2a60e8181f0e68b558c991973bf0.woff2 304 5.578 ms - -
Apr 27 13:41:16 GET /appstore/available 200 1927.204 ms - -
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:35 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:35 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:36 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:37 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:43:25 GET /loginStatus 200 20.688 ms - 201
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:41 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:50 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:51 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:52 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:54 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:03 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:03 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:04 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:05 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:07 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:11 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:28 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:29 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:30 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:32 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:48 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:51 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:26 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:28 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:26 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:29 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:12:59 PUT /runDiscovery 200 32.365 ms - 17
Apr 27 14:12:59 GET /providers 304 19.125 ms - -
Apr 27 14:12:59 GET /skServer/hasAnalyzer 304 77.164 ms - -
Apr 27 14:13:33 "PortInfo.comName" has been deprecated. You should now use "PortInfo.path". The property will be removed in the next major release.
Apr 27 14:13:33 GET /serialports 304 656.018 ms - -
Apr 27 14:14:08 PUT /providers/Pypilot%20NMEA%200183 200 28.565 ms - 16
Apr 27 14:14:08 PUT /runDiscovery 200 20.165 ms - 17
Apr 27 14:14:08 GET /providers 200 15.112 ms - 464
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:55 GET /logfiles/ 200 13.081 ms - 2
Apr 27 14:15:37 GET /logfiles/ 304 7.492 ms - -

Regards,
Reply
#8
(2020-04-27, 01:52 PM)DvdB Wrote:
(2020-04-24, 06:45 PM)seandepagnier Wrote:
(2020-04-24, 12:25 PM)DvdB Wrote: Thank you all for the replies. I have tried some things and did some research and now I want to give an update. Some things are solved but I have some new problems too. 

I have checked the lights and RX was blinking and TX was not. So it wasn't communicating but this problem is solved now by setting DIV_BOARD in motor.ino to 1

The digital pin D6 should be high to activate RC style (pwm_style=1). So I have connected D6 to the 5V. Maybe this is not ok?
I have connected the pwm input from the servo to D9.
It looks like pypilot only reacts on the movement of the compass, because if I turn the compass the servo receives a pulse and the servo reacts with a short movement to the left or right and goes back to the middle position. 
The signal does not look the same as the signal like in the video from ironman. I have only short pulses of +1 and -1 (saw that in the scope). So it looks like PWM style is not activated. 
How can I make sure that the RC PWM is activated? 
If you want rc style pwm you can make sure pin 6 is not grounded or attached to anything.   It has an internal pullup so connecting to 5v is not needed.

Quote:Other problem:
In compass mode it says sync, in GPS mode it says no connection. (There is an error in signal k if I put the gps mode on or activate a route in opencpn: connect ECONNREFUSED 127.0.0.1:20220) Pypilot switches automatically back to compass mode and the signal k connection reconnects after a few seconds.
A regular RC servo  is not intended.   Usually the pwm signal goes to an ESC and this drives a motor to move the rudder.   The RC servo works on absolute position which has never been used by pypilot.   Either, make the servo continuous and greatly limit it's speed.  You could then wire the potentiometer from the servo to the A4 rudder feedback pin on the nano.

Even better would be to modify the source code to command the servo in position rather than speed.    This would give you the best results most likely.   It wouldn't be difficult to implement and would need the user to set this option.   The absolute pilot already commands absolute rudder angles and requires rudder feedback.


It seems like pypilot is crashing but I am not sure.   Could you get the output of pypilot when you change to gps mode?
Quote:I have the localhost 10.10.10.1 connection in opencpn and a localhost 20220 connection with “output on this port (as autopilot or NMEA repeater)” checked.
In signal k I have two connections: the GPS as a serial connection inputtype NMEA0183 and TCP Client localhost 20220 inputtype NMEA0183

Last problem I get the message port_fault after the servo has moved in compass mode. But maybe this problem has something to do with the PWM mode.

I hope we can get some help again.
Thank you in advance.

Regards,

The port fault indicates that you reached overcurrent.   You should set the current limit maximum higher if this occurs during normal use.

I will rename PORT_FAULT to PORT_OVERCURRENT_FAULT and maybe it's a better hint.

Tank you for the help,

The port_fault error is solved with setting a higher current limit. 
It looks like the servo is working now. If I use the buttons in the pypilot plugin the servo goes to the left and with the other button to the right.

What do you exactly mean with "Could you get the output of pypilot when you change to gps mode?"

I have information from signal k when i tried to switch to gps mode:

Apr 27 13:41:15 GET /webapps 304 278.239 ms - -
Apr 27 13:41:15 GET /signalk 304 20.524 ms - -
Apr 27 13:41:15 GET /admin/fonts/Simple-Line-Icons.0cb0b9c589c0624c9c78dd3d83e946f6.woff2 304 20.395 ms - -
Apr 27 13:41:15 GET /security/access/requests 304 8.676 ms - -
Apr 27 13:41:15 GET /admin/fonts/signal-k-logo-image-text.9fcbd4af20a13fb46f0c2ac6ef87b911.svg 304 26.857 ms - -
Apr 27 13:41:16 GET /admin/fonts/fa-solid-900.55eb2a60e8181f0e68b558c991973bf0.woff2 304 5.578 ms - -
Apr 27 13:41:16 GET /appstore/available 200 1927.204 ms - -
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:35 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:35 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:36 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:37 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:43:25 GET /loginStatus 200 20.688 ms - 201
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:41 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:50 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:51 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:52 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:54 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:03 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:03 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:04 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:05 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:07 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:11 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:28 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:29 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:30 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:32 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:48 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:51 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:26 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:28 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:26 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:29 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:12:59 PUT /runDiscovery 200 32.365 ms - 17
Apr 27 14:12:59 GET /providers 304 19.125 ms - -
Apr 27 14:12:59 GET /skServer/hasAnalyzer 304 77.164 ms - -
Apr 27 14:13:33 "PortInfo.comName" has been deprecated. You should now use "PortInfo.path". The property will be removed in the next major release.
Apr 27 14:13:33 GET /serialports 304 656.018 ms - -
Apr 27 14:14:08 PUT /providers/Pypilot%20NMEA%200183 200 28.565 ms - 16
Apr 27 14:14:08 PUT /runDiscovery 200 20.165 ms - 17
Apr 27 14:14:08 GET /providers 200 15.112 ms - 464
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:55 GET /logfiles/ 200 13.081 ms - 2
Apr 27 14:15:37 GET /logfiles/ 304 7.492 ms - -

Regards,

Hi all,

I have the project to steer my 12 tons ketch using a small RC servo. The idea is to replace the windvane of my servo pendulum windvane (ATOMS) by a regular RC-servo (similar idea than in this post : https://forum.openmarine.net/showthread....t=Pendulum). DvdB did you manage to get a regular servo working from pypilot ? If yes would you share your code?

Thanks,
Reply
#9
(2020-10-21, 06:12 PM)jonflye Wrote:
(2020-04-27, 01:52 PM)DvdB Wrote:
(2020-04-24, 06:45 PM)seandepagnier Wrote:
(2020-04-24, 12:25 PM)DvdB Wrote: Thank you all for the replies. I have tried some things and did some research and now I want to give an update. Some things are solved but I have some new problems too. 

I have checked the lights and RX was blinking and TX was not. So it wasn't communicating but this problem is solved now by setting DIV_BOARD in motor.ino to 1

The digital pin D6 should be high to activate RC style (pwm_style=1). So I have connected D6 to the 5V. Maybe this is not ok?
I have connected the pwm input from the servo to D9.
It looks like pypilot only reacts on the movement of the compass, because if I turn the compass the servo receives a pulse and the servo reacts with a short movement to the left or right and goes back to the middle position. 
The signal does not look the same as the signal like in the video from ironman. I have only short pulses of +1 and -1 (saw that in the scope). So it looks like PWM style is not activated. 
How can I make sure that the RC PWM is activated? 
If you want rc style pwm you can make sure pin 6 is not grounded or attached to anything.   It has an internal pullup so connecting to 5v is not needed.

Quote:Other problem:
In compass mode it says sync, in GPS mode it says no connection. (There is an error in signal k if I put the gps mode on or activate a route in opencpn: connect ECONNREFUSED 127.0.0.1:20220) Pypilot switches automatically back to compass mode and the signal k connection reconnects after a few seconds.
A regular RC servo  is not intended.   Usually the pwm signal goes to an ESC and this drives a motor to move the rudder.   The RC servo works on absolute position which has never been used by pypilot.   Either, make the servo continuous and greatly limit it's speed.  You could then wire the potentiometer from the servo to the A4 rudder feedback pin on the nano.

Even better would be to modify the source code to command the servo in position rather than speed.    This would give you the best results most likely.   It wouldn't be difficult to implement and would need the user to set this option.   The absolute pilot already commands absolute rudder angles and requires rudder feedback.


It seems like pypilot is crashing but I am not sure.   Could you get the output of pypilot when you change to gps mode?
Quote:I have the localhost 10.10.10.1 connection in opencpn and a localhost 20220 connection with “output on this port (as autopilot or NMEA repeater)” checked.
In signal k I have two connections: the GPS as a serial connection inputtype NMEA0183 and TCP Client localhost 20220 inputtype NMEA0183

Last problem I get the message port_fault after the servo has moved in compass mode. But maybe this problem has something to do with the PWM mode.

I hope we can get some help again.
Thank you in advance.

Regards,

The port fault indicates that you reached overcurrent.   You should set the current limit maximum higher if this occurs during normal use.

I will rename PORT_FAULT to PORT_OVERCURRENT_FAULT and maybe it's a better hint.

Tank you for the help,

The port_fault error is solved with setting a higher current limit. 
It looks like the servo is working now. If I use the buttons in the pypilot plugin the servo goes to the left and with the other button to the right.

What do you exactly mean with "Could you get the output of pypilot when you change to gps mode?"

I have information from signal k when i tried to switch to gps mode:

Apr 27 13:41:15 GET /webapps 304 278.239 ms - -
Apr 27 13:41:15 GET /signalk 304 20.524 ms - -
Apr 27 13:41:15 GET /admin/fonts/Simple-Line-Icons.0cb0b9c589c0624c9c78dd3d83e946f6.woff2 304 20.395 ms - -
Apr 27 13:41:15 GET /security/access/requests 304 8.676 ms - -
Apr 27 13:41:15 GET /admin/fonts/signal-k-logo-image-text.9fcbd4af20a13fb46f0c2ac6ef87b911.svg 304 26.857 ms - -
Apr 27 13:41:16 GET /admin/fonts/fa-solid-900.55eb2a60e8181f0e68b558c991973bf0.woff2 304 5.578 ms - -
Apr 27 13:41:16 GET /appstore/available 200 1927.204 ms - -
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:34 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:35 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:35 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:36 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:37 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:41:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:43:25 GET /loginStatus 200 20.688 ms - 201
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:44:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:39 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:40 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:41 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:45:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:50 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:51 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:52 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:50:54 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:02 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:03 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:03 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:04 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:05 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:07 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:51:11 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:28 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:29 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:30 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 13:55:32 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:46 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:48 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:49 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:00:51 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:23 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:26 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:01:28 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:24 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:25 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:26 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:27 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:11:29 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:12:59 PUT /runDiscovery 200 32.365 ms - 17
Apr 27 14:12:59 GET /providers 304 19.125 ms - -
Apr 27 14:12:59 GET /skServer/hasAnalyzer 304 77.164 ms - -
Apr 27 14:13:33 "PortInfo.comName" has been deprecated. You should now use "PortInfo.path". The property will be removed in the next major release.
Apr 27 14:13:33 GET /serialports 304 656.018 ms - -
Apr 27 14:14:08 PUT /providers/Pypilot%20NMEA%200183 200 28.565 ms - 16
Apr 27 14:14:08 PUT /runDiscovery 200 20.165 ms - 17
Apr 27 14:14:08 GET /providers 200 15.112 ms - 464
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:42 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:43 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:44 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:45 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:47 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Apr 27 14:14:55 GET /logfiles/ 200 13.081 ms - 2
Apr 27 14:15:37 GET /logfiles/ 304 7.492 ms - -

Regards,

Hi all,

I have the project to steer my 12 tons ketch using a small RC servo. The idea is to replace the windvane of my servo pendulum windvane (ATOMS) by a regular RC-servo (similar idea than in this post : https://forum.openmarine.net/showthread....t=Pendulum). DvdB did you manage to get a regular servo working from pypilot ? If yes would you share your code?

Thanks,
Hello,

I didn't manage to make it working in automatic mode. Only in manual mode. In the manual mode, the servo works fine but in automatic mode (in this mode it should sail from waypoint to waypoint), the servo is going from left to right and back and eventully it stays in a random position all the way left or all the way right. I don't know what is causing the problem, it looks like it don't know where the front of the boat is going. So it could be a problem with the IMU compass. 

regards,
Reply
#10
For RC use, maybe ArduPilot is a better choice ?
It can control a RC boat in Rover mode.

https://ardupilot.org/rover/docs/boat-co...ation.html
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)