Toslink CNC Arduino Shield
CNC machines are usually controlled via parallel bus, containing six signals. For each of the three axes there are two signals: STEP and DIR. At each positive edge of the STEP signal, the corresponding stepper motor moves into direction set by DIR signal. In addition to these six signals, there can also be other general purpose control signals.
On longer distances and in noisy environment parallel bus can be susceptible to the electromagnetic interferences. Therefore, we decided to design an interface, suitable for transport of parallel signals via optical link. To achieve successful transfer trough optical fiber parallel data must be converted to serial bit stream. Moreover, because of the inherent design of optical transmitters and receivers, serial data must also be Manchester encoded.
Our design is based on Serializer / Deserializer for Audio Fiber Optic project, published on Open Cores. We used Xilinx XC9572XL CPLD to implement the necessary logic for protocol conversion. A single CPLD can hold both the serializer for parallel to serial conversion and the deserializer for serial to parallel conversion. For easy prototyping the two XC8572XL CPLD breakout boards from Dangerous Prototypes were used. Arduino CNC Shield, usually attached to an Arduino Uno, was used for controlling the stepper motors. Seven parallel signals are running from Arduino to the shield and three signals back from shield to Arduino. Instead of attaching the shield directly to the Arduino we connected Arduino and CNC shield using an optical fiber and two CPLDs. The suggested prototype has been successfully tested and offers satisfactory performance.
In the next stage of design we created universal PCB, which can be used as a stand-alone stepper motor controller or as a shield attached to the Arduino Uno. PCB consists of one CPLD, three optical transmitters, three optical receivers, headers for Arduino Uno and connectors for Pololu’s DRV8825 stepper motor driver carrier and for PoLabs’ PoStep25-32 driver.
We are planning extensive tests of the designed universal PCB in the near future to evaluate its performance, suggest possible improvements and possibly develop, new, more compact version of the current design.