Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Engineering & Systems > Marine Electronics
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 05-12-2019, 09:16   #1
Registered User

Join Date: Jul 2015
Boat: Hanse 531
Posts: 1,076
Images: 1
Detect when engine is on from NMEA data?

I have a ton of (actually ~15 GB) of NMEA2000 messages and separate attitude/pitch/roll information from our summer sailing vacation (recorded about 10 samples/second).

Now I'm trying to figure out whether there is some intelligent way to, based on the data, detect whether we're sailing or going by engine (or both).

Here's where I'm at now:

1) Is the engine connected to the NMEA bus? No, it isn't. No luck there.

2) Does anything broadcast voltage to the NMEA bus (since it would be decidedly higher when the engine is charging)? No, no voltage in the messages.

3) Could I just scan the data for periods that look like hoisting or taking down the sails (AWA 0 +/- something, SOG 0-2 knots, before heading away from the wind and gaining speed) -- maybe doable but not foolproof.

4) Could I compare wind angles and polar data and at eliminate sections that are way too low or way above possible speeds -- doable but only part of the solution.

5) Could I use roll angles to see whether it's likely we're sailing or not -- doable, at least upwind, but for some of the initial legs we were motoring upwind with the mainsail up, so not foolproof.

Any other ideas?
__________________
Call me Mikael
nkdsailor.blog
mglonnro is offline   Reply With Quote
Old 08-12-2019, 01:27   #2
Registered User

Join Date: Jun 2013
Location: canada
Posts: 4,664
Re: Detect when engine is on from NMEA data?

sounds like you need to add another sensor for next trip.

why don't you just look at the engine hour meter before and after trip?...

there is half your question answered in 2 secs.

the sailing time harder.
smac999 is offline   Reply With Quote
Old 08-12-2019, 01:51   #3
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Detect when engine is on from NMEA data?

Quote:
Originally Posted by mglonnro View Post

Any other ideas?
Node red and influxdb database would be worth a play. What computer operating system are you on? I don't have any n2k so don't know the message format, do they have time stamps embedded? You might be able to run the massages through signalk and get it to save to the database. Or maybe a bit of python. Then when it's plotted you can look for obvious changes which might happen when the engine was running. All those programs are pretty simple to get going on Linux, possible in Windows but a bit more of a runaround. Post a few messages so we can have a play.
conachair is offline   Reply With Quote
Old 08-12-2019, 02:36   #4
Registered User

Join Date: Jul 2015
Boat: Hanse 531
Posts: 1,076
Images: 1
Re: Detect when engine is on from NMEA data?

Quote:
Originally Posted by smac999 View Post
sounds like you need to add another sensor for next trip.
Yes, this is so

Quote:
why don't you just look at the engine hour meter before and after trip?...

there is half your question answered in 2 secs.

the sailing time harder.
The point of all of this is to draw a polar diagram with wind angles, speeds, boat speed. So not just to know how many hours of this or that but to know which data should go into the polars and which not.
__________________
Call me Mikael
nkdsailor.blog
mglonnro is offline   Reply With Quote
Old 08-12-2019, 02:39   #5
Registered User

Join Date: Jul 2015
Boat: Hanse 531
Posts: 1,076
Images: 1
Re: Detect when engine is on from NMEA data?

Quote:
Originally Posted by conachair View Post
Node red and influxdb database would be worth a play. What computer operating system are you on? I don't have any n2k so don't know the message format, do they have time stamps embedded? You might be able to run the massages through signalk and get it to save to the database. Or maybe a bit of python. Then when it's plotted you can look for obvious changes which might happen when the engine was running. All those programs are pretty simple to get going on Linux, possible in Windows but a bit more of a runaround. Post a few messages so we can have a play.
Currently I actually have the data in influx (in the Google Cloud) and I have been playing around with visualizing it using Grafana. So far I've used AWA, AWS, SOG, heading, COG, roll to try to figure it out... and ended up writing the OP since ... it didn't appear so clear

Machine learning would help, but to train it I would still need to know when the engine was adding to the propulsion for the current data.
__________________
Call me Mikael
nkdsailor.blog
mglonnro is offline   Reply With Quote
Old 08-12-2019, 02:49   #6
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Detect when engine is on from NMEA data?

Quote:
Originally Posted by mglonnro View Post
Currently I actually have the data in influx (in the Google Cloud) and I have been playing around with visualizing it using Grafana. So far I've used AWA, AWS, SOG, heading, COG, roll to try to figure it out... and ended up writing the OP since ... it didn't appear so clear

Machine learning would help, but to train it I would still need to know when the engine was adding to the propulsion for the current data.
Sounds like you're well down the road already,
Sounds very interesting, keep us posted how you get on even if no one comes up with anything on here.
How did you save the data?
conachair is offline   Reply With Quote
Old 08-12-2019, 03:14   #7
Registered User

Join Date: Aug 2017
Location: San Francisco
Boat: Fountaine Pajot, Helia 44 - Hull #16
Posts: 609
Re: Detect when engine is on from NMEA data?

You can could add an engine nmea module for several hundred $. Check out yacht devices.
AllenRbrts is offline   Reply With Quote
Old 08-12-2019, 03:30   #8
Registered User

Join Date: Feb 2016
Posts: 143
Re: Detect when engine is on from NMEA data?

You indicated it needs to be foolproof. I would just eyeball daily tracks and manually annotate the data with sail states. Furthermore sail state is not binary: you need to have reefing and for example spinnaker use included, let alone multiple headsails if you have them.

I believe I could remember most of this after a few months with track helping with the recall.
teppokurki is offline   Reply With Quote
Old 08-12-2019, 05:50   #9
Registered User

Join Date: Jul 2015
Boat: Hanse 531
Posts: 1,076
Images: 1
Re: Detect when engine is on from NMEA data?

Quote:
Originally Posted by teppokurki View Post
You indicated it needs to be foolproof. I would just eyeball daily tracks and manually annotate the data with sail states. Furthermore sail state is not binary: you need to have reefing and for example spinnaker use included, let alone multiple headsails if you have them.

I believe I could remember most of this after a few months with track helping with the recall.
Yes, I agree this would be a good pragmatic approach. I'll probably end up doing just that
__________________
Call me Mikael
nkdsailor.blog
mglonnro is offline   Reply With Quote
Old 08-12-2019, 05:56   #10
Registered User

Join Date: Jul 2015
Boat: Hanse 531
Posts: 1,076
Images: 1
Re: Detect when engine is on from NMEA data?

Quote:
Originally Posted by AllenRbrts View Post
You can could add an engine nmea module for several hundred $. Check out yacht devices.
Yes, indeed. That's something I have to look into for next season!
__________________
Call me Mikael
nkdsailor.blog
mglonnro is offline   Reply With Quote
Old 08-12-2019, 06:03   #11
Registered User

Join Date: Jul 2015
Boat: Hanse 531
Posts: 1,076
Images: 1
Re: Detect when engine is on from NMEA data?

Quote:
Originally Posted by conachair View Post
Sounds like you're well down the road already,
Sounds very interesting, keep us posted how you get on even if no one comes up with anything on here.
How did you save the data?
Sure will

The raw data path to influx is basically this:

- Raspberry PI with YachtDevices USB-N2K gateway plugged into the NMEA2000 network.
- The raw messages are captured with actisense-serial (from the canboat project) and saved as flat files on the Raspberry.
- The flat files are periodically (or manually) uploaded as is to Google's cloud storage (and removed from the raspberry)
- On a dedicated cloud instance, a process polls for new flat files, scans through them using analyzer (also part of the canboat project) and updates/inserts into influx.

There's a separate path for live streaming the data. The transport mechanism for this is socket.io (and/or the Mist+Wish stack by ControlThings) and it's all done in memory.
__________________
Call me Mikael
nkdsailor.blog
mglonnro is offline   Reply With Quote
Old 08-12-2019, 06:54   #12
Registered User

Join Date: Nov 2015
Location: Ireland
Posts: 468
Re: Detect when engine is on from NMEA data?

I also have many GB of logged NMEA0183 data from the last three seasons. I have tried, unsuccessfully, to find a suitable way to identify the times I’ve been sailing. I plan to hook up the Victron battery monitor for next season and log that too. I hope then to be able to use the battery voltage to detect engine activity.
AedanC is offline   Reply With Quote
Old 08-12-2019, 09:32   #13
Registered User

Join Date: Jul 2015
Boat: Hanse 531
Posts: 1,076
Images: 1
Re: Detect when engine is on from NMEA data?

Quote:
Originally Posted by AedanC View Post
I also have many GB of logged NMEA0183 data from the last three seasons. I have tried, unsuccessfully, to find a suitable way to identify the times I’ve been sailing. I plan to hook up the Victron battery monitor for next season and log that too. I hope then to be able to use the battery voltage to detect engine activity.
Sounds like a good idea

I wonder if my Raspberry is aware of its input voltage

Another crazy idea would be to put a microphone in the engine room and record + analyze the audio It would probably be possible to guess the RPMs from that as well.
__________________
Call me Mikael
nkdsailor.blog
mglonnro is offline   Reply With Quote
Old 08-12-2019, 09:42   #14
Registered User

Join Date: Nov 2015
Location: Ireland
Posts: 468
Re: Detect when engine is on from NMEA data?

Regarding the Pi input voltage, it does have some very crude voltage checking hardware that can flash a warning on an HDMI connected screen if it goes too low. However if your supply to the Pi is any good it should be the same regardless of the 12v supply. I like the RPM idea, let me know how you get on with that [emoji2]
AedanC is offline   Reply With Quote
Old 08-12-2019, 10:54   #15
Registered User

Join Date: Mar 2007
Location: Santa Cruz
Boat: SAnta Cruz 27
Posts: 6,756
Re: Detect when engine is on from NMEA data?

When I am developing race boat polars with Expedition, I always make notes that I can use later with the data analysis, like time, sail configuration, incorrect calibrations, and unusual sea state or wind shear.
donradcliffe is offline   Reply With Quote
Reply

Tags
engine, nmea


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to detect CONTAINER lost at sea and NOT hit it? alexxx Navigation 45 25-06-2015 12:13
I Can't Smell, So How Can I Detect Gas ? SaucySailoress Plumbing Systems and Fixtures 26 21-08-2011 20:11
Another way to detect a propane leak coot Plumbing Systems and Fixtures 43 04-10-2007 15:50
An ideal, drop anchor along coast and metal detect wayland Boat Ownership & Making a Living 27 16-11-2006 06:33

Advertise Here


All times are GMT -7. The time now is 02:25.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.