March 1, 2019  NMEA Brigde use cases

Our NMEA 2000 Bridge YDNB-07 may help you process NMEA 2000 data in real time. The article contains two cases where the Bridge was used to fix or even replace an NMEA 2000 equipment.

Example 1: Evinrude engine fuel level tank instances

One of our customers has the Evinrude E-TEC G2 engine with an NMEA 2000 fuel level gateway module. By default, the gateway is configured to send the fuel level data with fluid instances 4 and 5, while his chartplotter can display tank data only with instances 0 and 1.

While it is possible to change the instances with Evinrude G2 Diagnostic kit, our customer asked if this issue can be fixed using our NMEA 2000 Bridge YDNB-07.

Of course it is possible. You do not need to break the NMEA 2000 network into separate segments. You do not even need to connect a second CAN interface of the Bridge. Just plug the Device into any free socket on the NMEA 2000 network and program the Bridge to re-transmit the Fluid Level PGNs received from the engine, but with changed instances.

# The program receives "Fluid Level" PGN 127505 (0x1F211)
# changes the "Fluid instance" field and sends back the modified PGN.
# instance 4 is changed to 0
# instance 5 is changed to 1

# Disable forwarding for all mismatched PGNs
FW_CAN1_TO_CAN2=OFF
FW_CAN2_TO_CAN1=OFF

# Enable only "Fluid Level" PGN 127505 on CAN1
CAN1_HARDWARE_FILTER_1=0x01F21100, 0x01FFFF00

# Process "Fluid Level" PGN 127505
match(CAN1, 0x01F21100, 0x01FFFF00 )
{
	# Get fluid instance
	I = get(DATA, UINT8)
	
	if (I == 4){
		set(DATA, UINT8, I & 0xF0 )
		send(CAN1)
	}
	
	if (I == 5){
		set(DATA, UINT8, I & 0xF1 )
		send(CAN1)
	}	
}

# End of program

Simple, yet a very effective solution. But can we do better?

Example 2: Tinley NMEA 2000 Transducer Change Over Switch emulator

Check this product: Tinley NMEA 2000 Transducer Change Over Switch (TAC COS).

It works on the same principle as described in the example above.

It uses a single NMEA 2000 connection, gets apparent wind angle data from the wind sensor, depth and water referenced speed data from port and starboard transducers and adds a new depth data source, forwarding the data from the port transducer if the apparent wind is from the starboard and switching to the starboard transducer if the wind is from the port side of the vessel.

However, if you have a chartplotter model where you cannot set the preferred depth data source, you cannot use the TAC COS to its full potential. Instead, you may end up with three depth and STW gauges instead of one.

Also it is not possible to configure the TAC COS and tweak the wind speed and angle sensitivity.

Let's try to make a device without those limitations from the NMEA 2000 Bridge YDNB-07.

First, we need to figure out the NMEA 2000 network layout.

We will opt to break the NMEA 2000 network into two separate segments and connect them with the YDNB-07 Bridge.

The first segment will be connected to the CAN1 port of the Bridge, and will have both port and starboard transducers. The second segment will be connected to the CAN2 port of the Bridge, and will have a wind sensor, chartplotter and all other NMEA 2000 equipment.

We will use the NMEA 2000 transducer address to determine which one should be used as a data source. Using the NMEA 2000 devices list on a chartplotter, we have found that the port transducer has an NMEA 2000 address 0x10 and port transducer has an address 0x11.

So we add both addresses to the init() section of the program:

# Transducers address
P = cast (0x10, UINT8 ) # port
S = cast (0x11, UINT8 ) # starboard

We also have checked that the wind sensor outputs apparent wind angle data.

Now let's analyze the real world scenarios. We do not want the Device to switch between transducers from the slightest breeze. The switching should occur only when wind speed stays above the threshold for at least 10 seconds. Also we would like those parameters to be easily configured by an end user. So we add:

# C variable sets the wind speed threshold
# 0.5 = wind speed in knots
C = cast (51.44 * 0.5, UINT16)

# Time interval: wind angle should be in the switching range at least, milliseconds
F = cast (10000, UINT32)

When the wind angle is fluctuating near 0° or 180°, the Device will also switch between the transducers randomly, so we need to introduce an angle hysteresis to the system, adding a dead-band angle.

# B variable sets the angle dead-band
# 5 = angle in degrees.
B = cast (174.5 * 5, UINT16)

The final switching logic is:

  • by default (after power on) use the port transducer;
  • if the wind angle stays in the range [360° - deadband angle .. 180° + deadband angle] for more than the specified time interval and at the same time the wind speed is over the threshold, switch to the starboard transducer;
  • if the wind angle stays in the range of [0° + deadband angle .. 180° - deadband angle] for more than specified time interval and at the same time the wind speed is over the threshold, switch to the port transducer.

The end user can modify the program according to the vessel's attitude and tweak the following parameters in the init() section:

  • CAN addresses of transducer;
  • wind speed threshold;
  • time for wind parameters to stay in the switching range before the switchover takes place;
  • dead-band angle.

The program was successfully tested in a lab, both with specially crafted model data and with the live data recorded during our 2016 Gdansk sea trial. You can download the full program here (5 KB).

In conclusion

NMEA 2000 Bridge YDNB-07 is a very powerful and versatile instrument, suitable for simple and mildly complex NMEA 2000 data manipulation. Despite it has a series of limitations, it can be used to implement a rather complex NMEA 2000 data processing device, like Tinley TAC COS.

The main benefit of this device is that the end user can easily reconfigure the program, for example, set custom threshold values in TAC COS example, and even change the program logic to adapt the existing programs for usage on a particular vessel.

 

Next articles:

Previous articles:

See also: recent news, all news...