SK
Signal K4mo ago
petsi

petsi - I have create this node-red flow. It ta...

I have create this node-red flow. It takes the AWA and put it again on the flow with a smooth path. It works with negative and positive values. anybody can try this flow and sayme if it works fine?
22 Replies
Teppo Kurki
Teppo Kurki4mo ago
It will not work very well dead downwind when awa alternates from side to side
petsi
petsi4mo ago
how I have to change the function to work?
Teppo Kurki
Teppo Kurki4mo ago
petsi
petsi4mo ago
ok, i think that now is ok
Teppo Kurki
Teppo Kurki4mo ago
you could optimise it so that sin and cos is calculated once for each input. now they are called every time there is new input for all the old values
petsi
petsi4mo ago
Ok, something like this?
Teppo Kurki
Teppo Kurki4mo ago
I don't think that works - for each new wind value you get a new message object hmm, i just looked at the json, did not put this in node-red, so i may be mistaken... anyway, convert the angle first to [sin, cos], then keep a window buffer of them, then calculate the average by summing the sin and cos values
Henry
Henry4mo ago
Following this thread with interest. Actually the maths for Yamartino’s method isn't too bad (sin, cos, sum and arctan). https://www.flyingcoloursmaths.co.uk/dictionary-of-mathematical-eponymy-yamartinos-method/ Plus this buffer array looks useful https://flows.nodered.org/node/node-red-contrib-buffer-array
petsi
petsi4mo ago
I understand the method, I understand how it works but I don't know how to make it work with node red. I'm using chat gpt for create the instructions and I know why it don´t work, I'm not able.
Henry
Henry4mo ago
Managed to get a process that seems to work. Is all in radians, but working on a KIP dashboard too. Is a buffer/array of 10.
No description
Teppo Kurki
Teppo Kurki4mo ago
looks good to me! i actually managed to create a prototype for a standalone plugin that does this, see https://discord.com/channels/1170433917761892493/1240386036757168168
Henry
Henry4mo ago
Plugin looks useful. Was useful too to actually practice/learn some signalk to get this working, so pleased I've had the practice.
petsi
petsi4mo ago
Could you share the node red flow?
Henry
Henry4mo ago
Will try and go onboard tomorrow and get a copy. Actually found an error in the arctan calculation over the weekend, but fixed bown
petsi
petsi4mo ago
Thank you. I'm waiting and reading
Want results from more Discord servers?
Add your server