View Full Version : Analog filter for micro 1000
gordy stenberg
April 27th, 2006, 10:23 AM
Newbie here. Went through the bouncy analog signal threads for SLC 5 series and got some good tips, but I also have micrologix that doesn't have the compute function. Any ideas for the 1000 filter?
Tom Jenkins
April 27th, 2006, 11:31 AM
This is filtering the hard way. It was written for a ML-1200, but you should be able to adapt it to the ML-1000 easily.
jstolaruk
April 27th, 2006, 11:38 AM
This is filtering the hard way. It was written for a ML-1200, but you should be able to adapt it to the ML-1000 easily.
Not too easily. The ML-1000 doesn't support floating point.
gordy stenberg
April 27th, 2006, 11:44 AM
no scale with parameters either. There was a ffl ffu example I saw in another thread but it didn't work right. It would hit 32768 and fault the processor. I unlatched the overflow trap so it wouldn't fault and played around with it alittle but no luck. Any other ideas?
Tom Jenkins
April 27th, 2006, 12:30 PM
The filtering can be done with integer math. Just use a divide by integer number of points instead of the multiply by a float.
Attached is a PDF showing how we implemented the same filtering algorithm in AutomationDirect.com with just interger math.
Scaling can also be done with four function math - here is the theory:
For any unit conversion on any PLC you can use four function math with the following, which
asumes integer math:
DataOffset = Data in input register at 4 mA (or zero analog signal of whatever range
- for example 0 VDC on a 0-10 VDC transmitter)
DataSPan = Data at 20 mA - Data @ 4 mA
FACTOR = arbitrary factor (multiple of 10) needed to get proper resolution and accuracy
EU = Engineering Units x FACTOR
EUOffset = Engineering Units @ 4 mA x FACTOR
EUSpan = (Engineering Units @ 20 mA - Engineering
Units @ 4 mA) x FACTOR
DATA = Actual data reading in input register
EU = ((EUSpan x (DATA - DataOffset))/DataSpan) + EUOffset
ProcessValue = EU / FACTOR
For Example, 0-60 psig from 4-20 mA with resolution of 0.1 psig:
FACTOR = 10
Data @ 4 mA = 6240
Data @ 20 mA = 31208
DataOffset = 6240
DataSpan = 31208 - 6240 = 24968
EUOffset = 0 x 10 = 0
EUSpan = (60 - 0) x 10 = 600
DATA = 18975
EU = ((600 x (18975 - 6240)) / 24968) + 0 = 306
Process Value = 306 / 10 = 30.6 psig
And here is an example.
gordy stenberg
April 27th, 2006, 01:40 PM
The ab ladder logic screen shot cut out some of the logic (mlscale.pdf}. Could you retransmit? Thanks!
Tom Jenkins
April 27th, 2006, 01:53 PM
All you're missing is the bottom border of the box - no info lost.
gordy stenberg
April 27th, 2006, 02:17 PM
This logic does nothing. I don't know where to start. What's the n7:46 100 times 100? And the 264 divided by 10000? Tell me this is a joke.
Tom Jenkins
April 27th, 2006, 02:49 PM
If it is a joke, it is being played by Rockwell, not me.
RTFM - specifically the SCL function description. This logic works - the system I extracted it from has been running for a few years now.
.