Time Average in Ladder Logic (ControlLogix AOI)

I’ve needed a time-average function several times, so I figure other people have also.  Here is a handy AOI which makes it easy to use in a ControlLogix ladder program.  (AB has the Moving Average MAVE instruction in function block and structured text environments but not ladder)  I use this instruction when I’m trying to control something from a signal that jumps around too much.  The instruction takes samples from the input at the interval you set it to, and outputs the average of all the samples.  I’ve included the import file and screenshots of the ladder code.

AOI:  TimeAve.L5X.zip

Screenshot from 2014-08-29 14:21:54

 

Screenshot from 2014-08-29 15:59:42

Screenshot from 2014-08-29 14:22:47

Screenshot from 2014-08-29 14:23:20

Screenshot from 2014-08-29 14:23:33

 

Here is a sample of how the TimeAve instruction is used.  As shown it will give the average of 8 samples taken at 100ms intervals:

Screenshot from 2014-08-29 14:18:01

The standard deviation output is a good indicator how ‘jumpy’ your input is.  I’ve used it to wait for a valid number from a scale.

 

This entry was posted in Industrial Automation and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply