Filter analog input Logix5000

Thanks Ron, I will have a go with your suggestions this evening.

Compactlogix L32E, with point on 1734-AENTR

The time units are in seconds, I will get a more accurate graph using Ignition if problem persists after RPI tinkering
 
if you can't smooth out the signals, then you might want to post your ENTIRE project file (ACD) ...

because ...

with some COMPACT-Logix setups, the way your various task priorities are configured can mess with your I/O updates ... we might be able to offer some suggestions along those lines ...

I will get a more accurate graph using Ignition if problem persists

all of the graphs that I posted (in the linked treads) were done with nothing more than the built-in "Trend" feature of RSLogix 5000 ... if your version has that feature, that's probably all that you need ...
 
Last edited:
The FV = FV+C(NV-FV) needs to be triggered at a fixed period, say in a periodic task.

After (Execution period / C), you will have reached ~63% of your final value. gives you an idea of what to set your execution period and C value at.

eg execution = 50ms, C = 0.1. reaches 63% in 500ms.
 
The time units are in seconds, I will get a more accurate graph using Ignition if problem persists after RPI tinkering

This spike appears to last for many seconds. You should find and correct the source of this problem rather than trying to mask it/filter it with software.

You may find the source by patient field observation, review of level sensor installation requirements against actual field installation, tracing of wiring, and or looking for patterns in the sequence of events/operations. This latter recommendation can be helped with software; create an event the represents the signal spike and log its occurrence along with lesser events including processing steps and the status of nearby equipment.

There may even be a person in the field performing a task that inadvertently is causing this problem.

This all sounds like more work than your current approach, but it should put you on the right road to actually solving this problem.
 
My data logging PC died in January and I then ran out of oil before I had a replacement sorted, so this went on the back burner (pun intended).

I'm now back armed with more data from SCADA, see attached. http://i68.tinypic.com/x5ni3s.jpg

view.php
x5ni3s.jpg


The sensor goes via a 3m cable to point IO. I think the most likely culprit here is the location of the sensor in the tank. Unfortunately, there is only one port so it can't be moved.

I tried adding an average pen to the scada trend, however the spikes are so high that it brings it up too much from the real value.

I can see by x-tracing that I'm using ~5L/day, but that's a manual process and I want it auto-reported/logged.

With this info, what would you suggest is the best method to move forward... debounce?

spikes.jpg
 
Each bump lasts around 20 seconds, so if I check every 30 seconds if current value != +/- say 5 litres compared to value_30secs_ago then ignore?
 
That would be one way to do the debouce, and it should be fairly effective. You mentioning you have a datalogging PC just gave me a pretty good idea on building one for cheap. I'll have to add that to my toolkit, especially with the upgraded PI hardware. Ardunio and serial could do it pretty easily as well.

Anyway, the debouce would work. In my case, there wasn't much I could do about the valve shifting other than install an accumulator, and though the process was critical, the system of temperature detection and necessary actions wasn't as critical as say, a pressurized chemical transportation or reaction would be.

I'm not sure *exactly* what this process is, but you may also want to store those values elsewhere that aren't visible so you can check them out later.

That aside, if this process is similar to mine in the effect that your oil tank level isn't absolutely vital and you can handle missing a few readings, why spend more time on it.

One last thought here. Is the sensor mounted on the side of the tank? Is it possible that you are getting some kind of turbulent flow into the tank causing the liquid to splash around? Is it a manual-type valve (such as a ball valve) that would jostle the liquid around or such?
 
That would be one way to do the debouce, and it should be fairly effective. You mentioning you have a datalogging PC just gave me a pretty good idea on building one for cheap. I'll have to add that to my toolkit, especially with the upgraded PI hardware. Ardunio and serial could do it pretty easily as well.

I'm not sure *exactly* what this process is, but you may also want to store those values elsewhere that aren't visible so you can check them out later.

The old PC ran aHMI, on a dual core 775 socket... cheap. The new server runs Ignition. The trends you see are logged to SQL 24/7. The SCADA server is an octo-core, decahex-thread with 32GB ram and a separate SQL server. Not cheap, but look at how much prettier the trends are :cool:

The process is domestic heating. I started off with some hardware in my home office and have expanded it over multiple rooms. The oil tank is filled once a year.


That aside, if this process is similar to mine in the effect that your oil tank level isn't absolutely vital and you can handle missing a few readings, why spend more time on it.
It's fun and I'm learning in the process. If I come across this in an industrial situation I will be able to apply what I've learned here.


One last thought here. Is the sensor mounted on the side of the tank? Is it possible that you are getting some kind of turbulent flow into the tank causing the liquid to splash around? Is it a manual-type valve (such as a ball valve) that would jostle the liquid around or such?
The sensor is on the top and the outflow is at the bottom through a 10mm pipe. The liquid is essentially static.
 
I searched the forum for logic for debouncing, not much there mainly for digital signals. I conjured up some which is basically my above pseudo-code only a longer time base. It works most of the time, but, if there are frequent bumps in a short space of time the debounce takes this value. I think this happens if the value 47-48seconds from timer being done is a high bump, then it will accept this as a good value.

Any suggestions for improvement?

Thanks,

red line : debounced (oil_db)
blue line: raw (tank_level)

EDIT before I submit lol: when checking my images uploaded ok, I noticed a school boy error - I got my A & B mixed up on the subtract. With that now fixed I still have one bump got through... when they were very frequent





 
I've thought of a solution, the bumps go to ~1300L but it's an 1100L tank. So if I add a lim in series after the one on rung 7, low limit 0 high limit 1100 test tank_level before tank level is MOV'd to oil_db
 
I've thought of a solution, the bumps go to ~1300L but it's an 1100L tank. So if I add a lim in series after the one on rung 7, low limit 0 high limit 1100 test tank_level before tank level is MOV'd to oil_db

I would advocate finding what is causing the out-of-range "bumps".

In any situation where you get unexpected readings, it is best to eliminate them, rather than just sweeping them under the carpet.
 
I would advocate finding what is causing the out-of-range "bumps".

In any situation where you get unexpected readings, it is best to eliminate them, rather than just sweeping them under the carpet.

I still strongly agree with this. In this case you have something physical causing these issues. When I used a debounce system, my spikes were for about .25-.5 seconds. These are going on for minutes. It is time to start really looking at the physical in this process. Something is making that sensor read bad for minutes at a time.
 
I need to move the point IO rack that this is wired into this week. I will change the cable to a screened cable.

Even without the bumps I need to smooth the signal further, as over a minute span it is oscillating +/- 1 litre.

 

Similar Topics

Hi! I like to ask is there a way i can filter my analog input?
Replies
1
Views
1,083
Hey fellas, I've got some Point I/O analog inputs (1734-IE8C) that I would like to filter. FYI, this is for some flow meters. The raw...
Replies
9
Views
7,338
This sounds like a stupid question, but I can't find an answer anywhere. I realize that a lower filter freq on an analog input channel results in...
Replies
10
Views
3,483
I have an analog signal that has a small amount of noise. It is on an RX3I PLC and the analog in module (IC693ALG442) does not have filter...
Replies
35
Views
9,306
How does one configure a 'delay' block or 'lead/lag' block in a Modicon quantum PLC? Wish to delay an analog signal by a few seconds to I can sum...
Replies
1
Views
1,749
Back
Top Bottom