Root/atben/cam/mkmk

Source at commit ded90eff5f9a915dbdeb3fc873fd49f5f8acecae created 8 years 8 months ago.
By Werner Almesberger, atben/cam/mkmk: updated for latest board parameters
1#!/bin/sh -e
2PATH=$PATH:/home/qi/cae-tools/cameo
3PATH=$PATH:/home/moko/svn.openmoko.org/developers/werner/cncmap/gp2rml
4
5NAME=atben
6X=0
7Y=0
8
9cameo <<EOF
10mm
11
12gerber 35mil ../$NAME-PCB_Edges.gbr
13align 1 4.4mm 12.1mm # align relative to board corner
14translate 4mm 4mm # move to PCB zone assigned to project
15translate 40mm 0mm # skip over previous boards
16array +19mm +2.5mm $X $Y
17
18z 0 -58.9mm # board surface (tool fully retracted)
19z 1.5mm # slack for extending the tool
20z -0.8mm # board thickness
21z -0.5mm # tool extra depth
22clear
23
24# ---- 1st board ----
25
26excellon ../$NAME.drl
27drill 7mil 15mil # 12.5-13.5 mil drill
28optimize
29write drill.gp
30
31remainder
32mill 20mil 0.01mm # 35 mil endmill; pretend it is a little smaller,
33            # to compensate for tool/board deflections
34write mill.gp
35
36remainder
37empty
38
39gerber 20mil ../$NAME-PCB_Edges.gbr # 35 mil endmill, 15 mil deflection
40offset
41append mill.gp
42
43clear
44
45# ---- 2nd board ----
46
47reset
48
49gerber 35mil ../$NAME-PCB_Edges.gbr
50rotate 180
51
52align 1 4.4mm 12.1mm # align relative to board corner
53translate 4mm 4mm # move to PCB zone assigned to project
54translate 40mm 0mm # skip over previous boards
55translate 15mm 0mm
56array +19mm +2.5mm $X $Y
57
58clear
59
60excellon ../$NAME.drl
61drill 7mil 15mil # 12.5-13.5 mil drill
62optimize
63append drill.gp
64
65remainder
66mill 20mil 0.01mm # 35 mil endmill; pretend it is a little smaller,
67            # to compensate for tool/board deflections
68append mill.gp
69
70remainder
71empty
72
73gerber 20mil ../$NAME-PCB_Edges.gbr # 35 mil endmill, 15 mil deflection
74offset
75append mill.gp
76EOF
77
78
79gp2rml 2 0.5 0.5 mill.gp >mill.rml
80gp2rml 2 0.1 0.5 drill.gp >drill.rml
81
82
83cat <<EOF >Makefile.mkmk
84SPOOL=/home/moko/svn.openmoko.org/developers/werner/cncmap/spool/spool
85CNGT=/home/qi/cae-tools/cngt/cngt
86
87.PHONY: mill drill cng plot dplot
88
89mill:
90        PORT=/dev/ttyUSB0 \$(SPOOL) mill.rml
91
92drill:
93        PORT=/dev/ttyUSB0 \$(SPOOL) drill.rml
94
95cng:
96        \$(CNGT) -57.4 20 mill.gp
97
98plot:
99        echo 'plot "drill.gp" with points, "mill.gp" with lines' | \\
100          gnuplot -persist
101
102dplot:
103        echo 'plot "< sed /^\$\$/d drill.gp" with linespoints' | \\
104          gnuplot -persist
105
106clean::
107        rm -f mill.gp mill.rml drill.gp drill.rml
108EOF
109

Archive Download this file



interactive