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
#11
(2020-10-22, 10:52 AM)DvdB Wrote:
(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,

Hello, what do you mean as manual mode ?
Did you thought about modifying the servo making it continuous ? ( see here for a tuto: https://learn.adafruit.com/modifying-ser...n/overview ) Then it should behave like a classical autopilot acuator ?

Regards
Reply
#12
if the servo is continuous it will work but the stall current may be too low for the motor controller to detect. So you still need rudder feedback or switches.
Reply
#13
(2020-10-22, 07:01 PM)seandepagnier Wrote: if the servo is continuous it will work but the stall current may be too low for the motor controller to detect.   So you still need rudder feedback or switches.

Hi Sean,
Tanks for the feedback and congratulation for the pypilot ! Earlier in the post you mentioned that modifying the code would allow to use a regular RC servo. Which code should be modified? the motor controller code (motor.ino) or the pypilot code ?

Thanks
Reply
#14
if you want to drive the servo directly from the pi, check servo.py. Otherwise it may work directly from motor.ino but pypilot will output relative movement and the servo will move to an absolute angle. This may be ok if you adjust the gains differently, but it's a different level of integration.
Reply
#15
(2020-10-23, 09:09 PM)seandepagnier Wrote: if you want to drive the servo directly from the pi, check servo.py.   Otherwise it may work directly from motor.ino but pypilot will output relative movement and the servo will move to an absolute angle.   This may be ok if you adjust the gains differently, but it's a different level of integration.
Hi,

I first tried the option of making the RC servo continuous. I checked my modification with a simple arduino sketch and am am able to comand it at a slow speed.
I then tried to reduce servo speed modifying parameters in pypilot.conf (servo connected to the arduino and using the servo's potentiometer as feedback). I was not able to reduce speed and the servo run at a speed such as it always overpasses configured the max rudder range. What are the parameters in pypilot.conf that allows to drastically reduce motor speed ?

I also noticed that reducing the servo speed (with my simple arduino sketch) also comes with a huge reduction of the torque. So i am not sure making the servo continuous is the best option.
I tried to explore the option of commanding the servo angle directly from pypilot. I checked servo.py and I have few questions : 
 - in the option of driving the sevo directly from the raspi? how to make such as RaspberryHWPWMServoDriver is called instead of to arduino motor driver.
- I guess using the absolute pilot combined with RaspberryHWPWMServoDriver would be the option to explore, right ? 

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)