PAC 10.5 Analog Input - Moving Average

A simple questions that I cannot find documented (or I didn’t look in the right place).

The new Moving Average built into the Analog Inputs can be setup to look at X Number of Samples. What determines the rate of each sample ?

A moving average of 10 samples at 1 sec is very different from a moving average of 10 samples at 100msec - both of which I’ve done in the past via logic.

Is it based on every time the configuration reads the point (which may or may not be at a set time base) OR is it based on the brains Analog Scanner Time ? If the later, can this be adjusted because scan time will be different between an EPIC vs PAC or a fully loaded system vs a small system ?

I think this question applies to the original filtering method as well. Some reference to scan rate is made in the pop-up “Command Help” in PAC Control for the SetAnalogFilterWeight command and how it relates to resulting filter. But it doesn’t answer your question as to what the scan rate is or how to know what it is. I have had varying results using this feature so have started to use the original filter equation inside my program (instead of in I/O definition) at my program defined scan rate. I have better results especially in situations with an extremely noisy signal.

BTW, there is no command help for the new command “SetAnalogAveragingValue”.

The command existing (at least in the latest 10.5) but there is no help information:
Set Analog Averaging Value
@dgerdts Sorry - reading this without coffee and misread your comment.

Opto - can you let us know how this is done ?

Of course, it just takes me some time to track down the right engineer and I don’t always post ‘give me a second’… I guess I should, that way you know I have at least read the post…

The key is the data freshness of the module.
Look up that from the modules data sheet. Note that its often different for modules that sound pretty similar (for example, the different voltage analog input modules).

So for example, if the analog input module freshness is 1 second and the filter is set for 10, then it will take 10 seconds for the final settled result to first appear, and then every second after that (so the first 9 seconds will still be settling at your desired filter weight).

If your chosen analog module has a data freshness of 50mSec, then a 10 step filter will take 0.5 seconds.

The filter is a linear FIFO, each data freshness value will be pushed in, the oldest pushed out, the filtered value can be read at the same rate as the modules data freshness.

If you change the filter weight then at that change all the values in the FIFO are dumped and the settling period starts anew.

I will follow up with the docs team to get the manuals and online command help updated. (This command was a two stage rollout which is a little different from most, clearly it got missed in the docs stage).

1 Like

@Beno - thanks for the replay - sorry about being impatient.