twin engine fuel rate & economy - node-red flow #12
Replies: 2 comments
-
[{"id":"21616ff8.275e48","type":"tab","label":"Fuel Rate/Economy","disabled":false,"info":""},{"id":"fc783485.bb5f9","type":"signalk-subscribe","z":"21616ff8.275e48","name":"SOG kts","mode":"sendAll","flatten":true,"context":"vessels.self","path":"navigation.speedOverGround","source":"","period":"2000","x":100,"y":820,"wires":[["9cd9b414.2ee3a8"]]},{"id":"8ece5e3e.55cae","type":"debug","z":"21616ff8.275e48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":520,"wires":[]},{"id":"309caff7.f77c","type":"signalk-send-pathvalue","z":"21616ff8.275e48","name":"","source":"","x":750,"y":640,"wires":[]},{"id":"89ee1ff4.b46a8","type":"change","z":"21616ff8.275e48","name":"calc fuel economy L/nm","rules":[{"t":"set","p":"payload","pt":"msg","to":"$flowContext('TotalRate')/$flowContext('SOG')","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"fuel economy","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":820,"wires":[["e625ef59.b8751","d9ba29d1.09a978"]]},{"id":"36ae6a65.d63d6e","type":"change","z":"21616ff8.275e48","name":"","rules":[{"t":"set","p":"SOG","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":900,"wires":[["70a7c6c3.1dcd98"]]},{"id":"32900d2.0ffc9f2","type":"change","z":"21616ff8.275e48","name":"set topic propulsion.TotalfuelRate","rules":[{"t":"set","p":"topic","pt":"msg","to":"propulsion.TotalFuelRate","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":580,"wires":[["8ece5e3e.55cae","309caff7.f77c"]]},{"id":"3ac30354.7c1684","type":"change","z":"21616ff8.275e48","name":"","rules":[{"t":"set","p":"PortRate","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":150,"y":560,"wires":[["1c813e8.11b3ec2"]]},{"id":"de42ecfa.fa312","type":"change","z":"21616ff8.275e48","name":"","rules":[{"t":"set","p":"StbdRate","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":150,"y":680,"wires":[["1c813e8.11b3ec2"]]},{"id":"1c813e8.11b3ec2","type":"change","z":"21616ff8.275e48","name":"calc total rate m3/s","rules":[{"t":"set","p":"payload","pt":"msg","to":"$flowContext('PortRate')+$flowContext('StbdRate')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":620,"wires":[["32900d2.0ffc9f2","77503e88.d6fe8"]]},{"id":"d571da5b.cbf1e","type":"change","z":"21616ff8.275e48","name":"set flow.TotalRate L/s","rules":[{"t":"set","p":"TotalRate","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":760,"wires":[["89ee1ff4.b46a8","832b5034.97dea8"]]},{"id":"c5e30430.ab2e38","type":"debug","z":"21616ff8.275e48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":820,"wires":[]},{"id":"e625ef59.b8751","type":"change","z":"21616ff8.275e48","name":"set Topic propulsion.FuelEconomy","rules":[{"t":"set","p":"topic","pt":"msg","to":"propulsion.FuelEconomy","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":900,"wires":[["de98632c.0e832","c5e30430.ab2e38"]]},{"id":"de98632c.0e832","type":"signalk-send-pathvalue","z":"21616ff8.275e48","name":"","source":"","x":770,"y":980,"wires":[]},{"id":"26ccc739.fe56f","type":"signalk-subscribe","z":"21616ff8.275e48","name":"starboard fuel rate m3/s","mode":"sendAll","flatten":true,"context":"vessels.self","path":"propulsion.starboard.fuel.rate","source":"","period":"2000","x":140,"y":760,"wires":[["de42ecfa.fa312"]]},{"id":"7352dda3.ee3b6c","type":"signalk-subscribe","z":"21616ff8.275e48","name":"port fuel rate m3/s","mode":"sendAll","flatten":true,"context":"vessels.self","path":"propulsion.port.fuel.rate","source":"","period":"2000","x":130,"y":500,"wires":[["3ac30354.7c1684"]]},{"id":"93242372.7f214","type":"debug","z":"21616ff8.275e48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":1080,"wires":[]},{"id":"9cd9b414.2ee3a8","type":"change","z":"21616ff8.275e48","name":"change to nm/s","rules":[{"t":"set","p":"payload","pt":"msg","to":"(msg.payload/3600)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":900,"wires":[["36ae6a65.d63d6e"]]},{"id":"77503e88.d6fe8","type":"change","z":"21616ff8.275e48","name":"change payload to Litres/s","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload*1000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":680,"wires":[["d571da5b.cbf1e"]]},{"id":"d9ba29d1.09a978","type":"debug","z":"21616ff8.275e48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":720,"wires":[]},{"id":"70a7c6c3.1dcd98","type":"switch","z":"21616ff8.275e48","name":"check for TotalRate","property":"TotalRate","propertyType":"flow","rules":[{"t":"istype","v":"undefined","vt":"undefined"},{"t":"nnull"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":840,"wires":[["55b21673.7fe8d8"],["89ee1ff4.b46a8","93242372.7f214"]]},{"id":"55b21673.7fe8d8","type":"debug","z":"21616ff8.275e48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":1020,"wires":[]},{"id":"832b5034.97dea8","type":"debug","z":"21616ff8.275e48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":720,"wires":[]},{"id":"cc361bb4.8d1258","type":"switch","z":"21616ff8.275e48","name":"check if StbdRate undefined","property":"StbdRate","propertyType":"flow","rules":[{"t":"istype","v":"undefined","vt":"undefined"},{"t":"nnull"}],"checkall":"true","repair":false,"outputs":2,"x":280,"y":440,"wires":[["abf7baf9.3ce5c"],[]]},{"id":"abf7baf9.3ce5c","type":"change","z":"21616ff8.275e48","name":"set StbdRate=0 if undefined","rules":[{"t":"set","p":"StbdRate","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":420,"wires":[[]]}] |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
for twin engines, each supplies respective instantaneous fuel rate ...
this flow computes combined (instant) fuel rate and economy (litres/naut mile) ... also instantaneous
the flow checks for existence of a fuel rate - otherwise it would error out with "undefined" output
.. it probably should have a further check on each engine ... as prior to start of second engine.. it likely produces undefined output also.
fuel rate.txt
Beta Was this translation helpful? Give feedback.
All reactions