Skip to content

Commit

Permalink
added panelized version of frontplate, added cupe examples, added sol…
Browse files Browse the repository at this point in the history
…der helper
  • Loading branch information
wesen3000 committed Apr 2, 2009
1 parent c69104f commit e266800
Show file tree
Hide file tree
Showing 4 changed files with 258 additions and 17 deletions.
114 changes: 103 additions & 11 deletions casings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,57 @@
;; distance between drills: 109.5, 84.2
;; outer dimensions: 119.0, 93.5, 34.0

(defparameter *mdf-tool-2mm*
(make-instance 'tool
:diameter 2
:number 10
:depth 3))


(defun woehr-gehauese-090 ()
(with-tool ((make-instance 'tool
:diameter 2
:number 6
:feed-xy 600
:feed-z 240
:depth 3))
(with-tool (*mdf-tool-2mm*)
(spindle-on)
(goto-abs :x 0 :y 0)
(goto-abs :z *fly-height*)

(with-named-pass ("outline")
(with-tool (*mdf-tool-2mm*)
(goto-abs :x 0 :y 0)
(rectangle-inline 93.5 119 :depth 1)
(goto-abs :x 0.7 :y 0.7)
(rectangle-inline (- 93.5 1.4) (- 119 1.4) :depth 1))
(rectangle-inline (- 93.5 1.4) (- 119 1.4) :depth 1)))

(with-named-pass ("drills")
(with-tool (*mdf-tool-2mm*)
(goto-abs :x 0 :y 0)
(goto-abs :z *fly-height*)

(drill :y 5 :x 4.65 :diameter 3.5 :depth 8)
(drill :y (- 119 5) :x 4.65 :diameter 3.5 :depth 8)
(drill :y (- 119 5) :x (- 93.5 4.65) :diameter 3.5 :depth 8)
(drill :y 5 :x (- 93.5 4.65) :diameter 3.5 :depth 8))))
(drill :y 5 :x 4.65 :diameter 3.5 :depth 12.5)
(drill :y 5 :x (- 93.5 4.65) :diameter 3.5 :depth 12.5)
(drill :y (- 119 5) :x (- 93.5 4.65) :diameter 3.5 :depth 12.5)
(drill :y (- 119 5) :x 4.65 :diameter 3.5 :depth 12.5)

))))

(defun woehr-gehauese-090-rueckwaerts-drills ()
(with-tool (*mdf-tool-2mm*)
(spindle-on)
(goto-abs :x 0 :y 0)
(goto-abs :z *fly-height*)

(with-named-pass ("drills")
(with-tool (*mdf-tool-2mm*)
(goto-abs :x 0 :y 0)
(goto-abs :z *fly-height*)

(with-transform ((translation-matrix -4.65 -5))
(drill :y 5 :x 4.65 :diameter 7 :depth 11)
(drill :y 5 :x (- 93.5 4.65) :diameter 7 :depth 11)
(drill :y (- 119 5) :x (- 93.5 4.65) :diameter 7 :depth 11)
(drill :y (- 119 5) :x 4.65 :diameter 7 :depth 11)

)))))


(defun woehr-090-program ()
(with-program ("woehr")
Expand All @@ -113,4 +139,70 @@
(woehr-gehauese-090))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090))))

(defun woehr-090-platte ()
(with-program ("woehr")
(with-named-pass ("mill")
(with-tool (*mdf-tool-2mm*)
(woehr-gehauese-090)
(with-transform ((translation-matrix 0 122))
(woehr-gehauese-090))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090))

(with-transform ((translation-matrix 105 0))
(woehr-gehauese-090)
(with-transform ((translation-matrix 0 122))
(woehr-gehauese-090))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090)))

(with-transform ((translation-matrix 210 0))
(woehr-gehauese-090)
(with-transform ((translation-matrix 0 122))
(woehr-gehauese-090))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090)))

(with-transform ((translation-matrix 315 0))
(woehr-gehauese-090)
(with-transform ((translation-matrix 0 122))
(woehr-gehauese-090))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090)))))))



(defun woehr-090-platte-rueckwaerts ()
(with-program ("woehr")
(with-named-pass ("mill")
(with-tool (*mdf-tool-2mm*)
(woehr-gehauese-090-rueckwaerts-drills)
(with-transform ((translation-matrix 0 122))
(woehr-gehauese-090-rueckwaerts-drills))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090-rueckwaerts-drills))

(with-transform ((translation-matrix 105 0))
(woehr-gehauese-090-rueckwaerts-drills)
(with-transform ((translation-matrix 0 122))
(woehr-gehauese-090-rueckwaerts-drills))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090-rueckwaerts-drills)))

(with-transform ((translation-matrix 210 0))
(woehr-gehauese-090-rueckwaerts-drills)
(with-transform ((translation-matrix 0 122))
(woehr-gehauese-090-rueckwaerts-drills))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090-rueckwaerts-drills)))

(with-transform ((translation-matrix 315 0))
(woehr-gehauese-090-rueckwaerts-drills)
(with-transform ((translation-matrix 0 122))
(woehr-gehauese-090-rueckwaerts-drills))
(with-transform ((translation-matrix 0 244))
(woehr-gehauese-090-rueckwaerts-drills)))))))



49 changes: 49 additions & 0 deletions cupe.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
(in-package :gcode)

(defparameter *cupe-tool*
(make-instance 'tool
:diameter 3 ;; diameter vom tool
:number 14 ;; nummer im cnc kontrollprogramm
:depth 3 ;; maximale eintauchstiefe vom tool
))

(defun cupe-shizzle ()
;; viereck von 10, 10 -> 50, 50
(with-program ("cupe-shizzle")
(with-named-pass ("viereck")
(goto-abs :x 0 :y 0)
(spindle-on)
(goto-abs :z 1.5)
(goto-abs :x 10 :y 10)
(let ((*current-tool* *cupe-tool*))
(with-named-pass ("befestigung")
(drill :x 8 :y 8 :diameter 5 :depth 8))
(with-tool-down (2)
(let ((x1 (orig-current-x))
(y1 (orig-current-y)))
(with-named-pass ("bridge")
(with-tool-down (1)
(fly-to :x x1 :y y1)
(mill-abs :x 15 :y y1))))

(fly-to :x 15)
(mill-abs :x 50 :y 10)
(mill-abs :x 50 :y 50)

(let ((x1 (orig-current-x))
(y1 (orig-current-y)))
(with-named-pass ("bridge")
(with-tool-down (1)
(fly-to :x x1 :y y1)
(mill-abs :x 45 :y y1))))

(fly-to :x 45)
(mill-abs :x 10 :y 50)
(mill-abs :x 10 :y 10))))))

;; NC code genereien
(program-to-file (cupe-shizzle) "/users/manuel/public/nc/test.nc" :order '("mill" "bridge"))
(program-to-pdf (cupe-shizzle) "/users/manuel/public/nc/test.pdf" :order '("mill"))

;; opcodes.lisp -> alles was direkt mit gcode zu tun hat - primitiven
;; shapes.lisp -> (DRILL) (ARC-CW-ABS) (ARC-CCW-ABS) (MILL-ABS)
80 changes: 74 additions & 6 deletions minicommand.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,22 @@
(defvar *frontplate-program*)
(defvar *frontplate-elements*)

(defparameter *frontplate-depth* 2.4)
(defparameter *frontplate-depth* 1.8)
(defvar *frontplate-top* t)
(defvar *frontplate-side* nil)

;; proto

(defun frontplate-element (&key name package x y angle)
(with-named-pass ("frontplate")
(cond ((string= package "3FTL06")
(when *frontplate-top*
(drill :x x :y y :diameter 2 :depth 0.5)))
((string= package "CI-11")
(when *frontplate-top*
(drill :x x :y y :diameter 2 :depth 0.5))))))


(defun frontplate-element (&key name package x y angle)
(with-named-pass ("frontplate")
(cond ((string= package "3FTL06")
Expand All @@ -44,7 +56,7 @@
(when *frontplate-top*
;; orig
(progn
(goto-abs :x (- x 7.25) :y (- y 4.25))
(goto-abs :x (- x 7.25) :y (- y 3.75))
(rectangle-inline 14 7.5 :depth *frontplate-depth*)
)))

Expand All @@ -64,8 +76,10 @@

((string= package "DISPLAY-TEXT-C1624A")
(when *frontplate-top*
(progn (goto-abs :x (- x 32.6) :y (- y 16.9))
(rectangle-inline 71.5 26.5 :depth *frontplate-depth*)))))))
;; (with-named-pass ("display")
(with-tool (*alu-tool*)
(progn (goto-abs :x (- x 32.6) :y (- y 16.9))
(rectangle-inline 71.5 26.5 :depth *frontplate-depth*))))))))

(defun test-file (&key (x 0) (y 0))
(let ((*frontplate-elements* nil))
Expand Down Expand Up @@ -104,7 +118,7 @@
)))

(defparameter *alu-tool*
(make-instance 'tool :diameter 2 :depth 1.3 :number 8 :feed-xy 500 :feed-z 100))
(make-instance 'tool :diameter 2 :depth 2.6 :number 8 :feed-xy 500 :feed-z 100))

(defun minicommand-casing-side-top-hammond-first ()
(let ((tool *alu-tool*)
Expand Down Expand Up @@ -162,7 +176,7 @@
(with-transform ((translation-matrix 5 3))
(load-file "/Users/manuel/siff-svn/ruinwesen/eagle/midicommand/minicommand-ioboard.lisp"))))))

#-nil
#+nil
(with-named-pass ("engrave")
(let* ((curves (mapcar #'curve-to-arcs (interpret-svg (load-svg "/Users/manuel/test.svg"))))
(wbbox (bounding-box curves)))
Expand Down Expand Up @@ -193,6 +207,7 @@

(with-program ("casing")
(minicommand-frontplate *alu-tool*)
#+nil
(with-named-pass ("umrandung")
(goto-abs :x 0 :y 0
)
Expand All @@ -201,6 +216,59 @@

))

(defun test-minicommand-casing-weit (&optional (start 0))
(let ((tool *alu-tool*))

(decf start)


(with-program ("casing")
(when (<= start 0)
(minicommand-frontplate *alu-tool*))

(when (<= start 1)
(with-transform ((translation-matrix 0 122))
(minicommand-frontplate *alu-tool*)))

(when (<= start 2)
(with-transform ((translation-matrix 0 244))
(minicommand-frontplate *alu-tool*)))

(with-transform ((translation-matrix 105 0))
(when (<= start 3)
(minicommand-frontplate *alu-tool*))

(when (<= start 4)
(with-transform ((translation-matrix 0 122))
(minicommand-frontplate *alu-tool*)))

(when (<= start 5)
(with-transform ((translation-matrix 0 244))
(minicommand-frontplate *alu-tool*))))

(with-transform ((translation-matrix 210 0))
(when (<= start 6)
(minicommand-frontplate *alu-tool*))
(when (<= start 7)
(with-transform ((translation-matrix 0 122))
(minicommand-frontplate *alu-tool*)))
(when (<= start 8)
(with-transform ((translation-matrix 0 244))
(minicommand-frontplate *alu-tool*))))


(with-transform ((translation-matrix 315 0))
(when (<= start 9)
(minicommand-frontplate *alu-tool*))
(when (<= start 10)
(with-transform ((translation-matrix 0 122))
(minicommand-frontplate *alu-tool*)))
(when (<= start 11)
(with-transform ((translation-matrix 0 244))
(minicommand-frontplate *alu-tool*))))
)))


(defun test-minicommand-casing-2 ()
(with-program ("casing2")
(minicommand-frontplate *alu-tool*)
Expand Down
32 changes: 32 additions & 0 deletions solder.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(in-package :gcode)

;; loet hilfen

(defparameter *dick-holz-tool*
(make-instance 'tool
:number 16
:diameter 3
:depth 3))

(defun loethilfe ()
(with-program ("loethilfe")
(with-named-pass ("mill")
(with-tool (*dick-holz-tool*)
(goto-abs :x 0 :y 0)
(goto-abs :z *fly-height*)
(fly-to :x 10 :y 10)
(rectangle-mill 50 50 :depth 3)
(fly-to :x 10 :y 70)
(rectangle-mill 50 50 :depth 3)
(fly-to :x 10 :y 130)
(rectangle-mill 50 50 :depth 3)
(fly-to :x 10 :y 190)
(rectangle-mill 50 50 :depth 3)
(fly-to :x 10 :y 250)
(rectangle-mill 50 50 :depth 3)

(drill :x 100 :y 100 :diameter 6 :depth 6)
(drill :x 126.76 :y 100 :diameter 6 :depth 6)
(drill :x 154.52 :y 100 :diameter 6 :depth 6)
(drill :x 181.80 :y 100 :diameter 6 :depth 6)))))

0 comments on commit e266800

Please sign in to comment.