Author Topic: Adapting from Parallel port to USB  (Read 4903 times)

Offline David Jupp

  • Sr. Member
  • ****
  • Posts: 308
  • Country: gb
  • Teesside - UK
Adapting from Parallel port to USB
« on: February 05, 2017, 10:48:20 AM »
I have a couple of CNC machines, a small Chinese mini-mill (more of an engraver really) and a Denford Novamill.  Both are controlled using old PC's via the parallel port.  Added to that one PC is a bit temperamental (motherboard to CPU connection issue), and the other PC is seriously resource limited.

To give me some extra flexibility, and to potentially be able to make the small machine portable (by controlling from a laptop), I wanted to move from parallel port to USB connection to the computer.  I know there are options like the Smoothstepper or current edition PoKeys units which have plug-ins for Mach3 - having seen reference to it in other thread here I took a look at EstlCAM.

EstlCAM is both a simple to use CAM program, and also a machine controller.  As I understand it from the web site, use of the machine controller does not require a licence, the CAM bit does.  It uses an Arduino to interface from USB to the machine.  Rather than throw away stuff that works, I chose to keep the DB25 connector at the machine and build an Arduino Nano board into the shell of a mating connector - currently the USB connector and end of the PCB pokes out about 10mm beyond the connector shell (I'll have to tidy that up).  Putting the Nano in a small box would have been another option (I may try that for the second machine).  For a few minutes with a soldering iron, and at a cost of well under £10 per machine (Nano and female DB25 connector) I can now operate my first machine from EstlCAM via USB.  I can simply remove the adaptor unit if I wish to switch back to Mach3 and the parallel port.

I did find a couple of issues -  first, Mach3 ends up with lost of signals (inputs and outputs)  inverted to give correct operation (all configurable in Mach3).  The Arduino for EstlCAM doesn't give as much choice in configuring these - anyway, I found that the spindle on/off (which I'd added myself to the PCB in the control box, using a SSR) was on when it should be off and vice versa!  After a bit of investigation, I was able to change the internal wiring to the SSR slightly to correct this, and I went back and flipped the output signal in Mach3.

Next issue, when plotting an old toolpath in EstlCAM, I found the arcs had gone crazy.  Christian at EstlCAM advised that it uses relative IJ to control arcs - I had 'Stickfont' set up differently (as I'd needed to, to work correctly with Mach3).  Toolaths that EstlCAM was happy with, displayed crazy arcs in Mach3.  A hunt through the settings screens for Mach3 showed an option to change arcs from absolute to relative IJ - I did that, re-loaded the nc file, all now fine and both EstlCAM and Mach3 seem to be consistent (at least for the very limited testing done to date).

Next I'll build a similar unit for the Denford - it has a few more connections for Home switches, and has a PWM connection for spindle speed.  My biggest problem there is finding where I've put the file with all the connection information from when I converted it from Denford control board to LinuxCNC.

In summary, for very modest cost I have a way to control an existing CNC machine via USB, and controller software with no limitation on number of lines of code.  EstlCAM isn't as full featured as Mach3, but for some users that could even be a benefit.  I can switch back and forth between systems very easily.

I'll apologise now for the lack of pictures - the connector shell is black and all pictures I've taken so far are awful quality.  I'll have to have another go using tripod and maybe extra lighting.

Offline velocette

  • Full Member
  • ***
  • Posts: 152
  • Country: nz
Re: Adapting from Parallel port to USB
« Reply #1 on: February 06, 2017, 02:28:06 AM »
Hi David
Is this along the lines of what you require
https://www.jaycar.co.nz/usb-to-parallel-bi-directional-cable/p/XC4847

Eric

Offline David Jupp

  • Sr. Member
  • ****
  • Posts: 308
  • Country: gb
  • Teesside - UK
Re: Adapting from Parallel port to USB
« Reply #2 on: February 06, 2017, 03:18:43 AM »
Eric - thanks for that but no, though it might work (am a little concerned that the extra overhead of working the parallel port via USB might cause issues for Mach3).

Sorry if I didn't make it clear - I have made up my own adaptor using an Arduino Nano for much less than the cost of that cable. 

Using the Arduino and EstlCAM also offloads the generation of step pulses from the PC - so a less powerful PC is adequate. 

I'm not suggesting the route I took is perfect - it's just another option that might be of interest to some.

[ Added picture below showing complete adapter in DB25 housing, and also the bare Nano board ]
« Last Edit: February 06, 2017, 05:38:54 AM by David Jupp »

Offline David Jupp

  • Sr. Member
  • ****
  • Posts: 308
  • Country: gb
  • Teesside - UK
Re: Adapting from Parallel port to USB
« Reply #3 on: February 13, 2017, 02:33:52 AM »
A brief update:  The Arduino / EstlCAM approach looks as if it will work well for my small engraving mill.  My Denford Novamill has a guard position signal that there is no option to configure within EstlCAM, current plan is to re-locate the PC freed up from the smaller machine and use that to control the Novamill (probably with Mach3 for the time being).