Sign in to follow this  
Followers 0
machinemaker

analog filtering

19 posts in this topic

I am using RSlogix 500 on a Micrologix 1100. I want to filter the analog coming in. It is jittery. I can not find an instruction to do the filtering. I read a couple of other posts for other models and could not believe what they were saying. It was taking like 5 or 6 rungs to do something I thought would be simple. At least it is using other brands which I will not say which one. :) Any suggestions. thank you.

Share this post


Link to post
Share on other sites
Quick and dirty filtration: Use a CPT (compute) function and use the following formula. Replace tag names with appropriate addresses. You'll most likely want to use floating point. Input_Filtered = Input_Filtered + Filter_Constant * ( Input_Raw - Input _Filtered ) The Filter_Constant should be in the range 0.01 - 1.00, and the closer to one it is, the less filtration there will be.
1 person likes this

Share this post


Link to post
Share on other sites
I just created a new project using the 1100 Series B. In the I/O Configuration, select on the part number in slot 0. The Adv Config button lights up, select that nad navigate to the Embedded IO Configuration tab. From that spot you have some selection for filtering.

Share this post


Link to post
Share on other sites
I am using a 1762-if2of2 card in slot 1. I did see for slot 0 there is filtering. I do not understand where Input_Filtered comes from.

Share this post


Link to post
Share on other sites
It's a recursive algorithm, where the result from the previous scan is used in the calculation for the current scan. I've attached a spreadsheet that will hopefully help. InputFilter.zip

Share this post


Link to post
Share on other sites
Input_Filtered is a parameter. Like for the equation A^2 + B^2 = C^2, A, B, and C are parameters. For your project you would replace the parameter in the equation with a register, like F8:0. He just as easily could've called it Bob but then it wouldn't make sense. Input Filtered is the result of the calculation. So you need a place to store the data. Input_Raw would be replaced with the input data that you want to filter. Filter_Constant is another register that you would store the constant in, for instance, F8:1

Share this post


Link to post
Share on other sites
Example: Input_Raw = F8:0 Filter_Constant = F8:1 (0.01 to 1.00) Input_Filtered = F8:2 F8:2 = F8:2 + F8:1 x (F8:0 – F8:2)
1 person likes this

Share this post


Link to post
Share on other sites
MY brain is a little fuzzy being on day shift while I normally work nights, but you'll also want to preload F8:2 to either F8:0 or zero on first scan. Can't recall the logic of which and why right this minute.

Share this post


Link to post
Share on other sites
Shift change is such fun Im thinking F8:2 needs to be zero so that you don't get "instant filtering to some unknown value)

Share this post


Link to post
Share on other sites
I would think you'd want to set Input_Filtered = Input_Raw on the first scan so that you start off at the true input value, and just filter changes from there. Starting at 0 (or whatever happened to be there) means it could take a few scans to get into the right range. That may not be critical to most applications, but it's good practice.
1 person likes this

Share this post


Link to post
Share on other sites
the CPT command is not available in the Micrologix 1100. AB sure needs to catch up with the times. Very limited commands in the micrologix. I think they are really missing it. It takes more rungs then necessary to do something so simple in other manufacture's programs. AB does have a solid product, but I hate to use the word, barbaric. I have no choice, I am told I have to use AB for certain projects.

Share this post


Link to post
Share on other sites
Yes, the 1100 is an old product. The 1400 has that instruction as well as an on-board Ethernet/IP port.

Share this post


Link to post
Share on other sites
1100 has an on board Ethernet port

Share this post


Link to post
Share on other sites
The 1100 isn't much older than the 1400 and also has an on-board Ethernet port. Perhaps you're thinking of the 1000?

Share this post


Link to post
Share on other sites
Keep in mind if you're using a 1762-IF4 the total update time isn't necessarily what you select on an individual channel. It is the AVERAGE of ALL FOUR channel filter settings, even the ones you aren't using. So if you want a 450ms update time, you need to set all four channels to 450ms in order to achieve it.

Share this post


Link to post
Share on other sites
Oops, yes. That's exactly what I was thinking of. :(

Share this post


Link to post
Share on other sites
Does it matter how often you call the filter routine? Seems like that would have some bearing on how it functions.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0