Averaging measurements...

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Averaging measurements...

#1 Post by grovkillen » 14 Feb 2019, 09:51

A question arise on GitHub in terms of averaging measurements making them less "jumpy". This is how I would do a 10 sample averaging filter:

Code: Select all

On Temp#Value Do
  Let,10,[VAR#9]
  Let,9,[VAR#8]
  Let,8,[VAR#7]
  Let,7,[VAR#6]
  Let,6,[VAR#5]
  Let,5,[VAR#4]
  Let,4,[VAR#3]
  Let,3,[VAR#2]
  Let,2,[VAR#1]
  Let,1,[Temp#Value]
  TaskValueSet,12,1,([VAR#1]+[VAR#2]+[VAR#3]+[VAR#4]+[VAR#5]+[VAR#6]+[VAR#7]+[VAR#8]+[VAR#9]+[VAR#10])/10
EndOn
Read more in the GitHub link: https://github.com/letscontrolit/ESPEasy/issues/2304
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Averaging measurements...

#2 Post by iron » 14 Feb 2019, 22:17

Also need to filter out off values. e.g ds18b20 often gets either a max (120?) or min (-60?) *C. Might want to filter those out as they will bump your 10 point avrg significantly

-D
-D

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Averaging measurements...

#3 Post by grovkillen » 14 Feb 2019, 22:33

I'd say that the 10 point average would swallow those pretty good but yes adding some if to that Let,1,[Temp#Value] could be a good thing. Thanks for suggesting that.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests