Open marcobergman opened 3 years ago
Please explain.
Scott so sorry for being unclear, and a bit rude. It cannot be done by definition, because you lack boat and wind speed in the equation. The script trueWind.js shows the correct calculation, and that one works. If you follow that script, and especially how the angle in there is calculated, you'll see what I mean.
Boat and wind speed are included in the calculation.
Oh. There are two calculations for this and maybe some confusion about the definition.
Boat and wind speed are included in the calculation.
Not in this one https://github.com/SignalK/signalk-derived-data/blob/master/calcs/windDirection.js
Just had a look: I see it as marcobergmann, directionTrue and directionMagnetic are wrong if calculated via the implementation in windDirection.js, it lacks speedThroughWater. The file trueWind.js also provides directionTrue, this time the implementation includes speedThroughWater. Furthermore there is windDirectionMagnetic.js which calculated directionMagnetic from directionTrue.
To wrap it up: In my opinion only one implementation for directionTrue should be provided and furthermore windDirection.js contains a calculation that is wrong. windDirection.js should be deleted.
(I use trueWind.js since > a year and it gives reliable results)
It also depends on leeway. Speed sensor only measures speed over water in the direction of heading. It doesn't give you velocity vector for movement over water. It's a vector algebra formula.
TrueWindVector + SpeedOverWaterVector = ApparentWindVector
To figure out SpeedOverWaterVector you need to know heading vector, speed from (speed sensor) and leeway (or actually speed over water in direction perpendicular to heading)
leeway doesn't get measured by boat sensors. It has to be estimated and there is an empirical formula for leeway which depends on the heel :) which is measured from the boat sensor (autopilot IMU)
Leeway = -1 k Heel / BSP^2
True Wind Direction cannot possibly be calculated from AWA and headingTrue. The idea is wrong, the calculation is wrong. It should be removed from the code and from the Derived Data Plugin Config.