Discussion:
[kicad-users] Conversion of CircuitMaker2000 and Traxmaker PCBs to KiCad
j5ngajrgkdcd3zibhdipuu6lqwvs24xnzds3pyk7@yahoo.com [kicad-users]
2017-04-21 09:04:37 UTC
Permalink
Hello All,

I've decided to move to KiCad from CircuitMaker 2000 (after 17 years!) and would dearly love to import my current PCB layouts into KiCad/Pcbnew.
Does anyone know if this has been done or can be done?

CircuitMaker 2000/Traxmaker will also export in Protel Advanced PCB 2.8 format and dxf.

Thanks.
bobcousins42@googlemail.com [kicad-users]
2017-04-21 12:53:09 UTC
Permalink
I don't have knowledge of that specific software. KiCad can import some Eagle, P-Cad PCB and DXF files with varying levels of success, that is about it. Altium can import/export a lot of formats, obviously that costs money unless there is a "light" version that can do it.

If you can export to a text format, there is the possibility of writing an import tool which could recover most (e.g. 80%) of the data fairly easily with a simple script. I've been working on an Eagle to KiCad tool, but getting the remaining 20% is taking >80% of the time!
j5ngajrgkdcd3zibhdipuu6lqwvs24xnzds3pyk7@yahoo.com [kicad-users]
2017-04-21 16:54:20 UTC
Permalink
Thanks Bob. The Traxmaker files are in text and are quite readable, so it should be possible to write a conversion program (I use Liberty Basic).

I was just hoping that someone had already done the hard work.
Pedro Martin pkicad@yahoo.es [kicad-users]
2017-04-21 13:44:21 UTC
Permalink
Hi,

I have made the migration from other CAD and it is not easy at all.

The schematic must be done from scratch most of the times. I say most
because somewhere I read it is possible, I wasn't able.

The layout can be imported from the Gerber files. But then again, I got
something more similar to a draw.
Without information of a netlist, all tracks belong to the same net.

So,
1. I did the schematic from scratch
2. Assigned footprints to each component
3. Made a netlist
4. Imported the gerber files into pcbnew (all pads are shown as vias)
5. Imported the netlist
6. With patience, I positioned every footprint on its place, then
deleted the old pads (as said, shown as vias)
7. I Deleted the zones and created new zones. This was easy bacause the
projects had only a big gnd zone covering the whole board.

Good luck!

Regards,
Pedro.

El 21/04/17 a las 11:04,
Post by ***@yahoo.com [kicad-users]
Hello All,
I've decided to move to KiCad from CircuitMaker 2000 (after 17 years!)
and would dearly love to import my current PCB layouts into KiCad/Pcbnew.
Does anyone know if this has been done or can be done?
CircuitMaker 2000/Traxmaker will also export in Protel Advanced PCB 2.8 format and dxf.
Thanks.
j5ngajrgkdcd3zibhdipuu6lqwvs24xnzds3pyk7@yahoo.com [kicad-users]
2017-04-21 17:05:34 UTC
Permalink
Thank you for your answer, Pedro.
Your procedure makes sense and I had already tried a test conversion using the Gerber import and a couple of standard footprints.

My biggest problem is that I use various 2G and 3G modules as well as numerous other modules, some of which have hundreds of irregularly spaced pads which I had to painstakingly build the footprints for.

Perhaps a more achievable and still useful solution would be to convert only the custom footprints and use them in your procedure.


If only such a converter existed......


Ron
Julie Porter jporter@delectra.com [kicad-users]
2017-04-21 19:03:00 UTC
Permalink
Post by ***@yahoo.com [kicad-users]
Hello All,
I've decided to move to KiCad from CircuitMaker 2000 (after 17 years!)
and would dearly love to import my current PCB layouts into KiCad/Pcbnew.
Does anyone know if this has been done or can be done?
CircuitMaker 2000/Traxmaker will also export in Protel Advanced PCB 2.8 format and dxf.
Thanks.
Some years ago I wrote a series of postscript programs (scripts) that
can take an ExpressPCB project and convert both ways to KiCad.

While the tool works and did the job I needed it to. I had a number of
issues with the stability of the schematic converter. Mostly due to the
design notation that KiCad does not save the schematic elements locally
in the file. Some are saved in a separate local cache. The problem
was most acute with the symbols, Power, ground, netnames etc. Where
the paths to the library had to be exact. While is works for archival
storage. Editing the schematic could cause things to break down. The
component rotation matrixes (calculated by postscript) Would rotate
symbols against the source orientation. Postscript had no way of
knowing the north pole so to speak of a given component. I sort of
made a guess that pin 1 orientates to the upper left. I think the
schematic program rotates arround pin 1. KiCad rotate around the center
of mass. In the schematic, the pin can have a separate rotation, and
the pins text additional rotations. While postscript could handle all
of this, it would break apart on edit.

The PCB converter was much more effective. I still use it occasionally
to go from KiCad to expressPCB (which uses a proprietary ordering
system.) There is still a bit that needs automating, which is the
creation of the fill zones. The main issue is this currently that some
of the net list has to be hand edited.

The result also was that the conversion tool was turning into an "AI"
driven expert system. The expressPCB internal components had a naming
system which related to DigiKey part numbers. The stock file names
sort of have a parsable way of determining what a component is such as a
chip, passive, symbol connector etc. This breaks down as for custom
components the file name can be anything. While the postscript tool can
learn to match, it takes time an a large data set to train it.

Somewhere I do have some OrCad and Pads projects. These also are
proprietary formats, however I have not found any documentation of the
internal proprietary file structure. I have found viewers which can
create a PDF printout of the project from PostScript print driver. As
most modern print drivers can print to file.

The above postcript KiCad conversion tool actually evolved from a
postscript Gerber Viewer I once wrote. That tool was closely related to
a DXF viewer I also wrote. This was part of a system for milling PCBs
using a CNC mill. Depending on the print driver, If the driver wrote
vector postscript from which to distill the PDF, then some of the
structure could be recovered. Again this project is turning into an
Expert system, and has been on the back burner for a decade or more.

Recently I was working on another project and re-reading some of my
image processing textbooks from the 1990s. I sort of had the
realization (I would not consider it an epiphany.) That much of the
vision code is what is leading the self driving car answer what is
looking for a solution.

Applying this same machine vision code to recovery of a netlist from a
gerber or image of a board one could do the following image processing
steps.

PCB layout and auto routing are based on the same first year computer
science project, known as the Traveling salesman problem. This is
usually the second or third program a CS student or coding school
student will write. It is intended to teach statistical cost analysis.
It also teaches how to plot a path on a map.

In image processing it leads to region analysis. Region analysis leads
to rasterization. This is how PCB milling and Gerber Plotting work.
The easy direction is Gerber or dxf plotting. Such is a simple robot
that has a shutter which exposes film. If the source traces are
vectors, then it is a simple traveling salesmen result plot. A simple
move to x,y draw marker, draw line to next x,y.

Region mapping (how a lot of print drivers work) restricts the pen to
only be able to draw horizontal lines. A bit more complex but still
the same problem. Typically the map is banded into a raster buffer.
This buffer needs only be one pixel in height, the width is the width of
the plotting device. The entire path the traveling salesman is plotted
into this windowed buffer. The resulting buffer can then be run length
encoded. The result will then give the start and stop plot lines for
the fill region.

There is however a problem with this solution (and it affects self
driving cars too.) which is where the salesman crosses his path. Or
creates two unconnected paths through the third dimension. (multi layer
boards.) This is called the winding number rule. It can be even or
odd. In typography this is created by the letter O where one way the
center of the O is filled the other way it is plotted as a ring. The
other test for this rule is the 5 pointed pentagram star. Fortunately
for most things there is standardization to this rule when making maps.

Where things do get interesting is the recovery of nets and zones from
postscript created plots of Gerber files. This is called skelitinzation
and region growing. It can be done by hand in Photoshop or automated.
Again this is probably (I hope) being used in the vision system of self
driving cars. It closely relates as to how the Boffins think we see
things. By detecting the edges of objects. Edge detectors are easy to
code through what is called template matching or convolution. This is
what Photoshop filters do. Region growing maps these into areas what
look like the topographical lines on a geological map.

Back in the days of the Apple][ game designers found if they mapped the
edge of the object that they wanted to animate which was called a
sprite, they could store just the edge outline. The other quantity
1980s game designers wanted was the center of the mass of this outline
so the sprite could be rotated. My guess is that EDA designers
leveraged on this to create the packages we know and love. A symbol or
pad could be considered a sprite. The outline is a chain code, the
position of the object the center of area mass. In games Sprites are
connected by rubber band
which are analogous to moving a wire in an EDA package.


Anyway in this day and age it is easy to detect regions and
boundaries. When we return to our traveling salesman we now give him
or her the Quantum property that she now travels all the possible paths
at the same time. Fortunately for us this is a bounded infinity. The
result if this infinity is the net list we seek. The result cycle of
this bounded infinity is the edge detector on the Gerber or even a high
contrast photograph of the board. This result is typically the
insulated non copper parts. The other bounded infinite region is is the
copper.

Limiting our quantum salesperson to only travel this path once. we have
the problem of where she starts. This is a well known quantity called
phase. By using the sprite model we can create one cycle where she
visits each point in a copper region only once. This is actually our
net. We can learn a lot about this net from the sprite properties. By
skelitinizing it which is a process where we make it one pixel thick we
can determine the width of our trace by how much was removed to find the
backbone of the region. A further quantatization of the sprite will
break it down into lines. A corner detector will give us the corners
from this we now have the xy and move to coordinates to plot this net.
There is a bit more work to be done on the zones although the
skelitization will leave a branch at the center of the mass. There is
also work to do find out the phase (where on the net) the start is. The
net will also have branches.

Where the Expert system part gets a workout is identifying these edges.
Edges can link to a pad with a high cost to keep or a corner with a low
cost as it has no real value in recovering the schematic from the Gerber.

Edges which are close together or follow patterns can be estimated into
groups which could be considered footprints. Further Quantazation can
locate the center of these pads. Winding number type rules can be used
to number the pad edges. These edge clouds of pins can then be matched
against database of known likely component footprints.

This is of course a simple 2 dimensional way of recovering nets and
footprints from Gerbers or photographs of boards. A full stack will
exist in 3 dimensions and the regions will be solid objects in order to
include the vias.

I have not done anything with these ideas for a decade or so. I think
they do have potential and if others want to build on it so much the better.
j5ngajrgkdcd3zibhdipuu6lqwvs24xnzds3pyk7@yahoo.com [kicad-users]
2017-04-22 03:51:14 UTC
Permalink
Wow! Thanks for that comprehensive answer. The scope for research in this and related areas is worthy of several PhDs. Sadly, in my case, the dictates of time and economics may compel me to go the route of manually and tediously building all the custom footprints, although that would not ever be as satisfying as writing a converter, which could also be used by others.

This, however, is easier said than done. For example, a very simple board (without keep-out layer) consisting of 2 components, a through-hole DIP8 dual op amp and an 805 SMT resistor plus 2 connecting tracks in the Traxmaker Protel format is very straightforward:

PCB FILE 4
COMP
R1
0805
10k
1555 830 40 0 8 7
1465 930 40 0 8 7
1495 810 1 1 2
CP
1495 810 47 35 2 0 1 1
1
CP
1495 889 47 35 2 0 1 1
2
CT
1522 829 1522 869 8 7 1
CT
1468 829 1468 869 8 7 1
ENDCOMP
COMP
U1
DIP8
LM358N
969 1078 40 0 8 7
969 1134 40 0 8 7
1000 1000 1 1 2
CA
1150 1050 25 12 8 7
CP
1000 1000 62 62 2 25 1 13
1
CP
1000 900 62 62 1 25 1 13
2
CP
1000 800 62 62 1 25 1 13
3
CP
1000 700 62 62 1 25 1 13
4
CP
1300 700 62 62 1 25 1 13
5
CP
1300 800 62 62 1 25 1 13
6
CP
1300 900 62 62 1 25 1 13
7
CP
1300 1000 62 62 1 25 1 13
8
CT
1050 1050 1125 1050 8 7 1
CT
1175 1050 1250 1050 8 7 1
CT
1250 650 1250 1050 8 7 1
CT
1050 650 1250 650 8 7 1
CT
1050 650 1050 1050 8 7 1
ENDCOMP
FT
1310 810 1495 810 10 1 1
FT
1300 900 1480 900 10 1 1
FT
1300 800 1310 810 10 1 1
FT
1480 900 1495 885 10 1 1
ENDPCB


The same set of components in a Pcbnew board has a much more involved file structure:


(kicad_pcb (version 4) (host pcbnew 4.0.6)


(general
(links 2)
(no_connects 0)
(area 0 0 0 0)
(thickness 1.6)
(drawings 0)
(tracks 4)
(zones 0)
(modules 2)
(nets 9)
)


(page A4)
(layers
(0 F.Cu signal)
(31 B.Cu signal)
(32 B.Adhes user)
(33 F.Adhes user)
(34 B.Paste user)
(35 F.Paste user)
(36 B.SilkS user)
(37 F.SilkS user)
(38 B.Mask user)
(39 F.Mask user)
(40 Dwgs.User user)
(41 Cmts.User user)
(42 Eco1.User user)
(43 Eco2.User user)
(44 Edge.Cuts user)
(45 Margin user)
(46 B.CrtYd user)
(47 F.CrtYd user)
(48 B.Fab user)
(49 F.Fab user)
)


(setup
(last_trace_width 0.25)
(trace_clearance 0.2)
(zone_clearance 0.508)
(zone_45_only no)
(trace_min 0.2)
(segment_width 0.2)
(edge_width 0.15)
(via_size 0.6)
(via_drill 0.4)
(via_min_size 0.4)
(via_min_drill 0.3)
(uvia_size 0.3)
(uvia_drill 0.1)
(uvias_allowed no)
(uvia_min_size 0.2)
(uvia_min_drill 0.1)
(pcb_text_width 0.3)
(pcb_text_size 1.5 1.5)
(mod_edge_width 0.15)
(mod_text_size 1 1)
(mod_text_width 0.15)
(pad_size 1.524 1.524)
(pad_drill 0.762)
(pad_to_mask_clearance 0.2)
(aux_axis_origin 0 0)
(visible_elements FFFFFF7F)
(pcbplotparams
(layerselection 0x00030_80000001)
(usegerberextensions false)
(excludeedgelayer true)
(linewidth 0.150000)
(plotframeref false)
(viasonmask false)
(mode 1)
(useauxorigin false)
(hpglpennumber 1)
(hpglpenspeed 20)
(hpglpendiameter 15)
(hpglpenoverlay 2)
(psnegative false)
(psa4output false)
(plotreference true)
(plotvalue true)
(plotinvisibletext false)
(padsonsilk false)
(subtractmaskfromsilk false)
(outputformat 1)
(mirror false)
(drillshape 1)
(scaleselection 1)
(outputdirectory ""))
)


(net 0 "")
(net 1 "Net-(R1-Pad1)")
(net 2 "Net-(R1-Pad2)")
(net 3 "Net-(U1-Pad1)")
(net 4 "Net-(U1-Pad5)")
(net 5 "Net-(U1-Pad2)")
(net 6 "Net-(U1-Pad3)")
(net 7 GND)
(net 8 "Net-(U1-Pad8)")


(net_class Default "This is the default net class."
(clearance 0.2)
(trace_width 0.25)
(via_dia 0.6)
(via_drill 0.4)
(uvia_dia 0.3)
(uvia_drill 0.1)
(add_net GND)
(add_net "Net-(R1-Pad1)")
(add_net "Net-(R1-Pad2)")
(add_net "Net-(U1-Pad1)")
(add_net "Net-(U1-Pad2)")
(add_net "Net-(U1-Pad3)")
(add_net "Net-(U1-Pad5)")
(add_net "Net-(U1-Pad8)")
)


(module Housings_DIP:DIP-8_W7.62mm (layer F.Cu) (tedit 58FAC8AA) (tstamp 58FAC7D2)
(at 21.59 181.61)
(descr "8-lead dip package, row spacing 7.62 mm (300 mils)")
(tags "DIL DIP PDIP 2.54mm 7.62mm 300mil")
(path /58FACC85)
(autoplace_cost90 10)
(autoplace_cost180 10)
(fp_text reference U1 (at 3.81 -2.39) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value LM358N (at 3.81 10.01) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text user %R (at 3.81 3.81) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start 1.635 -1.27) (end 6.985 -1.27) (layer F.Fab) (width 0.1))
(fp_line (start 6.985 -1.27) (end 6.985 8.89) (layer F.Fab) (width 0.1))
(fp_line (start 6.985 8.89) (end 0.635 8.89) (layer F.Fab) (width 0.1))
(fp_line (start 0.635 8.89) (end 0.635 -0.27) (layer F.Fab) (width 0.1))
(fp_line (start 0.635 -0.27) (end 1.635 -1.27) (layer F.Fab) (width 0.1))
(fp_line (start 2.81 -1.39) (end 1.04 -1.39) (layer F.SilkS) (width 0.12))
(fp_line (start 1.04 -1.39) (end 1.04 9.01) (layer F.SilkS) (width 0.12))
(fp_line (start 1.04 9.01) (end 6.58 9.01) (layer F.SilkS) (width 0.12))
(fp_line (start 6.58 9.01) (end 6.58 -1.39) (layer F.SilkS) (width 0.12))
(fp_line (start 6.58 -1.39) (end 4.81 -1.39) (layer F.SilkS) (width 0.12))
(fp_line (start -1.1 -1.6) (end -1.1 9.2) (layer F.CrtYd) (width 0.05))
(fp_line (start -1.1 9.2) (end 8.7 9.2) (layer F.CrtYd) (width 0.05))
(fp_line (start 8.7 9.2) (end 8.7 -1.6) (layer F.CrtYd) (width 0.05))
(fp_line (start 8.7 -1.6) (end -1.1 -1.6) (layer F.CrtYd) (width 0.05))
(fp_arc (start 3.81 -1.39) (end 2.81 -1.39) (angle -180) (layer F.SilkS) (width 0.12))
(pad 1 thru_hole rect (at 0 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)
(net 3 "Net-(U1-Pad1)"))
(pad 5 thru_hole oval (at 7.62 7.62) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)
(net 4 "Net-(U1-Pad5)"))
(pad 2 thru_hole oval (at 0 2.54) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)
(net 5 "Net-(U1-Pad2)"))
(pad 6 thru_hole oval (at 7.62 5.08) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)
(net 2 "Net-(R1-Pad2)"))
(pad 3 thru_hole oval (at 0 5.08) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)
(net 6 "Net-(U1-Pad3)"))
(pad 7 thru_hole oval (at 7.62 2.54) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)
(net 1 "Net-(R1-Pad1)"))
(pad 4 thru_hole oval (at 0 7.62) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)
(net 7 GND))
(pad 8 thru_hole oval (at 7.62 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)
(net 8 "Net-(U1-Pad8)"))
(model Housings_DIP.3dshapes/DIP-8_W7.62mm.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)


(module Resistors_SMD:R_0805 (layer F.Cu) (tedit 58FAC8CC) (tstamp 58FAC810)
(at 35.56 185.42 270)
(descr "Resistor SMD 0805, reflow soldering, Vishay (see dcrcw.pdf)")
(tags "resistor 0805")
(path /58FACD70)
(autoplace_cost90 10)
(autoplace_cost180 10)
(attr smd)
(fp_text reference R1 (at 0 -1.65 270) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value 10k (at 0 1.75 270) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text user %R (at 0 0 270) (layer F.Fab)
(effects (font (size 0.5 0.5) (thickness 0.075)))
)
(fp_line (start -1 0.62) (end -1 -0.62) (layer F.Fab) (width 0.1))
(fp_line (start 1 0.62) (end -1 0.62) (layer F.Fab) (width 0.1))
(fp_line (start 1 -0.62) (end 1 0.62) (layer F.Fab) (width 0.1))
(fp_line (start -1 -0.62) (end 1 -0.62) (layer F.Fab) (width 0.1))
(fp_line (start 0.6 0.88) (end -0.6 0.88) (layer F.SilkS) (width 0.12))
(fp_line (start -0.6 -0.88) (end 0.6 -0.88) (layer F.SilkS) (width 0.12))
(fp_line (start -1.55 -0.9) (end 1.55 -0.9) (layer F.CrtYd) (width 0.05))
(fp_line (start -1.55 -0.9) (end -1.55 0.9) (layer F.CrtYd) (width 0.05))
(fp_line (start 1.55 0.9) (end 1.55 -0.9) (layer F.CrtYd) (width 0.05))
(fp_line (start 1.55 0.9) (end -1.55 0.9) (layer F.CrtYd) (width 0.05))
(pad 1 smd rect (at -0.95 0 270) (size 0.7 1.3) (layers F.Cu F.Paste F.Mask)
(net 1 "Net-(R1-Pad1)"))
(pad 2 smd rect (at 0.95 0 270) (size 0.7 1.3) (layers F.Cu F.Paste F.Mask)
(net 2 "Net-(R1-Pad2)"))
(model ${KISYS3DMOD}/Resistors_SMD.3dshapes/R_0805.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)


(segment (start 35.56 184.47) (end 29.53 184.47) (width 0.25) (layer F.Cu) (net 1) (status C00000))
(segment (start 29.53 184.47) (end 29.21 184.15) (width 0.25) (layer F.Cu) (net 1) (tstamp 58FACF80) (status C00000))
(segment (start 35.56 186.37) (end 29.53 186.37) (width 0.25) (layer F.Cu) (net 2) (status C00000))
(segment (start 29.53 186.37) (end 29.21 186.69) (width 0.25) (layer F.Cu) (net 2) (tstamp 58FACF77) (status C00000))


)




Not a trivial conversion even for an ultra simple layout.

Loading...