Diptrace drilling positions

ZOR

Senior Member
Is there a way to import Diptrace pad hole positions into a Picaxe such that it could be converted into XY positions that a very basic XY pcb hole drilling machine could be put together?

My idea being a scenario where the moving drill could be moved from left to right, and then back to left new Y postion to then repeat going across the board from left to right.

If it can be done where would I start. or has someone else done this.
 

Jeremy Harris

Senior Member
It's an interesting idea, and one I've thought of doing a few times. I have a small (A4 size) CNC desktop router that I bought from China a fair time ago with a view to using it for PCB making. I've never really got to grips with routing out PCBs with it, for several reasons, one being that the PCB has to be absolutely dead flat for it to work, and I never got around to making something like a semi-disposable vacuum table to hold the boards in position (double sided tape on a bit of thin scrap ply didn't seem even enough for track milling).

I don't have any problems at all etching PCBs, but even with the accurate, high speed, bench drill I have (a proper PCB drill, with a 3mm chuck) drilling is tedious.

In essence, the control bit is easy. Start with a known reference point (put the board on the bed and then manually position the drill very accurately at the reference corner/hole) and then move to each X-Y coordinate in turn, lower the Z axis to drill, raise it, then move to the next coordinate and repeat. The Picaxe bit is pretty easy, just store the X-Y coordinates of each point, then it's a pretty simple bit of code to move to each in turn. For hobby level boards, that aren't large or have lots of holes, this should be fairly straightforward. The interface is easy, too, just use some cheap stepper drivers and then all the Picaxe needs to do is keep track of X and Y and execute a bit of code to send the right pulse and direction outputs to those axes, together with a bit of code to lift and lower the Z axis (the drill).

The challenge is probably in getting a meaningful set of X-Y coordinates from Diptrace. I've no idea how coordinates are stored in these files, but if there is a way to get them out as text, then it should be pretty straightforward to either pass them to a Picaxe or even just load them in to it via the programming lead.

The whole thing needs a fair bit more thought; the above has just been my initial thoughts, but I think it should be well within the bounds of possibility for such a fairly simple task.

My experience has been that the learning curve for CNC machines is steep, which is why I have a new and almost unused desktop router sat here and a load of parts to build a very much larger router. It seems that the majority of these things are aimed at doing very complex stuff and have software that does everything imaginable. The snag is, if all you want to do is drill a pattern of holes very accurately the thing is far too complex to get to grips with. I'll admit to not having looked again recently, as it's three years or more since I last played with it, so perhaps there are simpler options now available.
 

techElder

Well-known member
Three suggestions:
  • Learn about "gcode" in the "drill" file. Gcode is a language of simple messages to the CNC controller. That code is part of the files that Diptrace produces when you send files out to a PCB manufacturer. Those contain the instructions to the PCB manufacturer's CNC drilling machine.
  • In your scenario of drilling only, all you need is a Z-axis lift motor. Allow the weight of the drill to punch the holes out. If more pressure is needed then perhaps add some spring pressure. The Z-axis stuff is also in the gcode drill file.
  • You'll have to determine when the gcode specifies a new drill size.

Link: https://en.wikipedia.org/wiki/G-code
 

ZOR

Senior Member
Many thanks both. I will carry on looking for any relevent information. I just thought of another idea. If I had copy of the artwork on a seperate pad/base, could I use a mouse type pen/pointer to point on the positions on the artwork and have the XY drill move to the same registerred points. Or could a scanner type device scan the artwork looking for pad holes to get XY cordinates. Just thinking allowed.

It's so tedious drilling holes. I have cut up veroboard which I have drawn outlines on for different IC sockets. I then drill out pin 1 and pin 14 on my pcb. I then use pcb pins to register the vero onto the pcb, and then drill through using the holes in the vero as a template. That allows more accurately drilled IC sockets faster.
 

hippy

Technical Support
Staff member
Here's a thought which doesn't require the complexity and accuracy of a mechanical system to move the drill. It's more auto-assist than automated -

Ensure all PCB holes are on a 0.1" pitch, align and clamp a large piece of veroboard over the PCB, and have the jig illuminate or point to which holes to drill through in turn.

You could probably make a jig which is entirely manually controlled and just have a list of where to position the pointer, six down, four across etc.
 

mikeyBoo

Senior Member
It is possible to build a drilling machine using Picaxe. Problem is mechanical (backlash).
It doesn't make sense to purchase adequate mechanical parts (e.g. ballscrews) to make a tight drilling table & then have to reinvent the wheel with a Picaxe app.
It can be done cheaply with acme screws & a circular table with a Y-axis step, but this would require a discussion too long for a forum topic.

By far the easiest way to go between a PCB design app & a CNC machine is using .dxf files.
Very few cheap CNC machine apps will import Excellon drill files, but most all will import .dxf.
I use a very old Flashcut system with my Chinese CNC table & I make everything from circuit boards to gears using .dxf files.
Having a basic understanding of G & M codes is useful but not mandatory.
It's easy to generate a .dxf drill file using Diptrace or most any PCB design app.
Maybe I need to do a small project illustrating how this happens. Or is this too off-topic for Picaxe?
 

hippy

Technical Support
Staff member
It's easy to generate a .dxf drill file using Diptrace or most any PCB design app. Maybe I need to do a small project illustrating how this happens. Or is this too off-topic for Picaxe?
If it is useful for PICAXE users I don't see there would be a problem with such a project or guide.
 

marzan

Senior Member
With the price of stepper drivers under A$4 and steppers to be found in old photocopiers and printers, it`s a much easier idea to make a smalll CNC drill setup and just export the .drl file from diptrace. you would be building a machine of some sorts anyway, so the mechanics of it all would be similar. I think RAMPS boards (3D printers) have been used to run small drilling CNC machines, and the stepper drivers just plug in to these boards. You don`t need big steppers to make a machine like that. Nema 17`s would be ample.
I have used my CNC machine to do just that for quite a while now. I had a good system to make double sided drilled and milled boards (diptrace -> flatCAM -> D2NC -> Mach3) but have given up for all but concept boards, because a mob called dirty pcb does PCB`s so cheap that I don`t bother anymore.

Marz.
 

grim_reaper

Senior Member
I think RAMPS boards (3D printers) have been used to run small drilling CNC machines, and the stepper drivers just plug in to these boards.
It's suddenly just clicked in my head... why can't a 3D printer be used to make a PCB?!? You can even go with 3D boards - little cubes with tracks on the outside (or inside, with the components on the outside.. but soldering then becomes a weird problem - unless it's all SMT). You don't need a project box then... just the whole thing produced in one go lol.

I'm guessing (answering my own question here...) that finding an extremely conductive material that melts in the printer and hardens enough to conduct on the 'board' would be an issue. Has anyone tried stringing solder through a 3D printer?? :D [Don't try it at school/college kids, unless you've got rich parents!]

I may have to do some further research into this. But if I remember rightly, reading about the 'pro' 3D printers, they have all sorts of materials available instead of the simple domestic 'plastic spool' options.
 

hippy

Technical Support
Staff member
There are conductive ink pens. It might be possible to print a circuit board with raised or sunken tracks and then just fill in where the tracks should be.

I did think sunken tracks might allow for pouring molten solder in after components had been placed but I think there might be heat related issues with that idea :)
 

ZOR

Senior Member
Thanks hippy. I am struggling with my PC. I tried to put visual basic on Windows 7. I was going to try putting an image on a form which would allow me to point and get exportable XY coordinates, however it has severely wrecked my computer. It won't boot up without going round houses with restoring the computer, but also my second hard drive does not show up in disc management. So I am up to ears trying to get working again. Does not help getting trouble shooters either not finding problems or saying cannot fix. Never mind, just put another dart in my MS dartboard.
 

marzan

Senior Member
If you look on the net people have done it. There is a black filament that is conductive. I think the resistance is really high though, so only useful for touchpads and stuff like that. That was a while ago that I looked at it. Probably something better by now.
Marz.
 

srnet

Senior Member
It's suddenly just clicked in my head... why can't a 3D printer be used to make a PCB?!?
I would assume lots of other people have had the same idea, and given that 3D printers have been around for a while now, there must be a good technical reason why 3D printed PCBs dont seem to be available ?
 

inglewoodpete

Senior Member
I would assume lots of other people have had the same idea, and given that 3D printers have been around for a while now, there must be a good technical reason why 3D printed PCBs dont seem to be available ?
Because 3D printers (generally) print with thermoplastics?
 

grim_reaper

Senior Member
I found this article - https://3dprint.com/59360/dragonfly-2020/ which seems to claim that the technology was available a year ago.
Unfortunately, looking at the manufacturer's site - http://www.nano-di.com/3d-printer - they say the first deliveries will be in the latter half of this year, and all you can do is join the waiting list. I dread to think what the price of one of these is!

Give it another few years and we'll be making full blown multilayer boards in a few minutes just for prototyping!
 

Svejk

Senior Member
Seems like you still have no answer to the original question: yes, Diptrace can export drill holes File>Export>Drill NC.

And go for it, I've made one a few years back out of recycled printer parts, it was fun. Run by14Ms each axis and one 28x1 for comms with pc.
 

ZOR

Senior Member
Many thanks everyone, sorry delay getting back, hard drive decided to go down. Then delay trying to get back on Forum as could not remember my password. Will carry on looking for a way to get Diptrace X/Y drill positions out and convert to some X/Y drill setup. Must be an easy way if I stick to 0.1 grid. Might just try putting an area of pads in a square block on a layout and see what/if anything comes out for use.
Maybe a parallogram arm where one section can be pointed to artwork points, where the other arm holds the drill. Not worried how long the operation would take, just be an easier way to drill outside of my veroboard IC socket templates.
 

ZOR

Senior Member
Found Diptrace made a .drl file for drilling coordinates. I changed the extension to .txt and got this (I did PCB Layout with just 4 pads, no tracks)

M48
INCH
T01C0.0354
%
T01
X+150235Y+004235
X+013235Y+129235
X+004235Y+129235
X+005235Y+145235
X+013235Y+145235
T00
M30

Maybe this can be interogated further. Anyone been there?
 

ZOR

Senior Member
Thanks hippy for the link, interesting and useful. I will go back to my basic pcb pads layout and see if these X,Y coordinates tie in. As you say I would just need to extract XY values, easy to do in visual basic if I knew it would not wreck my PC again putting it on. I think I could import a text file into MS Access and write a query to get it out as wanted. Bit interesting is I had 4 pads on layout but got 5 rows XY data. Will go off now as really not applicable to Picaxe at this stage. Thanks again.
 

MartinM57

Moderator
VB and/or Excel sound a bit heavyweight for simple text extraction - if you want to learn something (probably) new, then look at the awk programming language - a 3 or 4 line program is almost certainly all you need (just might take a time to work out what those 4 lines are :))
https://en.wikipedia.org/wiki/AWK
...and gawk is pretty much identical and works on Windows - just install by running the .exe at
https://sourceforge.net/projects/gnuwin32/files/gawk/3.1.3-2/

EDIT: 2 lines actually..
Code:
/^X/ {split ($0, parts, /[X|Y]\+/)
      print parts[2] "," parts[3]}
..produces
150235,004235
013235,129235
004235,129235
005235,145235
013235,145235

or
Code:
/^X/ {split ($0, parts, /[X|Y]\+/)
      print int(parts[2]) "," int(parts[3])}
..produces
150235,4235
13235,129235
4235,129235
5235,145235
13235,145235

FINAL EDIT: or 1 line in a command window ;)
Code:
C:\Users\xxxxx\Desktop\foo>gawk "/^X/ {split ($0, parts, /[X|Y]\+/);print int(parts[2]) """,""" int(parts[3])}" drill.txt
150235,4235
13235,129235
4235,129235
5235,145235
13235,145235
 
Last edited:

ZOR

Senior Member
Thanks MartinM57, thats good, as you say less effort than VB. Will take a look at Awk. Trying to see why my mouse travelling over the 4 pads I have give different values to the file figures.
X= 15.9 Y = 15.2
X= 15.1 Y = 15.2
X=-16 Y = 13.6
X=-15.1 Y = 13.6
 

MartinM57

Moderator
Try this in Diptrace:
- set the origin (3rd icon from the left on the top ribbon, or via the View menu) to be on one of the holes
- in the File | Export | N/C Drill... dialog, make sure the "Use Design Origin" checkbox at the botttom is checked
- Export the file

..and then check again
- one of the drill points will be at 0,0 - the one you set the origin onto
- the others will be at sensible values relative to that origin

(and my awk script is wrong for negative values of X and/or Y - will fix that later for you)

As far as I know, there is no defined order in which the holes will appear in the N/C Drill file compared with how they look on the PCB

EDIT: revised awk script
Code:
/^X/ {
  split ($0, parts, /[X|Y][\+|\-]/);
  print ($0 ~ /X\+/ ? "" : "-") int(parts[2]) "," ($0 ~ /Y\+/ ? "" : "-") int(parts[3]) 
  }
...note this is not a particularly beginner-to-awk friendly script. Can explain it in words if required
 
Last edited:

hippy

Technical Support
Staff member
I wouldn't worry about how to extract or convert the data in the drill file for now as that will be easy enough however it is done. The main thing is to figure out how the drill file data relates to what is on the board and where the holes have to be drilled.

Perhaps start with just a single hole or two holes; that will make it easier to figure out the order of data, what any 'extra hole' data may be or mean.

Create a sequence of boards with just one hole, create a board with the hole at (0.0,0.0), the next board with a hole at (10.0,10.0) the next at (10.0,20.0). Look to see how those map to the drill file values. Putting holes at integer coordinates which are multiples of each other should make it far easier to figure out the mapping, scaling and any offsets. It will be easier to figure out how 20, 40 and 100 relate to 10 and each other than using arbitrary hole positions.
 
Top