ieb / sailinstruments

Signal K Sailing instruments
ISC License
16 stars 5 forks source link
signalk signalk-server

Retired Project

Please note, that I no longer maintain this project as the I found the power consumption of the hardware required to make it work was too high on a sailing boat. Mostly the display requirements. If I find a way to fix that, I will return to it and update it.

Sailing Instuments for SignalK

This plugin contains instruments for SignalK designed to run in a browser on a tablet or laptop. The instruments are specific to sailing rather than motoring and are aimed at helping the helm hit performance targets. The majority of stats are calculated in the application itself. Full instruments can be constructed using components, which self register with a stream of data. At the moment the instrument layout is hardcoded, but longer term the plan is to make it all browser configurable.

Polar Display Inverted

The outer magnetic heading rose is configured to be north up and has a ground wind direction (G) and a opposite tack (O) direction maker, the values of which are calcualted real time. The outer ring can also be head up. The inner ring is relative the boat also north up or head up, shown in north up mode. It points to the magnetic heading. The L marker marks leeway calculated internally. A is aparent wind angle and T is true wind angle. The small VMG marker is the target TWA to achieve maximum upwind or downwind VMG based on the polar performance of the boat. This is loaded from a polar file, in json form, currently set to a Pogo 1250. The lines going towards the center are TWA and AWA history. Around the outside various databoxes giving speeds, target speeds, polar performance etc. Going upwind the aim is to keep the T marker lined up with the VMG marker, which will give the boat maximum performance and acceleration as it exits a tack and brings AWA forwards.

All the instruments were SVG based, although this resulted in high CPU loads, so they are now HTML5 Canvas elements layered on top of each other to minimise the CPU load on the bowser and extend battery life as far as possible. With the wind instruments only a few lines are redrawn on each update.

In addition the layout and settings can be configured. These are currently saved to local storage so survive restarts. A Raw view is available to make changes to aspects that cant be changed in the UI.

Polar Display Normal

Polar Display Night

Data Inverted

Data Night

Sailing Instrument

Sailing Instrument

Sailing Instrument

Sailing Instrument

Todo list

Research Information for features.

Sail plan

Each sail needs to be represented as a surface on a TWS vs TWA area, could be optimised into cells with list of preferences. http://bl.ocks.org/bycoffe/5575904 d3js allowing drawing a polygons and performing point in polygon.

Route and Waypoint information - required for next leg planning.

PGN 130064 to 130074 129285 cover the transfer of waypoints and routes, however afaik no MFDs support transfer of waypoints or routes over NMEA2000. Most support transfer using GPX format on SDCards. PGN descriptions for that range are at https://www.nmea.org/content/nmea_standards/messages_pgns.asp and https://github.com/SignalK/n2k-signalk/issues/11

NMEA0183 WPL and RTE sentences deal with route and waypoint transfer.

Chromebooks have a SD card reader built in and some Tablets might also, upload of GPX might be viable.

Some MFDs might use standard protocols, eg SMB. LightHouseII is Linux on ARM with a Qt UI. ssh and sftp ports are open, GPX normally stored on the SD card, however no user logins available. PlotterSync is closed and proprietary to Navionics bundled as a native library inside the MDF and apps. Probably uses ssh or sftp so again, without a user account there is no way of using that.

Polars

Polars can be put in dist/polars/name.json where name identifies the model of boat. The format needs to be json the same as src/componsnts/calcs/polar/pogo1250.js (but as json). There is a TODO to allow loading of Polars from the SK schema, however that needs conversion to the internal format to work.

Current vectors.

Its simpler than first thought.
calculate the drift angle (hdt-cogt) convert sog/cogt to a vector relative to the boat (Math.cos(drift)sog, Math.sin(drift)sog) remove the stw vector (stw,0) give the current vector relative to the boat. find the angle with Math.atan2 and the speed with srt(sum of squares) then rotate back to true. Same can be a

Raymarine SeatalkNG

With a Ray iTC5, i70s, EV-100,ACU, MFD the Raymarine Can bus has the following. This application tries to derive its data from these settings so that it works without additional derived data in the server.

    environment.water.temperature
    navigation.magneticVariation
    steering.autopilot.state auto
    navigation.gnss.methodQuality GNSS Fix
    navigation.gnss.horizontalDilution
    navigation.gnss.type GPS+SBAS/WAAS
    navigation.gnss.satellites
    navigation.gnss.integrity eg no Integrity checking
    environment.depth.belowTransducer
    navigation.speedThroughWaterReferenceType eg Paddle wheel
    navigation.speedThroughWater
    navigation.log
    navigation.trip.log
    navigation.datetime eg 2018-05-19T11:02:34.00410Z
    environment.current eg {"setTrue":3.3878,"drift":0.82}
    navigation.headingMagnetic
    navigation.rateOfTurn
    navigation.attitude
    steering.rudderAngle
    steering.autopilot.target.headingMagnetic
    navigation.speedOverGround
    navigation.courseOverGroundTrue
    navigation.position eg N 51.9003° E 1.3122°
    environment.wind.angleApparent
    environment.wind.speedApparent

Other setup

On the server I use the derived data performance plugin and the Prometheus Signalk exporter plugin feeding a local Prometheus instance which also captures OS level stats on the performance of the Raspberry PI as well as all NMEA2000 data. This allows longer term monitoring of both the Pi operations and boat performance. Here is an example dashboard in Grafana. For full details on setup look at setup/README.md

Grafana OS Dashboard

Grafana OS Dashboard

Grafana OS Dashboard