One technique I like for this is to maintain an 'integrated error', when this exceeds a certain limit I update the display: To make it concrete, assume we have a new value of the process variable 10 times per second. integrated_error = 0 displayed_value = process_variable for each sample of the process variable (1/10 seconds): error = process_variable - displayed_value integrated_error = integrated_error + error if (integrated_error > ERROR_LIMIT) or (integrated_error < -ERROR_LIMIT) then integrated_error = 0 displayed_value = process_variable endif end for This has the advantage not only that large changes in the process value are reported quickly, but also that even small long term changes are reported eventually. ERROR_LIMIT controls the tradeoff between displayed jitter and responsiveness. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: "Russell McMahon" To: Sent: Thursday, April 26, 2001 6:04 AM Subject: [PIC]: Antijitter digital display filter > I'll put this under [PIC]: although it obviously has more general > application. > > I'm looking for good ways to reduce "LSB jitter" in a digital display. > Jitter is due both to LSB quantisation and genuine process jitter. > > Has anyone got any better suggestions than the following???? > > I effectively wish to display a varying process output on a digital display. > With stable input the LSB "hunts" and in some cases there is a slow > semirandom variation of process output. I wish to minimise LSB hunting and > "smooth" genuine variations while not excessively compromising accuracy or > response time. (As usual, choose any two :-) ). The genuine process output > varies more rapidly and widely than is desirable for user viewing. A > significant amount of filtering has already been carried out as part of the > overall processing. This portion relates entirely to user-sanitising a > genuine data variation. > > The display is 3 digits, 0 <= DISPLAY <= 500 > Accuracy of result is to some extent less important than display stability. > The various median and averaging filters discussed here may be applicable > but something cruder and simpler may suffice. > I have run several simulations and get quite good results from the following > 2 simple filters. > > FILTER1 > > IF NEW > (OLD+x) then OLD = NEW-x > IF NEW < (OLD+x) then OLD = NEW+x > DISPLAY OLD > > ie if the input differs from the display by more than X move the display to > within 2 counts of input > > Setting X = 2 produces quite impressive improvements without adding > excessive "flat spots". > X=1 is still too jittery > > The filter > > FILTER2 > > IF NEW > (OLD+x) then OLD = NEW > IF NEW < (OLD+x) then OLD = NEW > DISPLAY OLD > > ie if Input differs from display by more than X then set display to input. > > is substantially inferior in display stabilisation. > It frequently pulls the display to the peak value on a short local peak > rather than reducing the range of fluctuation as in FILTER1 > > > > > Russell McMahon > _____________________________ > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu