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
About smoothing signals.
#1
I have the wind angle apparent with the raymarine st60 and the signalk-avg-paths give a smooth value.
I want to use the smooth values as my first apparent wind angle. how can i make it?

environment.wind.angleApparent
2.2349
rad 04/26 19:31:16 can0.115  (130306)

environment.wind.angleApparent_smooth
2.1680968144369617
rad 04/26 19:31:16 signalk-avg-paths

if signalk uses the smooth values the kravio polars plugin and all the values that uses apparent wind angle in the derived data plugin would have better values.
Anybody knows how to make that change?
Reply
#2
if you locate the location of the Derived data plugin, you can find the subdirectory called 'calcs' and do some testing, for instance, you could copy "truewind.js" and rename it and then edit the file (a text editor is fine). Change the Optionkey, Title to something that references that this uses smoothed data, and then change the references to:

'environment.wind.speedApparent',
'environment.wind.angleApparent'

to the smoothed version,
and then the outputs:

return [
{ path: 'environment.wind.directionTrue', value: dir },
{ path: 'environment.wind.angleTrueWater', value: angle },
{ path: 'environment.wind.speedTrue', value: speed }
]
to smoothed versions and at this point in the Plugin config, you should be able to turn it on and see if it works the way you think it should work

once you have tested it, you could talk to some of the signal K guys and get it added to the Derived data plugin.
Reply
#3
I find influxdb plots much more usful.
[Image: joywIzM.png]
Reply
#4
Ok, i can try to change the trueWind.js file but i Have to change al the files where
'environment.wind.speedApparent',
'environment.wind.angleApparent'
are use and change for smooth angle and smooth speed.

I want to change the name of the path 'environment.wind.speedApparent' with a new name 'environment.wind.speedApparent-NON-AVERAGE' create the average value with node red and the name of the new path must be 'environment.wind.speedApparent'
and the same with 'environment.wind.angleApparent'

I wat to make that change because when I use the polar speed ratio and polar speed I have very bad values and I have to make a polar speed of 7 knots in one second and in the next second of 3 knots.
And the same with true wind I have a value of 60 degrees and in the next second a value of 20 degrees.
In that case I have to change all the plugins and al the calcs in all the program with the smooth values

if i could substitute the 'environment.wind.speedApparent' path with the new 'environment.wind.speedApparent.smooth' all the signalk must be more smooth.
Reply
#5
Fiddling with derived data won’t allow altering the input data. Use https://github.com/SignalK/node-red-embe...ut-handler for intercepting and altering data as it enters the server.

If I were you I would first create the soothed data in Node-RED using an alternate path to debug things then plug it into an input handler flow to make the data soothed universally.
Reply
#6
Perfect. Now I made a function in node red that catch the environment.wind.apparent path and after that I use de moving average node

https://flows.nodered.org/node/node-red-...ng-average

And after that I create a signalk-send-pathvalue node to send the value as environment.wind.apparent-smooth

and now how I can change the raymarine path before enter the signalk path value to another path and then put the node red nodes to create the new environment.wind.angleApparent .

sorry for my poor english

Why I want to make this? derived data and kravio polar speed dont give comprensive values in mxtommy/Kip dashboard.
I dont know if there is an option in signalk that smooth the data.
I dont have that problem with battery sensors, gps position depth or SOG values are accurate enough but if I want to calculate theorical speeds with my kravio polars plugin I cant uses values of 30 degres of difference per seccon because KRavio polar speed giveme 2 knots o diffenence per second

I answer me
1º signalk-input-handler to take the environment.wind.apparent before enter the server
2º moving average to create the smooth signal
3º signalk-input-handler-next to create the new environment.wind.apparent and this value enter the server
Reply
#7
I reply my self.
all you say is perfect. I create the nodes and it takes the new values Wink
Now I have to go to my boat and I correct that and I can say you my experience.

Thanks a lot.


Attached Files Image(s)
   
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)