Root/atusb/cam/mkmk

Source at commit ec21e4ba4756379934fc24635438040f66d2ab7c created 13 years 1 month ago.
By Werner Almesberger, atusb/fw2: support device -> host side of the ATUSB EP0 protocol
1#!/bin/sh
2PATH=$PATH:/home/qi/cae-tools/cameo
3PATH=$PATH:/home/moko/svn.openmoko.org/developers/werner/cncmap/gp2rml
4
5NAME=atusb
6X=0
7Y=2
8
9cameo <<EOF
10mm
11
12gerber 35mil ../$NAME-PCB_Edges.gbr
13rotate 90
14align 1 4.4mm 12.1mm # align relative to board corner
15translate 4mm 4mm # move to PCB zone assigned to project
16array +3mm +3mm $X $Y
17z 0 -58.9mm # board surface (tool fully retracted)
18z 1.5mm # slack for extending the tool
19z -0.8mm # board thickness
20z -0.5mm # tool extra depth
21clear
22
23excellon ../$NAME.drl
24drill 7mil 15mil # 12.5-13.5 mil drill
25optimize
26write drill.gp
27
28remainder
29mill 20mil 0.01mm # 35 mil endmill; pretend it is a little smaller,
30            # to compensate for tool/board deflections
31write mill.gp
32
33remainder
34empty
35
36gerber 32mil ../$NAME-PCB_Edges.gbr # 35 mil endmill, 3 mil deflection
37offset
38append mill.gp
39EOF
40
41
42gp2rml 2 0.5 0.5 mill.gp >mill.rml
43gp2rml 2 0.1 0.5 drill.gp >drill.rml
44
45
46cat <<EOF >Makefile.mkmk
47SPOOL=/home/moko/svn.openmoko.org/developers/werner/cncmap/spool/spool
48CNGT=/home/qi/cae-tools/cngt/cngt
49
50.PHONY: mill drill cng plot dplot
51
52mill:
53        PORT=/dev/ttyUSB0 \$(SPOOL) mill.rml
54
55drill:
56        PORT=/dev/ttyUSB0 \$(SPOOL) drill.rml
57
58cng:
59        \$(CNGT) -57.4 20 mill.gp
60
61plot:
62        echo 'plot "drill.gp" with points, "mill.gp" with lines' | \\
63          gnuplot -persist
64
65dplot:
66        echo 'plot "< sed /^\$\$/d drill.gp" with linespoints' | \\
67          gnuplot -persist
68
69clean::
70        rm -f mill.gp mill.rml drill.gp drill.rml
71EOF
72

Archive Download this file



interactive