Programmer Owner manual

76
IQ
®
Programmer Reference Manual
Digital Input Filters in Detail
Drives have the capability to apply digital lters to selected digital
inputs. With factory defaults, digital inputs are not ltered through
any means other than the natural response time of the optical
couplers used in the input circuits. Analog ltering has purposely
not been implemented so as to not restrict the input circuit.
However, digital ltering 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 lter an input to eliminate the
effects of these noise conditions. Digital ltering gives the greatest
exibility by allowing the user to select the amount of ltering
required to eliminate the effects of noise or bounce.
The digital lters work by continuously monitoring the level of the
inputs to which lters have been applied using the FI command.
During each processor cycle (servo and STP-AC5 = 125 µsec,
other steppers = 100 µsec), internal counters associated with the
lters 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 lter reaches a threshold value. This threshold value is also known as the lter value, and is set by the FI
command. The ow chart to the right shows how a digital lter works.
For example, if we apply a digital lter of 2 milliseconds to input 3 on a STP-AC5 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 nishing 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 uctuation of the physical signal, by switch bounce or electrical noise, will contribute
to a lag in the processed signal.
To turn ltering of input 3 on we need to use the FI command. The FI command works in processor cycles and we’re using a
STP-AC5 stepper drive in this example, so a value of 1 equals 100 microseconds. To lter 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 ow chart above, the functioning of a digital input lter 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 uctuating 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 lter 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.
Filter values are non-volatile for all but the SRV-AC5 series of servo drives, if followed by an SA command. With a SRV-AC5 servo
drive, the lter values are lost at power-down and must be set each time the drive is powered on.
NOTE: A side effect of the digital lter, which is true of any lter, is to cause a lag in the response to an input level.
When an input changes state and is solid (no noise), the lag time will be the same as the lter value. When noise is
present the lag may be longer.