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 on OpenPlotter with dAISy hat
#1
   
(2019-06-16, 11:09 PM)skyeyedoc Wrote: So, I'm hoping this will work:

I've just mounted an InvenSense IMU-9255 in an RPi-3B+ box, on the pass-thru i2c pins of its dAISy ais receiver hat. (see photo)

The pi is running latest OpenPlotter, and has the on-board wifi configured as an access point. There's a second wifi device running on a usb dongle to provide WAN access. There's a gps puck on usb.

I run the box headless controlling it with VNC in my linux laptop, and have succeeded in getting gps and ais data to OpenCPN running on that laptop over the wifi link. If I plot a course on the laptop, and activate it, I succeed in transmitting via wifi course deviation sentences back to kplex on the RPi. I've also configured NMEA output through an RS422 usb dongle which I hardwire to the vhf marine radio to provide that with gps sentences. (A Standard Horizon with a panic button, but no gps of its own)

I've succeeded in calibrating the IMU within PyPilot, and have proven that its compass and gyro/inertial sensors are working, but I don't know if the compass will be affected by the greater field transients the 3B+ may have, being a pretty busy little box.

So far, all good!

What I'd like to figure out, if practical, is to build a wifi-enabled motor-controller to which I can send pypilot serial output wirelessly.

I thought maybe a Pi Zero W married to a motor-controller board could be made to work? Or is there a wifi-enabled arduino that would work better?

I'm also wondering if those OpenCPN-generated gps course-correction, x-track error sentences would be useful if utilized somehow in PyPilot. Or does Sean's program run entirely from wind, compass, and inertial inputs alone, without reference to gps?

I'm mindful that the complexities of my approach has its downsides: many eggs in one basket, and wireless data flow might be more fragile than hardwired. Even so, I'd like to figure a way, and try it out.

There's many questions this post is asking, and there's more to come, I'm sure. I'd really enjoy any comments or suggestions: whatever comes to mind, and whatever others have already tried. Thanks for reading this far!
Reply
#2
I too have considered wireless extension of the serial line. Because I have experience with the ESP8266 it is my first thought. I have two broadcasting GPS and AIS over wifi to my boats router that seem reliable. I also have two more sending MQTT to a nodered server through the boats router, they are not as reliable. My battery monitor reboots every few hours and I haven't had time to figure out why. The fridge monitor deepsleeps for 15 minutes between readings and seems ok.

LoRa may be less power hungry. I've read some about it but not actually played with it.

A Pi Zero W might be ok if you use something like the tinycore linux to run entirely out of RAM, otherwise you might get variable delays and unpredictable latency.

Reliability is very important in an autopilot, depending on where and how you sail. Latency between the pypilot and the motor controller is also a concern. Especially in adverse conditions.

If pypilot see a GPS, it offers waypoint/track steering called GPS mode, so it says. I haven't got that far myself yet.

Since you are using the RPi headless, did you consider the TinyPilot installed near the motor and control accessed the same, VNC or such?

--
Larry s/v Katie Lee Passport 45 Ketch somewhere in Japan
--
Larry - s/v Katie Lee Passport 45 Ketch (For Sale) - somewhere in Taiwan
Reply
#3
(2019-06-16, 11:39 PM)svkatielee Wrote: I too have considered wireless extension of the serial line. Because I have experience with the ESP8266 it is my first thought. I have two broadcasting GPS and AIS over wifi to my boats router that seem reliable. I also have two more sending MQTT to a nodered server through the boats router, they are not as reliable. My battery monitor reboots every few hours and I haven't had time to figure out why. The fridge monitor deepsleeps for 15 minutes between readings and seems ok.

LoRa may be less power hungry. I've read some about it but not actually played with it.

A Pi Zero W might be ok if you use something like the tinycore linux to run entirely out of RAM, otherwise you might get variable delays and unpredictable latency.

Reliability is very important in an autopilot, depending on where and how you sail. Latency between the pypilot and the motor controller is also a concern. Especially in adverse conditions.

If pypilot see a GPS, it offers waypoint/track steering called GPS mode, so it says. I haven't got that far myself yet.

Since you are using the RPi headless, did you consider the TinyPilot installed near the motor and control accessed the same, VNC or such?

--
Larry  s/v Katie Lee Passport 45 Ketch somewhere in Japan
Hi, Larry,
Wow, there is so much helpful thought here to unpack. Thanks for taking the time.

I'm impressed by what you're describing with the ESP8266 devices. That's a new one for me. Are they sending only, or bidirectional? You imply that they are a bit power hungry? I'm guessing they are configured like a wifi access point? I took a quick look at LoRa on wikipedia, but it gets deep fast.

I have thought about simply building or buying a TinyPilot and mounting it dry in the binnacle, at some remove from the motor-controller, of course. It's an electrically quiet area on my boat, as we only use handheld devices there, so they can retreat to below if things get wet. (we've a Tartan 37). I'm mindful of the advantages, as it runs from RAM, and being so simple.

I don't yet have a very clear mental picture of the building blocks that make the motor respond. Working backwards, there's the motor, which responds to 12v, needs maybe 4amps ambient/ maybe 30amps at cut-off, and reverses with dc polarity. It's fed from the motor-controller, which will be signaled by a low voltage/low amperage input around 3 to 5 vdc...  I'm not certain, but imagine that it, too, reverses polarity to command L or R instructions to the motor.

Now, between the PyPilot software, and the motor-controller 3 to 5 v. input signal, there is in my head a soft wind blowing, and the sound of slack, slapping sails...  I've studied Sean's helpful videos very closely, stopping and starting the video to try and parse the hardware in his motor-controller. But I'm still quite the noob in that area.

I don't yet understand the nature of the PyPilot's command data stream to the motor-controller,  and I really know almost nothing how arduinos are programed and used.

In Sean's motor-controller, I think I appreciate why he's got optical-isolation between the high current and low current circuit. I'm not sure my controller would require that, if I can signalling it through something simple and low-cost; something easy to swap out underway if it gets fried.

Egad, so much to think about. So much to learn.

(BTW, nice blog there, Larry. We're at blog.swiftpassage.com , but not active with it.)
Reply
#4
Hi Skyeyedoc,
The ESPs are one direction only. The AIS does not listen and I never upload to the GPS. That could change. The ESPs are written up on my blog, KB7KMO.blogspot.com, as NEMA_WiFi_bridge if you are interested. A couple of posts. WiFi does use more power than other radio types. They connect to a wifi access point as a client then do UDP broadcast of the data on configurable ports, default is 10110 and 10111.

The TinyPilot is the course computer. It talks to the motor controller over optically isolated serial lines for reliability. The motor controller is currently an H-bridge controlled by an Arduino. An Arduinos is a small slower cpu with easy I/O. It listens for Seans's custom commands that are mostly turn a direction and how fast to turn. They measure current, rudder position and end stops to avoid over driving the rudder. They report back current, temp, optionally rudder position. Speed is controlled with PWM. The arduino is more imune to the noise generated by the motor and control than the raspberry. Also the arduino is powered by the same source as the motor, so the optical isolation is a good thing.

An H-Bridge is basically an electrically controlled 'double pole double throw'(DPDT) switch wired to reverse the 2 wires. A good H-Bridge for higher current needs higher current parts (MOSFETs, diodes, transistors, etc) which are more expensive. Sean's price for the two sizes of motor controllers is pretty reasonable.

I'm also stuck with finding a place to mount the tinypilot also. I put the hydraulic motor in the engine room, and the high current controller on the opposite side of the engine room wall away from potential water spray but only a few inches from the motor. But the cockpit arrangement is a long way from it by the way of running wires.

With the required reliability of the auto pilot communication and the occasional glitches with radio stuff, I will stick with wires.
--
Larry - s/v Katie Lee Passport 45 Ketch (For Sale) - somewhere in Taiwan
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)