PLC Archive:Analog Input Smoothing

From ControlWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with '{{PLC Archive | page_title=Analog Input Smoothing | author_name=Simone Stefani | program_filename=FC5.pdf | abstract=This function provide to smooth a analog input. The function …')
Line 6: Line 6:
the formula used is:<br/>
the formula used is:<br/>
Out = ([Smooth_factor]/16)[Prev_value]+((16-[Smooth_factor])/16)[Input_value]<br/>
Out = ([Smooth_factor]/16)[Prev_value]+((16-[Smooth_factor])/16)[Input_value]<br/>
-
S = smoothing factor X1 = initial value/previous output X2 = new input from I/O table<br/>
+
S = smoothing factor X1 = initial value/previous output X2 = new input from I/O table
-
{| border="1"
+
 
-
|+ "Valid entries for S smooth factor"
+
{{{!}}border="1"
 +
{{!}}+ Valid entries for S smooth factor
 +
!If you want to...
 +
!then enter...
 +
{{!}}-
 +
{{!}}Prevent the smoothing
 +
{{!}}0
 +
{{!}}-
 +
{{!}}Provide minimal smoothing
 +
{{!}}1
 +
{{!}}-
 +
{{!}}Provide maximum smoothing
 +
{{!}}15
 +
{{!}}}
 +
 
 +
}}
 +
{|border="1"
 +
|+ Valid entries for S smooth factor
!If you want to...
!If you want to...
!then enter...
!then enter...
Line 21: Line 38:
|15
|15
|}
|}
-
}}
 

Revision as of 19:13, 18 September 2009


Analog Input Smoothing

contributed by: Simone Stefani

Link to File

Click here to view program file.

Abstract

This function provide to smooth a analog input. The function calculate the smooth value by add S/16 of previous value with (16-S)/16 of actual value the formula used is:
Out = ([Smooth_factor]/16)[Prev_value]+((16-[Smooth_factor])/16)[Input_value]
S = smoothing factor X1 = initial value/previous output X2 = new input from I/O table

Valid entries for S smooth factor
If you want to... then enter...
Prevent the smoothing 0
Provide minimal smoothing 1
Provide maximum smoothing 15

Disclaimer

For all material in the PLC Archive, our site disclaimer applies. You take full responsibility for the application of any code appearing on this site, as we have made no engineering evaluation of the code nor are we, or the author, familiar with the details and risks inherent in your application.

Valid entries for S smooth factor
If you want to... then enter...
Prevent the smoothing 0
Provide minimal smoothing 1
Provide maximum smoothing 15
Personal tools