Add AC/BC RTCP programs and 3D machine manager

This commit is contained in:
2026-09-20 12:31:12 +08:00
parent 1c1e5f9672
commit 8aab531b02
363 changed files with 53213 additions and 58 deletions

View File

@@ -0,0 +1,53 @@
#<r> = 60 ; sphere radius
#<rdelta> = 5 ; safe distance
#<drilldepth> = -5
#<zstart> = 0
#<bctmax> = 8
#<cctmax> = 16
#<toolno> = 100
#<frate> = 1000
#<bct> = 0
#<cct> = 0
#<cdelta> = [360/#<cctmax>]
#<bdelta> = [90/#<bctmax>]
g49
t#<toolno>m6g43
g53 g0 x0y0z#<zstart>b0c0 w0
g10l20 p0 x0 y0 z[#<r>+#<rdelta>] b0 c0 w0
g0 z0
f#<frate>
o100 while [#<bct> lt #<bctmax>]
#<b> = [#<bct>*#<bdelta>]
#<rnow> = [[#<r>+#<rdelta>]*[cos[#<b>]]]
#<x> = [#<rnow>]
#<y> = 0
#<z> = [-#<rnow>]
g0 x#<x> y#<y>
m66e0l0 ; force sync
g0 z#<z>
g0b[-90+#<b>]
#<cct> = 0
o200 while [#<cct> lt #<cctmax>]
o210 if [[#<bct> mod 2] eq 0]
#<c> = [#<cct> * #<cdelta>]
o210 else
#<c> = [360 - [1+ #<cct>] * #<cdelta>]
o210 endif
#<x> = [#<rnow>*[cos[#<c>]]]
#<y> = [#<rnow>*[sin[#<c>]]]
g0 x#<x> y#<y> z#<z> c#<c>
f#<frate>
g1 w[ #<drilldepth> - #<rdelta>]
g0 w0
m66e0l0 ;force sync
#<cct> = [#<cct>+1]
o200 endwhile
#<bct> = [#<bct>+1]
o100 endwhile
g0x0y0z0b0c0w0
g53 g0 x0y0z0
m2

View File

@@ -0,0 +1,24 @@
;M428 by remap: select kinstype=0 genhexkins
o<428remap>sub
#<kinstype> = 0
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M428:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M428: Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<428remap>endsub

View File

@@ -0,0 +1,24 @@
;M429 by remap: select kinstype==1 Identity kinematics
o<429remap>sub
#<kinstype> = 1
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M429:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M429:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<429remap>endsub

View File

@@ -0,0 +1,24 @@
;M430 by remap: select kinstype==2 userk kins
o<430remap>sub
#<kinstype> = 2
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M30:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M430:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<430remap>endsub

View File

@@ -0,0 +1,49 @@
; -- RELOAD GCODE FOR PROPER TOOL-PATH PREVIEW --
g21 g90 g49 g54
; switch to identity mode
m429
; clear g54
g10 l2 p0 x0 y0 z0 a0 b0
; go to machine origin
g53 g0 x0 y0 z0 a0 b0
; set g54 for face center of rotary
g10 l20 p0 x-[#<_hal[xyzab_tdr_kins.x-rot-point]>+#<_hal[xyzab_tdr_kins.x-offset]>] y-#<_hal[xyzab_tdr_kins.x-rot-point]> z-[#<_hal[xyzab_tdr_kins.z-rot-point]>+#<_hal[xyzab_tdr_kins.z-offset]>] a0 b0
; load a tool
M61 Q2 G43 H2
; switch to tcp mode
m428
g0 b30
; go to face center of rotary a
g0 x0 y0 z0
; show basic tcp functionality
g0 x30 a180
g0 x0 a0
g0 b100
g0 y-50
g0 a90
g0 b120
g0 y0
g0 a0 b30
g0 x1
; start with square
f1000
g0 y-30 z-30
g1 z30
g1 a45
g1 y30
g1 a90 b45
g1 z-30
g1 a180 b100
g1 y30
g1 a90 b120
g1 y-30
g1 a0 b30
g0 x5
g1 y-30 z-30 a90
g1 z30 a45 b60
g1 y30 a90 b90
g1 z-30 a135 b120
g1 y-30 a0 b30
; go to machine origin
g53 g0 x0 y0 z0 a0 b0
m2

View File

@@ -0,0 +1,24 @@
;M428 by remap: kinstype==1 (xyzac,xyzbc) (note: sparm=identityfirst)
o<428remap>sub
#<kinstype> = 1 ; xyzac,xyzbc
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M428:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M428: Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<428remap>endsub

View File

@@ -0,0 +1,24 @@
;M429 by remap: kinstype==0 Identity kinematics
o<429remap>sub
#<kinstype> = 0
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M429:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M429:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<429remap>endsub

View File

@@ -0,0 +1,3 @@
; zmax zmin r frate n a b c dist
o<xyzac_switchkins_sub> call [10] [5] [10][1000][3][20][0][45][20]
m2

View File

@@ -0,0 +1,39 @@
; for debugging, use mdi to set global #<_switchkins_debug>=1
#<FRATE>=1000
M429
G0 X0 Y0 Z0 A0 C0
G0 C90 X10 Y0
G1 F#<FRATE> Z2
M428
G1 F#<FRATE> Z0
M429
G1 F#<FRATE> Z2
G0 C90 X0 Y10
G1 F#<FRATE> Z0
M428
G1 F#<FRATE> Z2
M429
G1 F#<FRATE> Z0
G0 C90 X10 Y30
G1 F#<FRATE> Z2
M428
G1 F#<FRATE> Z0
M429
G1 F#<FRATE> Z2
G0 C90 X30 Y10
G1 F#<FRATE> Z0
M428
G1 F#<FRATE> Z2
M429
G1 F#<FRATE> Z0
G0 X0 Y0 Z0 A0 C0
M2

View File

@@ -0,0 +1,49 @@
; for debugging, use mdi to set global #<_switchkins_debug>=1
#<FRATE>=1000
M429 ;Trivkins
G64 P0.01
S1500 M3
G0 X0 Y0 Z5 A0 C0
G1 F#<FRATE> Z0
G1 X20 Y0 F#<FRATE>
M428 ;XYZAC
G1 C90
G1 X20
G1 Y20
G1 X0
G1 Y0
G1 A20
G1 X-20
G1 Y-20
G1 X0
G1 Y0
(-------)
G1 C45
G1 X-15
G1 Y15
G1 X0
G1 Y0
G1 Y-15
G1 X15
G1 Y0
G1 X0
(-------)
G1 C90 X15
G1 C180 Y15
G1 C270 X0
G1 C360 Y0
G1 C0
G1 C-90 X-15
G1 C-180 Y-15
G1 C-270 X0
G1 C-360 Y0
G1 Z5
M429 ;Trivkins
G1 X0 Y0 Z1 A0 C0
M2

View File

@@ -0,0 +1,15 @@
;# enable optional stop for m1
m429 ;trivkins
G0 X0 Y0 Z0 A0 C0
G0 C90 X10 Y0
G1 F1000 Z2
(debug,A expect: 10 0 2) m1
(debug,B expect: 10 0 2) m1
m428 ;tcp
(debug,C expect: 0 -10 2) m1
g1f1000 z0
(debug,D expect: 0 -10 0) m1
(debug,E expect: 0 -10 0) m1
m429 ;trivkins
(debug,F expect: 10 0 0)
m2

View File

@@ -0,0 +1,3 @@
; zmax zmin r frate n a b c dist
o<xyzbc_switchkins_sub> call [10] [5] [10][1000][3][0][20][45][20]
m2

View File

@@ -0,0 +1,24 @@
;M428 by remap: kinstype==1 (xyzac,xyzbc) (note: sparm=identityfirst)
o<428remap>sub
#<kinstype> = 1 ; xyzac,xyzbc
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M428:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M428: Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<428remap>endsub

View File

@@ -0,0 +1,24 @@
;M429 by remap: kinstype==0 Identity kinematics
o<429remap>sub
#<kinstype> = 0
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M429:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M429:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<429remap>endsub

View File

@@ -0,0 +1,24 @@
;M430 by remap: kinstype==2 userk kins
o<430remap>sub
#<kinstype> = 2
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M430:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M430:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<430remap>endsub

View File

@@ -0,0 +1,42 @@
(info: tests for values of [xyz]-rot-point)
o<centering>sub
#<xstart> = #1 (=-2.5)
#<ystart> = #2 (=-2.5)
#<xlen> = #3 (= 5)
#<ylen> = #4 (= 5)
#<zfinal> = #5 (=60)
#<n> = #6 (=12)
#<f> = #7 (=1000 feed)
#<angle> = 0
#<delta_angle> = [360/#<n>]
o1 if [exists [#<_hal[xyzac-trt-kins.x-rot-point]>]]
(debug,x-rot-point=#<_hal[xyzac-trt-kins.x-rot-point]>)
(debug,y-rot-point=#<_hal[xyzac-trt-kins.y-rot-point]>)
(debug,z-rot-point=#<_hal[xyzac-trt-kins.z-rot-point]>)
o1 endif
o2 if [exists [#<_hal[xyzbc-trt-kins.x-rot-point]>]]
(debug,x-rot-point=#<_hal[xyzbc-trt-kins.x-rot-point]>)
(debug,y-rot-point=#<_hal[xyzbc-trt-kins.y-rot-point]>)
(debug,z-rot-point=#<_hal[xyzac-trt-kins.z-rot-point]>)
o2 endif
M429 ;Identity kinematics
g0 x#<xstart> y#<ystart> z0 c0
M428 ;tcp
g61
o10 while [#<angle> le 360]
g1 f#<f>
#<angle> = [#<angle> + #<delta_angle>]
g0 c#<angle>
g1 x[#<xstart> + #<xlen>]
g1 y[#<ystart> + #<ylen>]
g1 x[#<xstart> + 0 ]
g1 y[#<ystart> + 0 ]
o10 endwhile
M429 ;Identity kinematics
g0 x0 y0 z#<zfinal> c0
o<centering>endsub

View File

@@ -0,0 +1,22 @@
; helix using switchkins (xyzac) a,c angles
o<helix_ac>sub
#<zmax> = #1 (=10)
#<zmin> = #2 (= 5)
#<r> = #3 (=10)
#<frate> = #4 (=1000)
#<n> = #5 (=3)
#<a> = #6 (=45)
#<b> = #7 (=0 NA)
#<c> = #8 (=20)
M429 ;Identity kinematics
g0 x[#<_x> - #<r>] ;adjust for radius
g10l20p0 x0y0 z#<zmax> a0 c0 ;new g54
M428 ;XYZAC
g0a#<a>c#<c> ;exercise a,c
f#<frate> g2i#<r>z#<zmin> p#<n> ;helix
M429 ;Identity kinematics
g0 x0 y0 z#<zmax> a0 c0 ;return to start
g0 x[#<_x> + #<r>] ;adjust restore
M428 ;XYZAC
o<helix_ac>endsub

View File

@@ -0,0 +1,22 @@
; helix using switchkins (xyzbc) b,c angles
o<helix_bc>sub
#<zmax> = #1 (=10)
#<zmin> = #2 (= 5)
#<r> = #3 (=10)
#<frate> = #4 (=1000)
#<n> = #5 (=3)
#<a> = #6 (=0 NA)
#<b> = #7 (=45)
#<c> = #8 (=20)
M429 ;Identity kinematics
g0 x[#<_x> - #<r>] ;adjust for radius
g10l20p0 x0y0 z#<zmax> b0 c0 ;new g54
M428 ;XYZBC
g0b#<b>c#<c> ;exercise b,c
f#<frate> g2i#<r>z#<zmin> p#<n> ;helix
M429 ;Identity kinematics
g0 x0 y0 z#<zmax> b0 c0 ;return to start
g0 x[#<_x> + #<r>] ;adjust restore
M428 ;XYZBC
o<helix_bc>endsub

View File

@@ -0,0 +1,47 @@
; ngcgui-compatible subroutine
(info: helix in each quadrant at angles A,C)
o<xyzac_switchkins_sub>sub
#<zmax> = #1 (=10)
#<zmin> = #2 (= 5)
#<r> = #3 (=10 radius)
#<frate> = #4 (=1000 feedrate)
#<n> = #5 (=3 n circles)
#<a> = #6 (=30 A angle)
#<b> = #7 (=0 B angle NA)
#<c> = #8 (=45 C angle)
#<dist> = #9 (=20 distance)
; quadrant I
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> a0 c0 ;MACHINE coordinates
g10l20p0 x0y0 z#<zmax> a0 c0 ;new g54
g0 x+#<dist> y+#<dist> z#<zmax> ;move to pattern center position
o<helix_ac> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]
; quadrant II
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> a0 c0
g10l20p0 x0y0 z#<zmax> a0 c0
g0 x-#<dist> y+#<dist> z#<zmax>
o<helix_ac> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]
; quadrant III
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> a0 c0
g10l20p0 x0y0 z#<zmax> a0 c0
g0 x-#<dist> y-#<dist> z#<zmax>
o<helix_ac> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]
; quadrant IV
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> a0 c0
g10l20p0 x0y0 z#<zmax> a0 c0
g0 x+#<dist> y-#<dist> z#<zmax>
o<helix_ac> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]
;final position
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> ;MACHINE coordinates
g10l20p0 x0y0 z#<zmax> ;new g54
o<xyzac_switchkins_sub>endsub

View File

@@ -0,0 +1,47 @@
; ngcgui-compatible subroutine
(info: helix in each quadrant at angles B,C)
o<xyzbc_switchkins_sub>sub
#<zmax> = #1 (=10)
#<zmin> = #2 (= 5)
#<r> = #3 (=10 radius)
#<frate> = #4 (=1000 feedrate)
#<n> = #5 (=3 n circles)
#<a> = #6 (=0 A angle NA)
#<b> = #7 (=30 B angle)
#<c> = #8 (=45 C angle)
#<dist> = #9 (=20 distance)
; quadrant I
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> b0 c0 ;MACHINE coordinates
g10l20p0 x0y0 z#<zmax> b0 c0 ;new g54
g0 x+#<dist> y+#<dist> z#<zmax> ;move to pattern center position
o<helix_bc> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]
; quadrant II
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> b0 c0
g10l20p0 x0y0 z#<zmax> b0 c0
g0 x-#<dist> y+#<dist> z#<zmax>
o<helix_bc> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]
; quadrant III
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> b0 c0
g10l20p0 x0y0 z#<zmax> b0 c0
g0 x-#<dist> y-#<dist> z#<zmax>
o<helix_bc> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]
; quadrant IV
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> b0 c0
g10l20p0 x0y0 z#<zmax> b0 c0
g0 x+#<dist> y-#<dist> z#<zmax>
o<helix_bc> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]
;final position
M429 ;Identity kinematics
g53 g0 x0y0 z#<zmax> ;MACHINE coordinates
g10l20p0 x0y0 z#<zmax> ;new g54
o<xyzbc_switchkins_sub>endsub

View File

@@ -0,0 +1,24 @@
;M428 by remap: select kinstype=0 genhexkins
o<428remap>sub
#<kinstype> = 0
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M428:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M428: Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<428remap>endsub

View File

@@ -0,0 +1,24 @@
;M429 by remap: select kinstype==1 Identity kinematics
o<429remap>sub
#<kinstype> = 1
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M429:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M429:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<429remap>endsub

View File

@@ -0,0 +1,24 @@
;M430 by remap: select kinstype==2 userk kins
o<430remap>sub
#<kinstype> = 2
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M30:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M430:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
(debug,STOP)
M2
o2 else
o2 endif
o<430remap>endsub

View File

@@ -0,0 +1,47 @@
o<test-xyzac> sub
(test-xyzac-kins with offsets and tool change)
( 5 AXIS XYZAC MILLING )
#<a_angle> = #1 (=20)
#<c_angle> = #2 (=30)
#<xy_max> = #3 (=30)
#<z_max> = #4 (=10)
#<feedrate> = #5 (=200)
#<tool1> = #6 (=1 1st Tool)
#<tool2> = #7 (=2 2nd Tool)
#<speed1> = #8 (=500)
#<speed2> = #9 (=600)
; 'square with 2 rounded corners'
#<x_max> = #<xy_max>
#<y_max> = #<xy_max>
#<g3_j> = #<xy_max>
N40 G00 G17 G40 G90 G94 Z10
(first tool - no z-offset)
T#<tool1> M6
S#<speed1> M3
G00 A#<a_angle> C#<c_angle>
G43 H#<tool1> Z0
G01 X#<x_max> F#<feedrate>
G01 Y#<y_max>
G01 X0
G03 X-#<x_max> Y0 I0 J-#<g3_j>
G00 Z#<z_max>
G00 X0
M5
(next tool- with z-offset)
T#<tool2> M6
S#<speed2> M3
G00 A#<a_angle> C#<c_angle>
G43 H#<tool2> Z0
G01 X-#<x_max> F#<feedrate>
G01 Y-#<y_max>
G01 X0
G03 X#<x_max> Y0 I0 J#<g3_j>
G0 Z#<z_max>
G0 X0 Y0
M5
A0 C0
o<test-xyzac> endsub

View File

@@ -0,0 +1,47 @@
o<test-xyzbc> sub
(test-xyzbc-trt-kins with offsets and tool change)
( 5 AXIS XYZBC MILLING )
#<b_angle> = #1 (=20)
#<c_angle> = #2 (=30)
#<xy_max> = #3 (=30)
#<z_max> = #4 (=10)
#<feedrate> = #5 (=200)
#<tool1> = #6 (=1 1st Tool)
#<tool2> = #7 (=2 2nd Tool)
#<speed1> = #8 (=500)
#<speed2> = #9 (=600)
;'square with 2 rounded corners'
#<x_max> = #<xy_max>
#<y_max> = #<xy_max>
#<g3_j> = #<xy_max>
G00 G17 G40 G90 G94 Z10
(first tool - no z-offset)
T#<tool1> M6
S#<speed1> M3
G00 B#<b_angle> C#<c_angle>
G43 H#<tool1> Z0
G01 X#<x_max> F#<feedrate>
G01 Y#<y_max>
G01 X0
G03 X-#<x_max> Y0 I0 J-#<g3_j>
G00 Z#<z_max>
G00 X0
M5
(next tool- with z-offset)
T#<tool2> M6
S#<speed2> M3
G00 B#<b_angle> C#<c_angle>
G43 H#<tool2> Z0
G01 X-#<x_max> F#<feedrate>
G01 Y-#<y_max>
G01 X0
G03 X#<x_max> Y0 I0 J#<g3_j>
G0 Z#<z_max>
G0 X0 Y0
M5
B0 C0
o<test-xyzbc> endsub

View File

@@ -0,0 +1,42 @@
(for the simulated 5 axis machine)
g21 g90 g94 g28
o200 sub
g0 b0 c0 (tool length change must happen with b,c=0)
g91 g28 z0 (could also be done with tool change position)
g90
g43.1 z#1 (change tool length)
g0z0 (move Z to apply new length)
x-100 b-45 c-180
g1 z-100 f2000
#100=-180
o100 while [ #100 le 180 ]
g1 x[100*cos[#100]] y[100*sin[#100]] c#100
#100=[#100+10]
o100 endwhile
g0 z0
x0 y0 b0 c0
o200 endsub
(cut around the "cone" with different tool lengths)
o200 call [50]
o200 call [80]
g61
g0 x-100 b-45 c-180
#100=-180
o101 while [ #100 lt 180 ]
g0 x[150*cos[#100]] y[150*sin[#100]] z-100 c#100
g1 w100 f2000 (drill)
g0 w0
#100=[#100+45]
o101 endwhile
g28
g49
m2