How to Use Industrial Encoders With Arduino

by Zihatec in Circuits > Arduino

4398 Views, 4 Favorites, 0 Comments

How to Use Industrial Encoders With Arduino

IMG_20200206_102637.jpg

Incremental encoders are often used for industrial applications like robotics or positioning tracking. Encoders for industrial applications comes mostly with a differential RS422 interface.

I will show in this small project how to use an industrial incremental encoder - in our case SICK DFS60 - with an Arduino UNO.

Tools and Materials

IMG_20200205_155155.jpg
RS485_Ansicht_mit_Arduino_1_klein.jpg

Materials

Tools

  • Screwdriver
  • laboratory power supply

Some Basics

encoder_signal_output.png
IMG_20200206_110349.jpg

The RS422 output of the encoder is only used als hardware layer. No serial protocol will be transmitted over the RS422. Only the pulses of the encoder itself are directely transfered via 3 different RS422 channels: SIN, COS and Z (zero position).

Because of the 3 independent RS422 channels we need 3 RS422 inputs for the Arduino. For this purpose I've used 3 pcs of my Arduino RS422/RS485 shields - stacked on one Arduino.

Dip Switch Setting of RS422 Shields

IMG_20200206_110449.jpg

The dip switch setting for any shield is the same:

  • S1: ON, OFF, OFF, OFF (receiver always on / transmitter always off)
  • S2: OFF, OFF, ON, ON
  • S3: ON, OFF, OFF, OFF (terminating resistor on)

Jumper Settings of RS422 Shields

IMG_20200206_111244.jpg
IMG_20200206_111158.jpg
IMG_20200206_111331.jpg

The Jumper setting for any shield is different. Depending from the connected channel the RX pin is configured to:

  • Z: D2
  • COS: D3
  • SIN: D4

The voltage jumper JP1 must be setted to 5V.

Wiring

wiring_DFS60.jpg

The encoder can be powered by a laboratory power supply or directely by the 5V of the Arduino UNO

Software and Test

Please compile the attached INO file under the Arduino IDE. After uploading the project to the Arduino you have to open the serial monitor with 115200 baud.

You will see the current increment value (updated all 0,5s) and the current status of the Encoder there....

Downloads