Studio 5000 - CompactLogix

DMByars

Member
Join Date
Aug 2020
Location
Oklahoma
Posts
2
I am trying to figure out the best way to get a moving average for an automated machining cell with cycle times of a couple of minutes for each cycle.

Also, if possible to disregard times where the cycle was abnormally long due to operator intervention; tool changes, first article, etc.

Thanks
 
You can create an array and have a pointer that points to each array and store cycle time there. If you know what your average cycle time should be, you can have a GRT instruction and say if your cycle time is Greater than what you expect, then don't store this into the array. Then take an average of all numbers in the array to get your moving average.
 
Hi, and welcome to the forum.
I worked on a program for a framing machine--built frames for trucks. This attached zipped routine is a time average for a tool cycle, what we called "bullpin to bullpin" on the fixture. I believe there are provisions for a faulted cycle or a delay of some sort. I just exported the routine and zipped it (forum rules) Hope this helps and LMK if you need help with it or can't open it. Best of luck
 
I assume there is one measurement sampled per cycle, and the moving average is over several (N+F) cycles, with the measurement for some (F) cycles filtered out, so after some startup time, there are always N measurements in the moving average.

I would think a timer that is reset and starts with the cycle, e.g. a one-shot of
Code:
XIC CYCLE_DONE   XIO TIMER.DN   ONS ...
should be adequate for the filtering. So

  • If a (normal) cycle completes while the timer is still running, then [XIO TIMER.DN] will be true and the one-shot will trigger adding the value to the moving average instruction/process*.
  • If a (by-the-operator-delayed) cycle completes after the timer has expired, then the [XIO TIMER.DN] will prevent a rising edge from assigning a 1 to the one-shot, so no value would be added to the moving average.
One thing to mention is that the delay of the [time of the mean or median of the samples] from the [latest moving average from those samples] will depend on the filtering history, so if the moving average is used for anything besides reporting and trending, e.g. if it is used for control, that will affect the process e.g. a PID with the moving average as its PV might be porly-tuned for highly filtered data.



* I imagine The Google will find any number of open-source moving average AOIs and/or examples.
 

Similar Topics

Good Evening , I have version 28 of Studio 5000 from a few years ago . If I got a new CompactLogix CPU , what is the lowest version of...
Replies
4
Views
436
I'm trying to configure the IP address of my compactlogix l16er-bb1b in Studio 5000. I need to set it to a certain address as I'm planning on...
Replies
5
Views
3,002
Hi everybody: Is it possible to program the compactlogix 1769-L32E LOGIX 5332E v20 processor with this software? thanks
Replies
2
Views
5,185
I want to create a lookup table AOI. Does anyone know a practical way to implement this? For example, The AOI will receive an integer and an...
Replies
2
Views
2,328
I'm trying to connect to a 1769-L33ER CompactLogix PLC through a VPN. When I'm on the same network, everything works great. I can download code...
Replies
1
Views
2,730
Back
Top Bottom