Smoothing Analog Inputs

You can, but not necessary. It will just update every scan.

Just adjust the filter constant to get your desired results.

I usually use a bit from the free running clock and a 1-Shot preceding the math so that I am sure to have a regular controlled filter when doing this in a Micrologix. This is especially important if I have things going on that might make the scan time irregular.
 
You can, but not necessary. It will just update every scan.

Just adjust the filter constant to get your desired results.

Right, but it'll give an extra parameter to slow the filter down a bit. I worked with a couple of boiling solutions and adding a timer allowed you to smooth the filter even better.

This gives a smooth line (trend) instead of constant up and down.
 
Right, but it'll give an extra parameter to slow the filter down a bit. I worked with a couple of boiling solutions and adding a timer allowed you to smooth the filter even better.

This gives a smooth line (trend) instead of constant up and down.

that doesn't make sense to me. By adding a timer that makes the filter run less often it is just decreasing the sampling rate. If the filter doesn't appropriately account for time then it would slow down the filter, but if the filter knows how long it has been since the last time it has run and is calculating change over time correctly then decreasing the sampling rate but keeping the filter time constant the same should make the output more bumpy not smoother.

If you increase the filter time constant the output should change slower and smoother. Generally it is better to sample as fast as possible, although it might not be necessary for signals which change slowly.
 
that doesn't make sense to me. By adding a timer that makes the filter run less often it is just decreasing the sampling rate. If the filter doesn't appropriately account for time then it would slow down the filter, but if the filter knows how long it has been since the last time it has run and is calculating change over time correctly then decreasing the sampling rate but keeping the filter time constant the same should make the output more bumpy not smoother.

If you increase the filter time constant the output should change slower and smoother. Generally it is better to sample as fast as possible, although it might not be necessary for signals which change slowly.

Right it slows down the sample rate. If the sample rate is 0.001 of a second or even up to like 0.01, it just smooths it out better than going off of the scan rate. Or you can make the timer 0, but I usually like to build this out like an AOI and I would rather have the extra parameter just encase.
 
sampling at a higher frequency should result in a smoother output than filtering at a lower frequency. If that is not true then the filter is not calculating or using delta-t correctly.
 
Found this thread and it worked perfect for what I needed to filter some flow signals feeding a PID loop. I needed to use it in FBD so I made an AOI block and figured I would share it.

Pretty simple, unzip, import AOI. Rename it if you like and enjoy. Thanks Mickey for the code.

AFB.jpg
 

Attachments

  • AFB.zip
    1.1 KB · Views: 14

Similar Topics

Hello, I'm pretty new to RSLogix 500. I'm trying to smooth out the raw analog input. Current 4-20ma. I'm in an environment that I can not control...
Replies
5
Views
2,961
Hello, I am using a P1000 CPU (P1-540) with a P1-04DAL-2 and a P1-04ADL-2 I tried doing a data transfer now I am trying to scale them both...
Replies
0
Views
1,105
Good Morning, So i have attached some really crude programming to try and work around my inability to smooth an anlog signal (actually several)...
Replies
22
Views
8,559
I am trying to make an input less jumpy. The monitored input has large spikes, and changes too fast. I am trying to smooth it out. I am using...
Replies
2
Views
2,130
Good morning guys, So i know this is extremely basic, but im just starting our with analog signals and trying to wrap my head around it. I...
Replies
10
Views
4,319
Back
Top Bottom