Erickm12
Member
Hello,
I am working with a laser encoder that is providing the speed of a fiber strand to our AB 1756-L61 PLC.
In order to calculate the amount of fiber used as a percentage of all other components, the speed of the fiber needs to be averaged over a period of at least 15 seconds (due to the number oscillating) and then I can use the averaged number to calculate the percentage.
While the speed osciallates by approximately +- 10 yd/min every at around 250 yd/min, sometimes the speed is drops down to zero due to unpredictable bounces in the fiber prior to going through the encoder. This results in a couple of 0 yd/min results for the encoder per minute.
So, what I am interested in doing is averaging the data only if the speed is greater than zero, but I am not sure how to go about it. Do I print the results into an array and then average the array? Do I use a moving average? What about a FIFO averaging? I would imagine that there is a scenario in which any of these may work, but I would guess that there is a hard way of doing it and then there is an easier way to do it.
I am a beginner with PLCs, I have some exposure to programming them and have taken the first course that Rockwell offers, but the majority of my learning has come from online searching.
I tried to be concise about the question I have, but if you need more information I am happy to provide more.
Thanks!
I am working with a laser encoder that is providing the speed of a fiber strand to our AB 1756-L61 PLC.
In order to calculate the amount of fiber used as a percentage of all other components, the speed of the fiber needs to be averaged over a period of at least 15 seconds (due to the number oscillating) and then I can use the averaged number to calculate the percentage.
While the speed osciallates by approximately +- 10 yd/min every at around 250 yd/min, sometimes the speed is drops down to zero due to unpredictable bounces in the fiber prior to going through the encoder. This results in a couple of 0 yd/min results for the encoder per minute.
So, what I am interested in doing is averaging the data only if the speed is greater than zero, but I am not sure how to go about it. Do I print the results into an array and then average the array? Do I use a moving average? What about a FIFO averaging? I would imagine that there is a scenario in which any of these may work, but I would guess that there is a hard way of doing it and then there is an easier way to do it.
I am a beginner with PLCs, I have some exposure to programming them and have taken the first course that Rockwell offers, but the majority of my learning has come from online searching.
I tried to be concise about the question I have, but if you need more information I am happy to provide more.
Thanks!