B&G Performance plugin

Hi there!
I'm new to SignalK so please be gentle 😉 I have a B&G Zeus chart plotter and a fairly standard wind sensor (B&G WS310) which generates AWA and AWD. However, I also have a rotating mast... I am measuring my mast rotation angle using a Honeywell magnetic position sensor and the YachtDevices YDRA (A/D converter that generates either the Rudder Angle PGN or a Trim Tab PGN - I'm using Rudder Angle). I was excited to see the B&G Performance Plugin, but I don't really understand what it does... It appears to generate the custom B&G PGN 0x1FF08 (130824) that handles multiple key-value pairs to handle parameters that are not explicit PGNs themselves. The B&G key-value data PGN includes a field for mast rotation (key 156). However, I cannot tell if this plugin emulates an H5000 processor and actually calculates the corrected AWA/AWS/TWS/TWA/TWD itself, or is only a formatter for sending the data to an H5000 for processing? If the plugin does the mast rotaton processing, then I'm delighted. If it doesn't, then I will use the YDNB (which can act as a little N2K processor itself) to do the calculation. Can anyone help me understand the purpose and functionality of the Performance plugin? Sorry for being long-winded! Cheers, greg
12 Replies
Teppo Kurki
Teppo Kurki•4mo ago
the plugin's readme https://github.com/htool/signalk-bandg-performance-plugin and the author is @HansT
GitHub
GitHub - htool/signalk-bandg-performance-plugin: Generate B&G perfo...
Generate B&G performance PGNs to be displayed on Vulcan/Zeus/Triton2 - GitHub - htool/signalk-bandg-performance-plugin: Generate B&G performance PGNs to be displayed on Vulcan/Zeus/Triton2
Greg Johnson
Greg JohnsonOP•4mo ago
@Teppo Kurki sorry, I should have said that I'd looked at the plugin, but had trouble deciphering it. The readme really boils down to the first line "Generates B&G performance PGNs to be displayed on a Zeus" but if the source code is all in index.js, it looks like this is a mapper that takes SignalK paths and assembles a special PGN with key-value pairs. It doesn't actually do any of the calculations itself I think? I hadn't realised that @HansT might be in here as well! Hans, if I have understood the purpose of your plugin correctly, may I ask how you generate (for instance) TWS from AWS, COG (or heading) and SOG (or speed)? Am I correct in thinking that you are trying to replicate the functionality of the H5000? Maybe this plugin is just one part of the system and I just haven't gotten familiar with things yet? Ahhhh - is this what the 'derived-data' plugin does? Just noticed that.
I see calcs/trueWind.js in there, and while it doesn't know about mast rotation angle (not surprising seeing as N2K didn't implement a PGN for it) perhaps I just need to add a modified version of that code that includes my "rudder angle" (or "trim tabs" or whatever PGN I use for the rotation sensor)... Maybe this is the right direction?
Teppo Kurki
Teppo Kurki•4mo ago
derived data plugin is not really suited for custom conversions what are you after here? apparent wind angle adjusted for mast rotation? if I were you i would probably - use path-mapper plugin to convert the mast rotation from the incorrect path to something sensible, like mast.rotation - add metadata for mast.rotationso that the unit is radians (like other angles in sk) - use node-RED plugin and signalk-input-handler to adjust environment.wind.angleApparent for mast rotation this way everything else like deriving true wind from apparent works and you can see mast rotation in sk Data Browser and Kip etcn and if you use influxdb it gets written there in corrected form
Greg Johnson
Greg JohnsonOP•4mo ago
Thank you @Teppo Kurki - I will try that!
HansT
HansT•4mo ago
The purpose of the plugin is to put the proprietary B&G pgns on the bus with certain information to allow it to display nicely on the B&G displays, not to calculate these values itself.
Greg Johnson
Greg JohnsonOP•4mo ago
@HansT what calculates those values in your setup?
HansT
HansT•2mo ago
One is the polar plugin I made The idea is to have one plugin do the calculations and write the data to SignalK paths and then have another plugin (like this one) to send it to B&G, or another to send to Raymarine. Or display in KIP.
Greg Johnson
Greg JohnsonOP•2w ago
Makes sense. Do you know of a plugin that can take a mast rotation angle and do the TWA/TWS calculations?
HansT
HansT•2w ago
No, I don't. It could be added to this plugin: https://github.com/htool/signalk-polar-performance-plugin
Teppo Kurki
Teppo Kurki•2w ago
TWA/TWS adjusted for mast rotation is not really related to polars, derived data seems a more natural home for it
HansT
HansT•2w ago
Do you have mast rotation info already in SignalK?
Greg Johnson
Greg JohnsonOP•2w ago
Yes, I have brought that in. @Teppo Kurki I will look at the derived data plugin I see this example - I can work up the corrected TWA/TWS using a mast rotation field like this: module.exports = function(app) { return { group: 'vmg', optionKey: 'vmg', title: "Velocity Made Goog (based on courseGreatCircle.nextPoint.bearingTrue heading true and speedOverGround)", derivedFrom: [ "navigation.courseGreatCircle.nextPoint.bearingTrue", "navigation.headingTrue", "navigation.speedOverGround" ], calculator: function (bearingTrue, headingTrue, speedOverGround) { var angle = Math.abs(bearingTrue-headingTrue) return [{ path: "navigation.courseGreatCircle.nextPoint.velocityMadeGood", value: Math.cos(bearingTrue-headingTrue) * speedOverGround}] } }; }
Want results from more Discord servers?
Add your server