2012-03-19 06:21:51 +02:00
|
|
|
CAE_TOOLS = /home/qi/cae-tools
|
|
|
|
CAMEO = $(CAE_TOOLS)/cameo
|
|
|
|
SPOOL = $(CAE_TOOLS)/spool/spool
|
|
|
|
CNGT = $(CAE_TOOLS)/cngt/cngt
|
|
|
|
GP2RML = $(CAE_TOOLS)/gp2rml/gp2rml
|
|
|
|
|
2012-03-22 09:17:49 +02:00
|
|
|
# #1: 5, 5
|
|
|
|
# #2: 5, 45
|
|
|
|
# #3: 65, 5
|
|
|
|
# #3: 70, 45
|
2012-03-23 20:30:09 +02:00
|
|
|
# Z1 = -44
|
|
|
|
# PIECE_Z = 5.5
|
|
|
|
|
|
|
|
# new run (10 45, 135 85, 7.8)
|
|
|
|
# #1: 13 45
|
|
|
|
# #2: 75 48
|
|
|
|
|
|
|
|
X0 = 75
|
|
|
|
Y0 = 48
|
|
|
|
Z1 = -50
|
2012-03-19 06:21:51 +02:00
|
|
|
PIECE = -5 -5 30 55
|
2012-03-23 20:30:09 +02:00
|
|
|
PIECE_Z = 7.9
|
2012-03-19 06:21:51 +02:00
|
|
|
Z_STEP = 2
|
2012-03-23 20:30:09 +02:00
|
|
|
CLEARANCE = 2
|
2012-03-19 06:21:51 +02:00
|
|
|
SPEED_XY = 1
|
|
|
|
SPEED_Z = 1
|
2012-03-19 20:22:54 +02:00
|
|
|
OVERSHOOT = 0.2
|
|
|
|
|
2012-03-22 09:17:49 +02:00
|
|
|
Z_OFFSET = 0.1
|
|
|
|
FIN_SPEED_XY = 3
|
|
|
|
FIN_SPEED_Z = 3
|
|
|
|
|
|
|
|
PARAMS = X0=$(X0)mm Y0=$(Y0)mm Z1=$(Z1)mm PIECE_Z=$(PIECE_Z)mm \
|
|
|
|
Z_OFFSET=$(Z_OFFSET)mm
|
2012-03-19 06:21:51 +02:00
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
PARTS = top mid bot
|
|
|
|
PART = top
|
|
|
|
|
2012-03-19 06:21:51 +02:00
|
|
|
.PHONY: all plot mill pos cng clean
|
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
all: $(PART)-mill.rml $(PART)-finish.rml
|
2012-03-19 06:21:51 +02:00
|
|
|
|
2012-03-21 06:06:02 +02:00
|
|
|
case.gp: case.fpd
|
2012-03-19 06:21:51 +02:00
|
|
|
fped -g case.fpd || { rm -f $@; exit 1; }
|
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
$(PART).gp: case.gp
|
|
|
|
$(CAMEO)/fped2d2z.pl -r 0=-$(OVERSHOOT) $(PART) $^ >$@ || \
|
2012-03-19 20:22:54 +02:00
|
|
|
{ rm -f $@; exit 1; }
|
2012-03-19 06:21:51 +02:00
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
$(PART)-piece.gp: $(PART).gp
|
2012-03-19 20:22:54 +02:00
|
|
|
./genpiece.pl -r $(PIECE) $< >$@ || { rm -f $@; exit 1; }
|
2012-03-19 06:21:51 +02:00
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
$(PART)-area.gp: $(PART)-piece.gp $(PART).gp cam.sh Makefile
|
|
|
|
./cam.sh PART=$(PART) CAMEO=$(CAMEO)/cameo $(PARAMS) OUT=$@ || \
|
2012-03-19 20:22:54 +02:00
|
|
|
{ rm -f $@; exit 1; }
|
2012-03-19 06:21:51 +02:00
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
$(PART)-finish.gp: $(PART)-piece.gp $(PART).gp cam.sh Makefile
|
|
|
|
./cam.sh PART=$(PART) CAMEO=$(CAMEO)/cameo $(PARAMS) \
|
2012-03-22 09:17:49 +02:00
|
|
|
Z_OFFSET=0mm REVERSE=reverse OUT=$@ || { rm -f $@; exit 1; }
|
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
$(PART)-mill.gp: $(PART)-area.gp Makefile
|
2012-03-19 20:22:54 +02:00
|
|
|
$(CAMEO)/zstack.pl $(Z1) $(Z_STEP) $< >$@ || \
|
2012-03-19 06:21:51 +02:00
|
|
|
{ rm -f $@; exit 1; }
|
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
$(PART)-mill.rml: $(PART)-mill.gp Makefile
|
2012-03-19 06:21:51 +02:00
|
|
|
$(GP2RML) $(CLEARANCE) $(SPEED_XY) $(SPEED_Z) $< >$@ || \
|
|
|
|
{ rm -f $@; exit 1; }
|
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
$(PART)-finish.rml: $(PART)-finish.gp Makefile
|
2012-03-22 09:17:49 +02:00
|
|
|
$(GP2RML) $(CLEARANCE) $(FIN_SPEED_XY) $(FIN_SPEED_Z) \
|
|
|
|
$< >$@ || { rm -f $@; exit 1; }
|
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
plot: $(PART)-mill.gp
|
|
|
|
echo 'splot "$(PART)-mill.gp" with lines' | gnuplot -persist
|
2012-03-19 06:21:51 +02:00
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
mill: $(PART)-mill.rml $(PART)-finish.rml
|
2012-03-22 09:17:49 +02:00
|
|
|
PORT=/dev/ttyUSB0 $(SPOOL) $^
|
2012-03-19 06:21:51 +02:00
|
|
|
|
|
|
|
pos:
|
|
|
|
$(CNGT) 0
|
|
|
|
|
2012-03-23 20:30:09 +02:00
|
|
|
cng: $(PART)-mill.gp
|
2012-03-19 06:21:51 +02:00
|
|
|
$(CNGT) $(Z1) 10 $<
|
|
|
|
|
|
|
|
clean:
|
2012-03-23 20:30:09 +02:00
|
|
|
rm -f case.gp
|
|
|
|
rm -f $(PARTS:%=%-piece.gp) $(PARTS:%=%.gp)
|
|
|
|
rm -f $(PARTS:%=%-area.gp)
|
|
|
|
rm -f $(PARTS:%=%-mill.gp) $(PARTS:%=%-mill.rml)
|
|
|
|
rm -f $(PARTS:%=%-finish.gp) $(PARTS:%=%-finish.rml)
|