Question details

FC165 moving average

need help on how i can do a moving average. ive been using a FC165 but i need to start and stop this moving average based on some interlocks i dont want to loose the the data when i dont want to average or clear the data that the FC165 collects . any input would be appreciated

Hi,
I see, the problem with adapting / changing S3 is that the current value of S3 has to expire before another value of S3 can be used as the interval timer preset. I had incorrectly assumed that the interval timer preset would reset on tune or adapt of S3, oh well. Flipping in and out of track resets the timer preset but also resets the elements in the moving average register.

Possible alternatives..
a.) Build your own moving average logic. Possibly not that practical depending on the number of elements involved but does give greater flexibility.
b.) Another option might be to use a JUMP (FC116) block before the MOVAVG blocks and simply stop executing those blocks when your interlock is active. Keeping the JUMP block, the blocks to be jumped and the jump destination all on the same sheet, no spare blocks in the jump range and using tuning lines keeps the whole jump thing as well documented as it can be. Make sure any RESTORE blocks attached to the MOVAVG blocks still work correctly on controller restart / mode change.

a few questions for you.
im new to FC116.
First- so with the FC116 it needs to be configured with a digital signal so that would need to tied to the interlock?
also the lo0gic is already configured so the logic I have already would need to have need block addressed in according to the jump block?

Did not know adapting S3 (sample interval) was allowed -- can S2 (number of samples) be adapted as well? Could have used that a few years ago on a loss-in-weight feed rate calculation. FC 165 moving average worked well to smooth out feed rate signal -- S2 and S3 set so it smoothed over 2- 3 minutes. I added track logic for when the weigh hopper filled, because moving average then got a huge wrong answer --- but when normal feeding resumed, had to wait too long for the moving average to get enough consistent samples to work. If S2 and S3 could be adapted to small values while filling, would not have to track.

Hi Cameron,
The FC116 originally appeared with the rung blocks for the LADDER application (SLAD). The FC116 uses a Boolean 0 to force the jump, and a Boolean 1 to operate normally so your interlock will tie in directly. The jump block needs to go before the MOVAVG blocks, preferably immediately before and the jump destination should be directly after. Avoid leaving spare block addresses in the jump region as someone is bound to use them later on and have all sorts of problems with logic that works intermittently. Use a tuning line between the jump and jump destination block, then if the controller ever gets reblocked there is a better than even chance the jump destination spec will be updated correctly. Try and keep everything on the same sheet as well with plenty of comments for those who follow. The jumped block outputs appear perfectly normal in Composer, just constant and good quality, so not easy to spot. If you can't get the JUMP block in online and the controller has the capacity you can add another set of MOVAVG blocks with the JUMP logic and then wait until they fill up before switching over to the new logic. Any RESTORE blocks should still work correctly but it would pay to check before going live.
Hi Bill,
No, S2 is not adaptable as it is not tuneable. With pre BRC400 controllers it was not even able to be changed with online configuration either as changing the number of samples changed the RAM allocation (TB95301B). The BRC400 and later controllers can handle an online change in specs that adjust RAM utilisation (3BUA000972).
Cheers,
Alan

Thanks Alan -- I forgot about the memory allocation -- ran into that problem using FC 165 in MFC05 controllers, but that was years ago. FC 116 (Jump) will definitely help with the weigh bin fill problem I described above.

Answers

0

Hi. You should be able to use the Restore Block (FC140). This block can monitor and store values in the Controllers NVRam. This can be sued to "restore" values after power down, reset and in your case from a calculation reset.