Real-Time Windows Target    

Encoder Input Block

This Real -Time Windows Target I/O blocks allow you to select and connect specific encoder input channels to your Simulink model.

After you have added an Encoder Input block to your Simulink model, you can enter the parameters for this I/O driver. This procedure uses Humusoft's MF604 I/O board as an example:

  1. Double-click the Encoder Input block.
  1. The Block Parameters: Encoder Input dialog box opens.

  1. In the Sample time box, enter the same value you entered in the Fixed step size box from the Simulation Parameters dialog box. For example, enter
  2. In the Input channels box, enter a channel vector that selects the encoder input channels you are using on this board. The vector can be any valid MATLAB vector form. For example, to select all 4 encoder input channels on the MF604 board, enter
  3. Encoders typically use two sets of stripes, shifted in phase, to optically detect the amplitude and direction of movement. The Quadrature mode parameter specifies which encoder stripe edges should be counted.
  1. Quadruple mode yields 4 times more pulses per revolution than the single mode. Therefore, quadruple is more precise and is recommended unless other parameters dictate otherwise.

  1. The encoder interface chip has a reset pin in addition to encoder inputs. This pin is usually connected to the index output of the encoder. However, it can be connected to any signal or may not be used at all. The Reset input function specifies the function of this pin.
  2. The encoder interface chip has a built-in lowpass filter that attempts to filter out any high frequencies which are interpreted as noise. The Input filter clock frequency is the cutoff frequency (Hz) of this filter. The cutoff frequency you specify is rounded to the nearest frequency supported by the chip.
  1. Do one of the following:

  Counter Input Block Output Signals from an I/O Block