Looper89 Posted November 16, 2016 Report Share Posted November 16, 2016 I am working with Filter FB. My goal is to sample 10 times per second and filter then scale the values. There is a picture attached of the current setup. When running Filter_2 doesn't seem to be working. I believe the setup is correct. I have tried putting the elements on different rungs, always with the same result. I am new to Unitronics, I hope there is an obvious solution. Link to comment Share on other sites More sharing options...
cantcliff Posted November 17, 2016 Report Share Posted November 17, 2016 What is your reason for filtering? I ask because there's a built in filtering on the analog inputs you can configure which might suit your purpose just fine. Link to comment Share on other sites More sharing options...
Looper89 Posted November 17, 2016 Author Report Share Posted November 17, 2016 IO-AI4-AO2 doesn't have filtering, at least not a setting for one in the setup. Also, the signals I am filtering are very erratic, I am trying to get an approximate level, we call it density level, in a tank full of fluid with a large amount of gas being pumped into the bottom. A filter that uses reading over a couple seconds works best. Here is what I use : Usable value (UV), Current value (CV) UV = 0.95*UV + 0.05*CV The coefficients can be changed they just need to add to 1. This needs to be executed on regular intervals. I was able to get the code working. Once I used the 'Stop - Download - Run' button instead the 'Download' button things started working more predictable. Learing is sometimes painful. Link to comment Share on other sites More sharing options...
Gabriel Franco Posted November 17, 2016 Report Share Posted November 17, 2016 I suggest you to place every FILTER CONFIG in a single net, also FILTER CALC. I use direct contact of SB15 instead positive transition of SB7. Make sure you don´t use filter 2 operands anywhere else in your code. Link to comment Share on other sites More sharing options...
Isakovic Posted November 18, 2016 Report Share Posted November 18, 2016 I needed a similar filter when I had extremely unstable reading from Pt100 probes. I made it from common elements, but this looks more elegant. I wish I knew there was a Filter FB in VisiLogic. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now