A rotary encoder is a photoelectric rotary measuring device that directly converts the measured angular displacement into a digital signal (high-speed pulse signal). Therefore, the output pulse signal of the rotary encoder can be directly input to a PLC, and the PLC's high-speed counter can count the pulse signal to obtain the measurement result.
Different models of rotary encoders have different numbers of output pulse phases. Some rotary encoders output three-phase pulses (A, B, and Z), while others only output two-phase pulses (A and B). The simplest ones only output phase A.
The figure shows a connection diagram between a rotary encoder that outputs two-phase pulses and an FX2N series PLC.
The encoder has four leads: two are pulse output lines, one is a COM terminal line, and one is a power supply line.
The encoder can be powered by an external power supply or directly by the PLC's DC 24V power supply. The power supply "-" terminal should be connected to the encoder's COM terminal, and the "+" terminal should be connected to the encoder's power supply terminal.
The encoder's COM terminal is connected to the PLC's COM input terminal, and the A and B phase pulse output lines are directly connected to the PLC's input terminals. When connecting, pay attention to the PLC's input response time. Some rotary encoders also have a shielded wire; this shielded wire must be grounded during use.
Note: This article uses the Mitsubishi FX2N series PLC and the Omron E6B2-CWZ6C rotary encoder as an example to introduce the hardware wiring method between the encoder and the PLC. For other series and when using high-speed counting modules, the wiring method should refer to the manual. For the counter number corresponding to a specific terminal, refer to the high-speed counter instructions in the "Mitsubishi FX Programming Manual".