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
Some questions for pypilot
#1
Hi,

repost this from the OC-Forum.

For the wintertime and against the covid-19 blues I thinking about a pypilot projekt.

Some questions:

I now running a pi3b+ with Raspbian Buster and Opencpn 5.2

I can use the plugin for getting the "brain" right?

For the motorcontroller I´ll use an Arduino nano and a IBT-2 controller.
As actuator something like this: https://pcnautic.nl/nl/autopilot/pcn...erdrive-detail
There is a built in 10kohm potentiometer for getting a position feedback (like rudder angle)
Where in the arduinocode for the motorcontroller is this resistor (the rudder-angle resistor value) defined?
Do I have to adjust the value to my hardware setup?

Pypilot uses a IMU (gyro) for getting heading Infos. Can OpenCPN use this heading Infos, will pypilot send theese to OpenCPN? Is it possible to use the Headinginformation for eg Radaroverlay?

Thanks

Regards

Andreas
Reply
#2
1) above tiller works for me (including position feedback).
I guess the question about the motorcontroller and arduino are because you want to make them yourself. (I just bought them pre-build).

2) Either TinyPilot or OpenPlotter can be used to export the IMU data to OpenCPN (I use the tinypilot with signalk).
OpenPlotter can be installed on top of Buster.


3) I thought B&G / Navico / Simrad / Lowrance require 10Hz HDG on a specific NMEA network, but check the details form the supplier.
Should be possible with SignalK (untested, since I have no radar).

The only question I have about your hardware is whether the RPI3+ is fast enough for radar.
But if you already have an RPI3 installed I would worry about that later.
Reply
#3
To be clear, the opencpn pypilot plugin does not run the autopilot, it simply communicates with pypilot for control and configuration and integration purposes.

The rudder feedback resistor does not need a specific value because the signal is an analog voltage, not a resistance. So depending on the settings this will range from 0-5 volts or 0-1.1 volts. The arduino itself can only supply maybe few dozen milliamps, but it's better to not use too much. So a 5k-10k potentiometer is recommended, or a hall-effect sensor with analog output is even better because it won't wear out.
Reply
#4
Hi,

thanks for your answers.

Meantime I understand that the plugin is only for interacting with pypilot from OpenCPN this was not so clear for me Rolleyes

So, is it possible to run pypilot together with OpenCPN on the same pi?

Will pypilot share the heading Information collected via the IMU with opencpn?
In the moment I use an Arduino based comapss (with an IMU) to feed OpenCPN with heading Information.
So when using pypilot it will a nice effect to use the heading Infos collected by pypilot and not to use a second heading source.

On the other side:
Now oc ge´t all interesting navigational Information as nmea-0183 stream via usb into the pi.
Is it possible to share theese with the pypilot eg the windinformation so that the pypilot can drive into windmode?


@hreuver: I use the pi3b+ with Raspbian buster and with opencpn 5.2 and in the past Scratch with OC 4.x and 5.0
I have a Navico 3g (Simrad) Broadbandradarscanner connected via the RI10box to the Ethernet from the pi.
Radarplugin latest Version.
Works.
Radaroverlay or just ppi is fast enough. I use the oesenc Charts.

Regards

Andreas
Reply
#5
I use a NMEA wind sensor which is connected to the SignalK node server on the computer running OpenCPN.
Tinypilot works on a Pi-Zero and exchanges wind data and heading via NMEA or SignalK. The TC runs the core PyPilot.


For OpenPlotter it should be even more easy since SignalK and PyPilot (the core system, not the plugin) are running on the same machine.

Playing with OpenPlotter I was able to install the OpenPlotter packages on top of Ubuntu (so it should work with Buster as well).
I used OpenPlotter-PyPilot for compass-only (heading) with an IMU.
Setting it to AutoPilot should activate the PyPilot Core with the steering abilities (which can be controlled from the PyPilot_Pi, the plugin, or a simple Web Interface).
Configuration can be handled by either OpenPlotter-Pypilot and/or PyPilot_Pi.

That said, I find the configuration with a seperate pi-zero very confinient and very stable.
I have never used OpenPlotter as AutoPilot.


Just for the terminology:
- PyPilot - the core scripts to connect with the IMU and the MotorController
- PyPilot_Pi - the control plugin for OpenCPN to connect with the core scripts
- TinyPilot - a tinycore linux OS which runs the PyPilot core on a Pi Zero (or similar) and connects to the IMU.
- OpenPlotter - a raspbian OS which runs OpenCPN, SignalK and the PyPilot core (+IMU) on a RPI3 or RPI4.
- MotorController - the system to actually steer the tiller, mostly based on Arduino. It handles some simple sensors (temperature, rudder position and end switches).
- OpenPlotter-Settings - the installer for the OpenCPN packages to get the pypilot working on your Buster system if you are not using the standard NOOBS or OpenPlotter package.
- OpenPlotter-PyPilot - the package which contains the PyPilot core for OpenPlotter (to be installed with the settings package).

The complete set of Pypilot scripts runs on the Tinypilot and MotorController or OpenPlotter and Motorcontroller.
Reply
#6
You can connect OpenCPN to pypilot directly using tcp port 20220 for nmea0183. This will give you the magnetic heading, pitch, hell and rudder feedback as well as any nmea serial ports that pypilot manages. If you output on this port to pypilot you can share data from opencpn such as wind, gps and autopilot route following messages.

The alternate is to connect OpenCPN to signalk. pypilot automatically connects to signalk server and the heading pitch heel and rudder feedback are sent to signalk so OpenCPN can access the data this way. This requires running a signalk server and also opencpn cannot send data to signalk yet.

It's true that pypilot is probably more stable on a pi zero with tinypilot, but it's supported on openplotter as well.
Reply
#7
Hi,

the last few days I played around with my raspberries and the images of tinypilot and the connection to my raspberry with opencpn.

In short: It seems to work.

I take the beta image (tinypilot_2020_10_11.img.xz) and bring it to work with a raspberry pi 2b (later I´ll use a raspberry zero w).
I take my raspberry 3b+ with opencpn 5.2.4 running on it and install there the pypilot plugin 0.22.xx from the setting menue in OC.

With both pis in my network:

I then set the connection in the plugin and in OC a TCP data connection.

The two pis communicate together, I get feedback from tinypilot in OC and back so I think this will work.

Now I´ll have to wait for the motorcontroller (I´ll try it with IBT_2) and an Arduino nano witch I ordered. Also the IMU is on the way.

Thank you Sean for the great work.

Some questions left:  

Control buttons (keypad): The GPIO-Pins declared in the webgui under configuration and then under the point: lcd keypad… are the actual ones?

I tried to connect a small tft (found in my grabbox) to the raspberry with tinypilot but I was unsuccessful.
It was a display using hardware spi  (I was totally wrong it was a 8 bit databus). 

So is it possible to connect a small tft display (witch type then? Witch driver IC?) and how to wire it with the raspberry pi?
Or do I need an Arduino switched between the raspberry and a display?
I just want to get some information about the status of the autopilot, no touch or so.

I think every display uses spi works?

Tackfunction:
Is it possible to use a keypad to tell the autopilot to tack to starboard or to port? I saw the "tack" knob but then there´s a fielt to tell the ap wich side to tack.
But when input only with a keypad how can I tell the ap witch side to tack? 
When using my old Raymarine ST2000 (tillerpilot) I press two of the function knobs together to tack to one side.

Thanks and regards

Andreas
Reply
#8
There are 4 possible displays for the lcd:

1) nokia5110 on spi
2) jlx12864 on spi
3) framebuffer (you can install many drivers for displays yourself, or use hdmi display)
4) glut (works in x windows graphical display mostly for debugging)

The tack button knows which way to tack if you have wind sensors, otherwise it has to guess depending on last tack. This could use some improvement, and there are also options to make "tack port" and "tack starboard" buttons. Eventually the single tack button could take a hint from starboard and port buttons to help it tack the correct way. Tacking is not very well testing on pypilot.
Reply
#9
jlx12864 on sp <—- does this require any changes to conf files or special drivers or will it work without modifications?
Reply
#10
it is detected by the hat's i2c eeprom. The next image you can edit the config file to specify it if there is no eeprom, but I just added that yesterday.
Reply


Forum Jump:


Users browsing this thread: hreuver, 1 Guest(s)