CNC

Arduino Parallel Controller.


Most computers purchased today don't come with a Parallel DB25 Port, although expansion cards can be purchased they aren't always the best solution. So how can a new Computer that only has Serial USB Ports be used to control a CNC machine with a Parallel connector?


The answer is a Micro Controller with some Firmware installed, the Firmware has to be capable of Interpreting G-Code, and needs to be customized for the Machine, Pins need to be set and other things like Limit Switches need to be considered, for example a Limit Stop may be a Normally-Open Switch or it may be a Normally-Closed switch.


You can find Firmware for this free online for ARM (Arduino) Micro controllers, one such example is GRBL; this software can be used with the following Hardware:


Once the Arduino or device above has GRBL installed and the Settings have been changed, it's time to look at the Parallel Driver, the Red-TB6560 driver found on E-Bay or Amazon is a common inexpensive driver that connects to the Computer using a DB25 connector and can be connected to the Arduino I/O's (In Out pins) directly.


To connect a Parallel Driver the “Pin-Out” needs to be known, each control card used will have a different pin-out, for example the Red TB6560 will use different pins to drive the motor(s) than an “EasyDriver” would, everyone makes things different.


Pins required:


“X”

-Step

- Enable

-Dir


“Y”

-Step

- Enable

-Dir


“Z”

-Step

-Enable

-Dir


These Nine Pins are the only ones required to control a very basic 3-Axis CNC machine, one additional Pin maybe used as an Emergency Stop, or use twelve pins to have a limit on each axis.


If the Proper Pin is connect into the correct Arduino I/O Pin (set in the firmware), the machine will be mechanically ready to be controlled by your Personal Computer, however the Control Software known as Machine Software will change.


An example would be from Mach3 or EMC (Linux-CNC) Server Side control software (Machine Software) to Pronterface Machine Software.


How to determine settings:


“Step” is determined by using the known step angle of the motor (for stepper motors) and dividing it by 360 degrees then multiplying that number by the threads per inch or how many turns a Pulley or Gear drive needs to spin in order to move one inch, same for metric Millimetres.


“Enable”ing the motor is done when that Pin is Energized, or for some designs De-Energized (Break the circuit).


“Dir” or Direction is triggered the same way as the Enable pin is, only high will move one direction and low the other direction.


Motors, switch from a Stepper to a Servo Driven machine: Like a Stepper Motor Servo Motors Use Pulses to move a specific amount, but instead of using PWM we use PPM:


http://web.uvic.ca/~chengli/seng466home/SENG466_Home/Phase_1/Entries/2010/2/1_Servo_Motor.html


http://electronics.stackexchange.com/questions/129961/how-to-get-the-pwm-frequency-and-duration-of-each-pulse


C++ further examples:

http://ww2.odu.edu/~agodunov/book/programs.html

http://www.physics.utah.edu/~detar/lessons/c++/


Next to be covered is MODBUS.

@Crabb

CNC