This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get True Wind Direction instead of apparent using Signal K.
#11
(2022-04-11, 09:35 AM)PaddyB Wrote:
(2022-04-10, 04:50 PM)dreeas Wrote: Ah, I see. I googled and found the formula for conversion but no clue how to do that in the query in Grafana.
Is there no setting or tweak in Signal K to output degrees?

Signalk works with SI units, it's down to whatever is displaying the data to do any unit conversions. 
In Grafana there's a math function in Select >>
I did this by multiplying by 57.295 but that will only be correct with wind from 0-180 degrees wont it?
I have installed the "Derived data" and tested by selecting most of the options under "Wind" but I do not get any new data points under data browser. Is there anything else needed to get calculated data from this addon?
Reply
#12
I just re-read your Opening Post and I don't think you need to do anything, and this is why:

Apparent wind direction/speed is the actual direction/speed the boat sees and records.  The reason it is different from the True wind is because the boat is moving.  Apparent means relative to the boat.  If the boat is stationary, Apparent and True are the same.  if you are making a Home weather station Apparent Wind = True Wind

maybe a better explanation: https://en.wikipedia.org/wiki/Apparent_wind
Reply
#13
(2022-04-11, 07:15 PM)Techstyle Wrote: I just re-read your Opening Post and I don't think you need to do anything, and this is why:

Apparent wind direction/speed is the actual direction/speed the boat sees and records.  The reason it is different from the True wind is because the boat is moving.  Apparent means relative to the boat.  If the boat is stationary, Apparent and True are the same.  if you are making a Home weather station Apparent Wind = True Wind

maybe a better explanation: https://en.wikipedia.org/wiki/Apparent_wind

I have already studied that wiki page, and I agree. Problem is I just want the output to be what the sensor is sending in it´s nmea telegram, value in degrees 0-359 and not converted to radians. But I understand from the post above that SignalK does output it in radians and it´s not possible to change.
Reply
#14
(2022-04-11, 07:21 PM)dreeas Wrote:
(2022-04-11, 07:15 PM)Techstyle Wrote: I just re-read your Opening Post and I don't think you need to do anything, and this is why:

Apparent wind direction/speed is the actual direction/speed the boat sees and records.  The reason it is different from the True wind is because the boat is moving.  Apparent means relative to the boat.  If the boat is stationary, Apparent and True are the same.  if you are making a Home weather station Apparent Wind = True Wind

maybe a better explanation: https://en.wikipedia.org/wiki/Apparent_wind

I have already studied that wiki page, and I agree. Problem is I just want the output to be what the sensor is sending in it´s nmea telegram, value in degrees 0-359 and not converted to radians. But I understand from the post above that SignalK does output it in radians and it´s not possible to change.

SignalK uses SI units - Radians for angle.  But Signal K is just a data handler.  You would want to use something like KIP (Singal K plugin) to view current data or Influx/Grafana to store and view trends - either of those can change the units
Reply
#15
Attaching a screengrab of my Grafana loggings showing the data logged is +/- 3.14.
I already use Influx/Grafana but no idea how to use "math" to convert this to degrees 0-360.

I will check out KIP when I get access to my server.


Attached Files Image(s)
   
Reply
#16
Checked out the KIP addon. Looks like this is just for display of data and not creating a new datapoint that can be sent to Influx with Signal K.
But even Kip outputs the wind angle in +/- 180 degrees and not 0-360.

I guess the "Derived Data" addon is not creating any new datapoints in wind angles since I don't have data on Heading or Speed of a vessel and this is used in the calculations.
But even "Derived Data" would maybe just output it in degrees +/- 180 instead of 0-360?

Starting to give up on Signal K for this project, at least for wind direction.
Reply
#17
(2022-04-12, 06:53 PM)dreeas Wrote: Checked out the KIP addon. Looks like this is just for display of data and not creating a new datapoint that can be sent to Influx with Signal K.
But even Kip outputs the wind angle in +/- 180 degrees and not 0-360.

I guess the "Derived Data" addon is not creating any new datapoints in wind angles since I don't have data on Heading or Speed of a vessel and this is used in the calculations.
But even "Derived Data" would maybe just output it in degrees +/- 180 instead of 0-360?

Starting to give up on Signal K for this project, at least for wind direction.

your sensor is outputting +/-180.  to get it to output 0-360 you would need to add 3.14 (Pi), and then divide by 2xPi to get it into degrees.

if you are up to doing a little bit of coding, you could just write your own <filename>.js and put it in the derived data directory with the rest of them and use it to calculate what ever you wanted.  it would look something like this:

Code:
module.exports = function (app, plugin) {
 return [
   {
     group: 'wind',
     optionKey: 'directionTrueDeg',
     title: 'Stationary True Wind Direction in Degrees (based on AWA)',
     derivedFrom: ['environment.wind.angleApparent'],
     calculator: function (awa) {
       let windHeadingDeg = (awa + Math.PI) / (2 * Math.PI)

       return [{ path: 'environment.wind.directionTrueDeg', value: windHeadingDeg }]
     }
   }
 ]
}
   
then restart signal K and go into the derived data page and look for "Stationary True Wind Direction in Degrees (based on AWA)" and turn it on

this is cheating but should work (although my code may be a little wrong!)
Reply
#18
(2022-04-12, 09:47 PM)Techstyle Wrote:
(2022-04-12, 06:53 PM)dreeas Wrote: Checked out the KIP addon. Looks like this is just for display of data and not creating a new datapoint that can be sent to Influx with Signal K.
But even Kip outputs the wind angle in +/- 180 degrees and not 0-360.

I guess the "Derived Data" addon is not creating any new datapoints in wind angles since I don't have data on Heading or Speed of a vessel and this is used in the calculations.
But even "Derived Data" would maybe just output it in degrees +/- 180 instead of 0-360?

Starting to give up on Signal K for this project, at least for wind direction.

your sensor is outputting +/-180.  to get it to output 0-360 you would need to add 3.14 (Pi), and then divide by 2xPi to get it into degrees.

if you are up to doing a little bit of coding, you could just write your own <filename>.js and put it in the derived data directory with the rest of them and use it to calculate what ever you wanted.  it would look something like this:

Code:
module.exports = function (app, plugin) {
 return [
   {
     group: 'wind',
     optionKey: 'directionTrueDeg',
     title: 'Stationary True Wind Direction in Degrees (based on AWA)',
     derivedFrom: ['environment.wind.angleApparent'],
     calculator: function (awa) {
       let windHeadingDeg = (awa + Math.PI) / (2 * Math.PI)

       return [{ path: 'environment.wind.directionTrueDeg', value: windHeadingDeg }]
     }
   }
 ]
}
   
then restart signal K and go into the derived data page and look for "Stationary True Wind Direction in Degrees (based on AWA)" and turn it on

this is cheating but should work (although my code may be a little wrong!)

Thank you so much for this, I will try that out tomorrow. 
My windsensor is already outputting wind angle 0-359 degrees in to Signal K, I just thought it would be possible to just forward that, or prevent the recalculation to Apparent wind angle.
I realiize Signal K is used for boating and that's why my problem is probably not relevant for this software.
Reply
#19
Actually, I messed that up, calculation should be

let windHeadingDeg = ((awa + Math.PI) *180) / Math.PI
Reply
#20
(2022-04-12, 09:58 PM)dreeas Wrote: Thank you so much for this, I will try that out tomorrow. 
My windsensor is already outputting wind angle 0-359 degrees in to Signal K, I just thought it would be possible to just forward that, or prevent the recalculation to Apparent wind angle.
I realiize Signal K is used for boating and that's why my problem is probably not relevant for this software.

You can do the same calibration in grafana , add a math function in select >> 

[Image: reYhOvA.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)