beautypg.com

Digital input filters in detail – Applied Motion RS-232 User Manual

Page 80

background image

80

920-0002 Rev. I
2/2013

Host Command Reference

Digital Input Filters in Detail

Drives have the capability to apply digital

filters to selected digital inputs. With factory
defaults, digital inputs are not filtered through any
means other than the natural response time of the
optical couplers used in the input circuits. Analog
filtering has purposely not been implemented so
as to not restrict the input circuit. However, digital
filtering is available on select digital inputs to
enhance the usage of those inputs.

On occasion, electrical noise at digital inputs

may create a false trigger or even a double-trigger.
This can often happen when using mechanical
switches that “bounce” when activated or de-
activated. For this reason there may be a need
to filter an input to eliminate the effects of these
noise conditions. Digital filtering gives the greatest
flexibility by allowing the user to select the amount
of filtering required to eliminate the effects of noise
or bounce.

The digital filters work by continuously

monitoring the level of the inputs to which filters
have been applied using the FI command.
During each processor cycle (servo and STAC5
= 125 µsec, other steppers = 100 µsec),
internal counters associated with the filters are
incremented or decremented depending on
whether each input is high (open) or low (closed),
respectively. When a command that accesses a digital input is executed, the state of the input requested by that
command will be updated only after the internal counter for that input’s filter reaches a threshold value. This
threshold value is also known as the filter value, and is set by the FI command. The flow chart to the right shows
how a digital filter works.

For example, if we apply a digital filter of 2 milliseconds to input 3 on a STAC6 stepper drive, it means we’d

like the level of input 3 (low or high) to be true for a total of 2 milliseconds before the processor updates the state
of input 3 to the state requested by the command currently being executed. If the command being executed is a
WI3L command, which literally means “wait for input 3 low”, it means the processor will wait until the level of input
3 has been low for a total of 2 milliseconds before updating the state of the input as low and finishing the WI3L
command. If by chance input 3 has already been low for the prerequisite 2 milliseconds when the WI3L command
is initiated, there will be no delay in executing the command. On the other hand, if input 3 is high when the WI3L
command is initiated, there will be an additional minimum delay of 2 milliseconds after the input changes state
from high to low. It is important to understand that any fluctuation of the physical signal, by switch bounce or
electrical noise, will contribute to a lag in the processed signal.

To turn filtering of input 3 on we need to use the FI command. The FI command works in processor cycles

and we’re using a STAC6 stepper drive in this example, so a value of 1 equals 100 microseconds. To filter the
EN input for 2 milliseconds the value of the FI command would then be 2 msec divided by 100 usec, or 20. The
correct syntax for the FI command would then be “FI320”.

As can be seen from the example and flow chart above, the functioning of a digital input filter incorporates

an averaging effect on the level of the input. This means that in the example above, if the level of the input 3 were
fluctuating between low and high over a range of processor cycles (maybe due to electrical noise), the drive would
not update the input state until the internal counter value went to zero (for a low state) or the filter value (for a
high state). Another example of this averaging effect is if the input were connected to a pulse train from a signal
generator with a duty cycle of 51% high and 49% low. The input state would eventually be set to a high state,
depending on the time value used in the pulse train.

This manual is related to the following products: