Did you write this or get it from somewhere? One error is at the beginning in these lines:
G43 Z2. H1 T2
Z.1
G1 Z.1 F25.
M8
M98 P2
When the sub is called the tool is at Z.1 above the work so of course it has to make four circuits going down Z-.025 before it reaches the top of the work.
Also some of the commands don't seem to make sense such as this:
G0 X-.45 Y0.
Z-.0136
G1 Z-.0136 F25.
The machine is in absolute and rapid mode from the G0X-.45 Y0. command so the next line Z-.0136 does a rapid move down to this position; the G1 Z-0.0136 does nothing because the tool is already at that position.
Regarding this question:
I want to be able to write a sub in incremntal mode for this type of scenario, and know how to handle the difference left over after dividing by my cutting increment (say .025).
One way to do this is to start slightly above the surface so the final incremental pass is at the correct depth. Actually your code does this but it starts way too high and has a lot of unnecessary stuff.
You want to go to a depth of 0.568 using 0.025 per pass. Diviiding 0.568 by 0.025 gives 22.72 passes. It is impossible to get .72 of a pass so you us 23 which would take you down to 0.575 which is 0.007 deeper than you want to go. So you start at Z+0.007 and go down 23 times 0.025 to finish at -0.568.
Then you would need to do a final circuit without an Z value to remove the helical ramp at the bottom.


LinkBack URL
About LinkBacks





