allego qui un programmino per eseguire tasche circolari anche con isola
parametrico con "named parameters" ( anche con aiuto del Sig. Silverio..)
Codice: Seleziona tutto
G17 G21 G40 G49 G80 G90 G91.1 G94 G98
G58 ;AKTIVE WCS
t19m6
s5000m3f6000
; CIRCULAR POCKETING WITH OR WITHOUT ISLAND
#<R-tool>=5 ;TOOL-RADIUS
#<R1>=50 ;exsternal radius of circular pocket
#<R2>=10 ;internal radius of circular pocket
#<X-center> = 0 ;X of spiral center
#<Y-center> = 0 ;Y of spiral center
#26 = 0 ;Z plane to reach
#<retract> = 10 ;Retract height
#<Spir-inc> = 5 ;Spiral increment for turn
#17 = 10 ;depth total
#4 = 2 ;depth increment
#9 = 2000 ;Feed to cut
#11 = 400 ;Feed to Z-increment
;-----------
#<R1>=[#<R1>-#<R-tool>] ;exsternal-radius minus tool-radius
#<R2>= [#<R2>+#<R-tool>] ;internal radius plus tool-radius
;-----------
G0 X#<X-center> Y#<Y-center>
G0z50
G65 P1000 X#<X-center> Y#<Y-center> R#<retract> Z0 A#<R1> B#<R2> C#<Spir-inc> F#9 H#11 Q#17 I#4
g0z80
g0x150
M2 ;---------------------------------------------
; Spiral motion from R1 to R2 with increment
;tasca-circolare con o senza isola
O1000
#90=[#17/#4] ; label repeats in Z
G1 Z#18 ; z sicura
G0 X#<X-center> Y#<Y-center> ;x0y0
G0 Y#<R1> ; moves to R1 (external radius)
g90
g1z#26 F#9 ;posiziona Z0
m98 p200 l#90
m99
;-------------------------------
o200
g91
g1z-#4 F#11 ;incremental Z
G90
; first full circle
G3 J-#<R1> F#9
; spiral loop from R1 to R2
#<quantum>=1
#<turns>=[FUP[[#<R1>-#<R2>]/#<Spir-inc>]]
#<iters>=[360*#<turns>/#<quantum>]
#<i>=0
#<v>=#<R1>
WHILE [#<i> LE #<iters>] DO01
#<x>=[#<X-center>+#<v>*[SIN[#<i>]]]
#<y>=[#<Y-center>+#<v>*[COS[#<i>]]]
G1 X-#<x> Y#<y>
#<i>=[#<i>+#<quantum>]
#<v>=[#<v>-[[#<R1>-#<R2>]/#<iters>]]
IF [#<v> LT #<R2>] THEN #<v>=#<R2>
END01
;latest full circle
G3 J-#<R2>
G1 y#<R1> ; return to initialing radius
M99