Jump to content

An averaging filter that tightens depending on slope?


Recommended Posts

Hello all,

I have an application where a variable (DBL scalar) is shown in a graph to be bouncing above and below the target setpoint @ approx 1-5sec intervals. In other words, if the setpoint is 1500lbs, the variable bounces between 1250 and 1750lbs, which is +/-250lbs and it does this bouncing @ approx 0.2 to 1 Hz. The customer wants me to show the average instead of the real-time.... so the graph would show a horizontal line @ 1500lbs in the above example. They dont want to see the ripple. So, I pulled out the "Mean PtbyPt.vi" function and as long as I increase the sample length adequately it does exactly what my customer wants. Heres my problem... When the process starts or ends and the weight returns to zero lbs, the mean is very, very slow to respond.

Is there a way to make it "come into" and "out of" the target zone quickly, but filter the heck out of it when it is in the zone? I am thinking of making my own function that would look @ the slope. If the slope is less than a certain threshold, then the "Mean PtbyPt" sample length is long, but if the slope is greater than a certain threshold, then the "Mean PtbyPt" sample length is short. Since I am just learning labview now and I have never used any of the filters or signal processing functions before, I feel like I might be recreating something that already exists? Would any of these help me? FIR, IIR, Chebyshev, Butterworth? I am glad to learn all of these things, but to accomplish my task efficiently without chasing my tail, can anyone point me in a helpful direction?

Thank you very much for any input.

respectfully,

frenchy

Link to comment

QUOTE (VoltVision @ Jan 7 2009, 01:57 PM)

Hello all,

I have an application where a variable (DBL scalar) is shown in a graph to be bouncing above and below the target setpoint @ approx 1-5sec intervals. In other words, if the setpoint is 1500lbs, the variable bounces between 1250 and 1750lbs, which is +/-250lbs and it does this bouncing @ approx 0.2 to 1 Hz. The customer wants me to show the average instead of the real-time.... so the graph would show a horizontal line @ 1500lbs in the above example. They dont want to see the ripple. So, I pulled out the "Mean PtbyPt.vi" function and as long as I increase the sample length adequately it does exactly what my customer wants. Heres my problem... When the process starts or ends and the weight returns to zero lbs, the mean is very, very slow to respond.

Is there a way to make it "come into" and "out of" the target zone quickly, but filter the heck out of it when it is in the zone? I am thinking of making my own function that would look @ the slope. If the slope is less than a certain threshold, then the "Mean PtbyPt" sample length is long, but if the slope is greater than a certain threshold, then the "Mean PtbyPt" sample length is short. Since I am just learning labview now and I have never used any of the filters or signal processing functions before, I feel like I might be recreating something that already exists? Would any of these help me? FIR, IIR, Chebyshev, Butterworth? I am glad to learn all of these things, but to accomplish my task efficiently without chasing my tail, can anyone point me in a helpful direction?

What is your sample rate? Or more specifically, how wide are excursions? Not that I really want to know, but if they are narrow, you could probably use a Median Filter, and if they are wide, you probably need some other kind. Butterworth is a very basic and popular IIR filter.

The other thing I would recommend is to store a waveform for analysis. You can just write it to a Waveform Graph, copy the graph to a new VI, make it into a control (instead of an indicator), and save the waveform as the graph's default value. Then make another graph for the filtered results. Get slightly fancy and drop the original data in there too, and you can see the filter effect plotted against the original data. Now you are freed from the pt-by-pt world, and from having to sit by the machine and you can find something that works well. You could even post it here for suggestions. Once you have a good filter, then worry about getting it to run in real time with some kind of point-by-point function.

I think it's better (but certainly not required) to use a real filter that does what you want than to make something up.

Link to comment

QUOTE (VoltVision @ Jan 7 2009, 04:57 PM)

Is there a way to make it "come into" and "out of" the target zone quickly, but filter the heck out of it when it is in the zone? I am thinking of making my own function that would look @ the slope. If the slope is less than a certain threshold, then the "Mean PtbyPt" sample length is long, but if the slope is greater than a certain threshold, then the "Mean PtbyPt" sample length is short. Since I am just learning labview now and I have never used any of the filters or signal processing functions before, I feel like I might be recreating something that already exists? Would any of these help me? FIR, IIR, Chebyshev, Butterworth? I am glad to learn all of these things, but to accomplish my task efficiently without chasing my tail, can anyone point me in a helpful direction?

Not certain, but I think you're describing a Kalman filter.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.