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
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
Materials
- Arduino UNO
- 3x RS422 Shield for Arduino
- incremental encoder (Sick DFS60)
Tools
- Screwdriver
- laboratory power supply
Some Basics
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
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
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
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....