Sign in to follow this  
Followers 0
semilogical

Buffering analog signals to remove spikes.

8 posts in this topic

I have accomplished this task before using the CPT function but I haven't done it for a few years and have lost the database I had with the code in it. IIRC I basically programmed it like this: SLC-5/05 CPT Destination: I:6.1 Expression: (I:6.1 * 0.1)+I:6.1 This works to dampen the spikes in the signal, but I'm adding 10% of the value back to the analog input. The base value is not critical, but if I want to be accurate I need to buffer the signal in the proper manner. Anyone have any experience with unstable analog inputs? I'm following a pressure transmitter for a process of waste gas in a Marine Transfer Combustor System. The signal drives a VFD that responds to maintain a level of pressure. You expect some movement but not in as wild of a manner as I have seen. We could hook up the HART handheld and buffer the signal but in case the transmitter fails the customer does not have the sharpest instrument techs in town. Any help would be appreciated.

Share this post


Link to post
Share on other sites
that doesn't buffer anything, it just increases input by 10%. instead of just one operation (multiplication by 1.1), also has addition. analog cards have filters, if this doesn't help, maybe small capacitor would. software equivalent would be to calculate average for last few samples. sampling time can be adjusted depending on frequency and duration of the spikes. one could also reject sample that differs significantly from the average and recalculate.

Share this post


Link to post
Share on other sites
((Raw Data - Filtered Data) * 0.1) + Filtered Data = Filtered Data Adjust the 0.1 factor for more or less filtering

Share this post


Link to post
Share on other sites
Thanks for the replies. Panic Mode, The original formula [expression] did buffert he signal, but did add the 10%. The only explanation I have for the buffering effect is the additional scan time involved with the computation. Mickey, The filtered component is what I was forgetting in the equation and destination. Once I saw your note I knew that was it. Both, Thanks for the brain nudge, today I needed it.

Share this post


Link to post
Share on other sites
You can try a software first order lag filter as well. Search the forum, they have been discussed before.

Share this post


Link to post
Share on other sites
Building on earlier posts I was shown this explanation of a first order filter and found it very good. Given : Filter_Percentage is a number between 0.01 and 0.99 Use an equations like this New_Filtered_Value = (Raw_Data * (1- Filter_Percentage) + (Old_Filtered_Data * Filter_Percentage)) Old_Filtered_Data = New_Filtered_Value The effect is a spike in Raw Data is only has a portional change in the final filtered data. We are using 0.90 filter on a flow measuring process with great success.

Share this post


Link to post
Share on other sites
Mickey's post shows a first order lag filter. What everyone leaves out is how to calculate the filter constants in terms of cut off frequency or time constants. Another point that is over looked is that filters can be cascaded or one can use higher order filters make the filter more effective.

Share this post


Link to post
Share on other sites
Hi, Dont know if this helps totally, but I had a temp control application, where the PV was fluctuating and had spikes. In RSLogix5000, I worked out 2 ways to compensate for this: 1. Used an MAVE (Moving Average) block in FBD to condition the input signal for giving an average value taken at 100ms intervals over a 10 sec period. You can also program the logic for this block in Ladder using STI / Timer etc. This enabled me to smoothen the PV. 2. Used a rate limiter to cut out spikes. You can also program this block in ladder but would take a slightly more complicated program to convert the Rate Limiter block in ladder.

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