1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-29 21:41:32 +02:00

atusd/cam: updated to use cameo

- cam/pcb.pl, cam/doit: deleted
- cam/mkmk: CAM translation and conversion process
This commit is contained in:
Werner Almesberger 2011-01-05 23:12:35 -03:00
parent e2c5d42137
commit 6ccb252729
3 changed files with 66 additions and 107 deletions

View File

@ -1,22 +0,0 @@
#!/bin/sh -e
DIR=/home/moko/svn.openmoko.org/developers/werner/cncmap
RECT=$DIR/rect/rect
ALIGN=$DIR/align/align
ZMAP=$DIR/zmap/zmap
GP2RML=$DIR/gp2rml/gp2rml
GEN=${1:-./pcb.pl}
rdata="17.8 8.9 -55.7 72.0 9.6 -55.3 17.8 68.5 -55.5"
rdata="12.4 9.8 -55.6 125.5 9.4 -55.4 12.9 83.6 -55.7"
# we need quite a large Z adjustment due to the table's vertical flexibility
Z=-55.80
rect=`$RECT $rdata | awk '{$3 = ""; print}'`
$GEN |
awk '{ if ($3 != "") $3 += '$Z'; print $0; }' |
$ALIGN 0 1 $rect |
# angle, reference (lower left corner), rect
$GP2RML 2 0.2 0.2
# clearance, xy speed, z speed

66
atusd/cam/mkmk Executable file
View File

@ -0,0 +1,66 @@
#!/bin/sh -e
PATH=$PATH:/home/qi/cae-tools/cameo
PATH=$PATH:/home/moko/svn.openmoko.org/developers/werner/cncmap/gp2rml
cameo <<EOF
mm
gerber 35mil ../atusd-PCB_Edges.gbr
align 1 4.6mm 9.0mm # align relative to board corner
translate 3mm 3mm # move to PCB zone assigned to project
array +2.5mm +2.5mm 0 0
z 0 -58.9mm # board surface (tool fully retracted)
z 1.5mm # slack for extending the tool
z -0.8mm # board thickness
z -0.5mm # tool extra depth
clear
excellon ../atusd.drl
drill 7mil 15mil # 12.5-13.5 mil drill
optimize
write drill.gp
remainder
mill 20mil 0.01mm # 35 mil endmill; pretend it is a little smaller,
# to compensate for tool/board deflections
write mill.gp
remainder
empty
gerber 20mil ../atusd-PCB_Edges.gbr # 35 mil endmill, 15 mil deflection
offset
append mill.gp
EOF
gp2rml 2 0.5 0.5 mill.gp >mill.rml
gp2rml 2 0.1 0.5 drill.gp >drill.rml
cat <<EOF >Makefile.mkmk
SPOOL=/home/moko/svn.openmoko.org/developers/werner/cncmap/spool/spool
CNGT=/home/qi/cae-tools/cngt/cngt
.PHONY: mill drill cng plot dplot
mill:
PORT=/dev/ttyUSB0 \$(SPOOL) mill.rml
drill:
PORT=/dev/ttyUSB0 \$(SPOOL) drill.rml
cng:
\$(CNGT) -57.4 20 mill.gp
plot:
echo 'plot "drill.gp" with points, "mill.gp" with lines' | \\
gnuplot -persist
dplot:
echo 'plot "< sed /^\$\$/d drill.gp" with linespoints' | \\
gnuplot -persist
clean::
rm -f mill.gp mill.rml drill.gp drill.rml
EOF

View File

@ -1,85 +0,0 @@
#!/usr/bin/perl
$d = 2.54/1000*12;
$r = $d/2+0.25;
sub orig
{
$x0 = $_[0];
$y0 = $_[1];
}
sub mil
{
return $_[0]/1000*25.4;
}
sub same
{
return @_;
}
sub rot
{
return (-$x, -$y);
}
sub cut
{
local (*fn) = $_[0];
shift @_;
if (defined $x) {
if ($x == $_[0]+$x0 && $y == $_[1]+$y0) {
shift @_;
shift @_;
} else {
print "\n";
}
}
while (@_) {
$x = shift @_;
$y = shift @_;
($x, $y) = &fn($x, $y);
$x += $x0;
$y += $y0;
print "$x $y $z\n";
}
}
sub one
{
local ($fn) = @_;
&cut($fn,
&mil( 0)-$r, &mil( 0)-$r,
&mil( 0)-$r, &mil(1010)+$r,
&mil(1400)+$r, &mil(1010)+$r,
&mil(1400)+$r, &mil( 640)-$r,
&mil( 440)+$r, &mil( 640)-$r,
&mil( 440)+$r, &mil( 390)-$r,
&mil( 410)+$r, &mil( 360)-$r,
&mil( 410)+$r, &mil( 310)+$r,
&mil( 440)+$r, &mil( 310)+$r,
&mil( 440)+$r, &mil( 250)-$r,
&mil( 380)+$r, &mil( 190)-$r,
&mil( 380)+$r, &mil( 0)-$r,
&mil( 0)-$r, &mil( 0)-$r);
}
$z = -0.8;
$col = 1;
$row = 1;
# x: corner offset, compensation for rotation, array position
# y: corner offet
&orig(5+53.5*$col, 5+33*$row)
&one(*same);
&orig(5+53.5*$col+15+&mil(1400), 5+33*$row+&mil(1010));
&one(*rot);