SignalK / signalk-derived-data

Generates deltas for values derived from signalk values
Apache License 2.0
18 stars 31 forks source link

True Wind Direction (based on AWA and headingTrue) is wrong, should be removed #75

Open marcobergman opened 3 years ago

marcobergman commented 3 years ago

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.

sbender9 commented 3 years ago

Please explain.

marcobergman commented 3 years ago

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.

sbender9 commented 3 years ago

Boat and wind speed are included in the calculation.

sbender9 commented 3 years ago

Oh. There are two calculations for this and maybe some confusion about the definition.

marcobergman commented 3 years ago

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

chris0348 commented 3 years ago

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)

mgrouch commented 2 years ago

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