Help needed!

Hi all,

I have been scratching my head now on the best and easiest way of calculating the speed of a rising and falling analog input using the compact Logix and the 1769 IF8 input card.
The scenario:
I have a value which starts at 0 and rises to 39.8 meters this gives me my analog input 0m = 4mA and 39.8m = 20mA.

I want to display the real time speed of that changing analog signal which can range from 1m/min to 10m/min.

At the faster speeds the display is pretty stable, I am taking samples every 3 seconds then loading the values into FIFO stack and pulling out the average and it works fine but at the 1m/min speed, the change of the float value is minimal and I lose resolution and the display is not accurate or stable. I have tried FIFO averaging etc to try and iron it all out but to no avail.

Any help would be appreciated gratefully I can post my program when I get to work if anyone needs a look.

Thanks in advance
 
My first thought would be to take a snapshot of the values in the FIFO, compute a best fit line of the data so that you end up with a y=mx+b formula (time being X), and take the difference of the calculated Y values at the time intervals you wish to sample over. This is pretty rudimentary and it does have the effect of putting a low pass filter with a bit of a lag but it may be good enough for display purposes.
 
You can make a timed event and call it every second. At each call store the current value and subtract it from the previus value. That way you will get m/s. Multiply the result by 60 and you get m/min.
If greater resolution is needed call the event more frequently but adjust the multiplier at the end.
 
Your problems are probably caused by sampling so infrequently.

The more samples you take, the better opportunity you will have of averaging them to give a reading that isn't jumping about all over the place. You can store the readings in a "sort-of" shift-register (array) and average the contents continuously.

And if you have occasional "bad" readings (could be introduced by noise, mechanical imperfections, or in my case a non-homologous product to measure), you can employ a simple filtering by sorting the array (use the SRT instruction), and then only averaging only the "central" values in the array.

Example....

Read the analog signal every XXXmS ...
Use COP to shift your storage array, and put the new value at the end (yes, the end, you will need to COP the array backwards)...
Then SRT the array...
Then average all the values in the middle, say 60 or 80% of them...


Obviously the size of the array, how often you sample the signal, and how much filtering takes place can be determined during testing.

Post your program, and if you can take a trend of the actual signal, post the TBS file also (ZIP them, forum rules).
 
at low speeds you will need to make the sampling time longer,
solution:
check every second if change is significant, if not wait until it is,
lets say sig is 1% so at 1m/min it will take 0.4 meter so around 20 seconds
so calcs are 0.4/0.33 is 1,2 m/min
this can be done by checking the value often, and only act when change > 1% now store value for next perod.
 

Similar Topics

Help Needed: Modbus Register Reading – Flygt SRC 311 Hello everyone, I'm integrating three Flygt SRC 311 SmartRun VSDs with an Emerson...
3
Replies
52
Views
Hi everyone, This is an one of those "I can't believe that wasn't done" scenarios. So the PSA is don't blindly trust a third party. Know what you...
4
Replies
156
Views
Respected Sir; I have a HMI and install RSLINK version 3.7 along with Factory talk activation manager But HMI have no internet can i activate the...
2
Replies
168
Views
Hi everyone, I’m struggling with an ABB actuator (CONTRAC RHD 250-10) and was hoping someone here might have run into this before. - Actuator...
0
Replies
185
Views
We need a plc guy willing to travel and has the experience to help us get this project done. We've struggled with staffing agencies and we'd...
19
Replies
1,456
Views
Top