On Friday 27 September 2019 15:39:52 Ken Strauss wrote: > (modified KRS 27 Sep 19) > (Based on: https://gist.github.com/reox/a60c67db53eb563a4f8e) > #<_pocketDia>= 1.5 > #<_pocketRad> = [#<_pocketDia> / 2] > #<_pocketX> = 0.000 > #<_pocketY> = 0.000 > #<_pocketZ> = 0.000 > #<_finalZ> = -0.5 > > > #<_toolNum> = 43 > #<_feedIPM> = 40 > #<_feedRPM> = 9999 > #<_toolDoC> = 0.1 > #<_WoCfact> = 0.25 ; max WoC = 25% of tool diameter > > > G20 ; inches rather than metric > G90 ; absolute coordinates > G92.1 ; no offsets > G30 ; ensure in a good place > G54 ; set coordinate system > G17 ; active plane is XY > > T#<_toolNum> M6 G43 H#<_toolNum> > #<_toolDia> = #5410 > #<_toolRad> = [#<_toolDia> / 2] > #<_toolWoC> = [#<_toolDia> * #<_WocFact>] ; calculate Width of > Cut ; calculate # turns with allowed maximum WoC > #<_turns> = [FUP[[#<_pocketRad> - #<_toolRad>] / #<_toolWoC>] ] ; > number of turns to pocket circle > ; adjust WoC downwards to get exact total cut > (debug,#<_toolWoC> is maximum WoC) > #<_toolWoC> = [[#<_pocketRad> - #<_toolRad> - #<_toolWoc>] / > #<_turns>] (debug,#<_toolWoC> is adjusted WoC) > #<_toolWoC> = [[#<_pocketRad> - #<_toolRad> - #<_toolWoc>] / > #<_turns>] (debug,#<_toolWoC> is actual WoC) > ; first helix down in the middle of the pocket > ; the diameter of the helix is the tool diameter + stepover > #<_helixTurns> = FUP[[#<_pocketZ> - #<_finalZ>]/ #<_toolDoC>] > ; adjust DoC to get integral number of turns > #<_toolDoC> = [-[#<_pocketZ> + #<_finalZ>]/#<_helixTurns>] > (debug,#<_helixTurns> helix turns) > (debug,#<_toolDoC> adjusted DoC) > #<_helixFeed> = [#<_feedIPM> / 2] ; feed slower in helix > M3 S#<_feedRPM> ; set spindle RPM > F#<_helixFeed> ; set feed IPM > G0 X#<_pocketX> Y#<_pocketY> Z#<_pocketZ> > G3 I#<_toolWoC> Z#<_finalZ> P#<_helixTurns> > > F#<_feedIPM> ; set feed rate for clearing cuts > ( we will approximate the desired spiral #<_segments>]segments) > #<_segments> = 40 > #<_degrees> = [360 / #<_segments>] > ( so to go #<_turns> requires #<_segments> * #<_turns> moves) > #<_moves> = [#<_segments> * #<_turns>] ; # turns to clear pocket > #<_currentZ> = #<_pocketZ> > (debug,#<_currentZ> initial currentZ) > o200 repeat [#<_helixTurns>] > G90 > G0 X#<_pocketX> Y#<_pocketZ> > #<_currentZ> = [#<_currentZ> - #<_toolDoC>] > G0 Z#<_currentZ> > G91 G1 X#<_toolWoC> Y0 ; offset from pocket centre by WoC > G92 X#<_toolWoC> Y0 ; offset coordinate system > > o100 repeat [#<_moves>] > (we must increase the radius of each segment by [#<_toolWoC> / > #<_segments>]) (following magic move is in polar coordinates) > g91 G1 @[#<_toolWoC> / #<_segments>] ^[#<_degrees>] > > o100 endrepeat > > G92.1 ; reset coordinate offset > G90 ; absolute coordinates > G91.1 ; absolute arc mode > > (do a real circle at to finish current pocket level) > G1 X[#<_pocketRad> - #<_toolRad>] > G3 I[#<_toolRad>-#<_pocketRad>-#<_pocketX>] > > o200 endrepeat > > G0 Z[#<_finalZ>+.005] ; move off the pocket bottom to prevent > marks G0 X#<_pocketX> Y#<_pocketY> ; move to centre of pocket > M5 ; spindle off > G0 Z[#<_pocketZ>] ; retract to top of pocket > G30 > M30
Fur some reason, I had to convert the semi-colon's to full comments. Wordwrap in my editor of choice probably. But thats downright purty. Best looking backplot I've ever seen for a round pocket. Thank you Ken. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page <http://geneslinuxbox.net:6309/gene> _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users