Configure Encoder Filter

NI-Motion VI

Configure Encoder Filter

Selects the maximum count frequency for an encoder channel by configuring its digital filter.

Details

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
N
NI SoftMotion Controller for CANopen—Xenus
N
Frequency (1.6 MHz) selects the maximum count frequency for the specified encoder.

Frequency Value    Maximum Count Frequency
0 25.6 MHz
1 12.8 MHz
2 6.4 MHz
3 3.2 MHz
4 1.6 MHz (default)
5 800 kHz
6 400 kHz
7 200 kHz
8 100 kHz
9 50 kHz
10 25 kHz
11 Disabled
Board ID is a unique number assigned by Measurement & Automation Explorer (MAX) used to send and receive commands and data to or from a specific NI motion controller.
Axis or Encoder is the axis or encoder to configure. Legal values are 1 through 15 (axes) or 0x21 through 0x2F (encoders). For configuring encoders mapped to axes, you can call this VI on the axis or directly on its mapped encoder.
error in (no error) describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE if an error occurred before this VI was called, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
Bd ID Out is provided for flow control. You can string together NI-Motion VIs by wiring the Bd ID Out terminal of one VI to the Board ID terminal of the next VI.
Resource Output is the Axis, Vector Space, ADC, or Encoder you wired into the VI. Use Resource Output to pass the resource to another VI and/or to display information about the device.
error out contains error information. If error in indicates an error, error out contains the same error information. Otherwise, it describes the error status that this VI produces.
status is TRUE if an error occurred, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.

Using This VI

Setting the maximum allowable count frequency for an encoder is useful for reducing the effect of noise on the encoder lines. Noise on the encoder lines can be interpreted as extra encoder counts. By setting the frequency to the lowest possible setting required for the motion application, you can ensure the highest degree of accuracy in positioning. In choosing the appropriate value, you must take into account the counts per revolution of the encoder and the maximum velocity for the axis in question.

For example, with a 20,000 counts per revolution encoder and a maximum velocity of 3,000 RPM (50 revolutions per second), the encoder signal could be as high as 1,000,000 counts per second. A frequency value of 4, which would correspond to a maximum count frequency of 1.6 MHz would be appropriate in this case.

If you never call this VI, a default value of 4 (1.6 MHz) is used.

Tip  When the encoder filter is changed, reset the position to prevent an erroneous count.