2731
Mach4 General Discussion / Re: incremental mode, absolute movements in cycles
« on: April 01, 2019, 04:42:22 PM »
Hi,
I think you are misinterpreting what the G82 command does, its not a fault of Mach nor your controller.
Note in the manual that g82 is the same as g81 but with dwell at the bottom of the hole. The picture attached
is the diagrammatic description of how g81 works.
Your initial point is 29 mm above the material.
The first movement is the rapid from its initial point to the retract plane which you have specified as -15.25mm
BELOW the surface of the material. Note the retract plane is NOT a RELATIVE move, but an absolute one.
Try this code:
g82 x0 y0 z-2.65 r5 p0.06 f56
Now what will happen is that the first move will be a rapid from its initial 29mm to 5mm above the surface then
drill to a depth of 2.65mm below the surface at a feed rate of 56mm/min then dwell then retract at rapid rate to 5mm
above the surface.
Note also that I have deliberately coded all letters as lower case and stripped out all leading zeros.
The Gcode interpreter does just exactly that, so it would convert G082 to g82 for instance. Usually this
happens without fault but every once and a while it fails and you end up with a weird fault which is really hard
to spot. As a consequence I am slowly getting into the habit of lowercase letters and no leading zeros.
Note the interpreter also strips out white space but I find it just too hard to read without blank spaces.
Another trap is that the Gcode interpreter expects a certain number of arguments and if it does not get them it
can fail. In this regard Mach3 was quite slack. For instance this was acceptable in Mach3:
g82 x0 y0 z-2.65 r5 p0.06 f56
g82 x10 y10
g82 x20 y20
but it would fail in Mach4 because if it encounters a canned cycle declaration it requires all parameters to be on that
line. In the code snippet above the second and third lines are effectively new definitions of the canned cycle and as
such require complete parameters. This is how you would code it in Mach4:
g82 x0 y0 z-2.65 r5 p0.06 f56
x10 y10
x20 y20
g80
So the g82 canned cycle is MODAL and therefore the second line repeats the g82 cycle but with x and y parameters
only modified to 10 and 10 and all remaining parameters stay the same. The g80 at the end concludes the cycle.
In interest of completeness I would add the 'l' parameter to the coded line. I believe however a l parameter of 1
works because each time the canned cycle is executed it gets called anew. If you had l=2 then the hole would be
drilled twice but in the same location.
g82 x0 y0 z-2.65 r5 p0.06 f56 l1
Mach4 is somewhat stricter about canned cycles whereas mach3 was slack.
Craig
I think you are misinterpreting what the G82 command does, its not a fault of Mach nor your controller.
Note in the manual that g82 is the same as g81 but with dwell at the bottom of the hole. The picture attached
is the diagrammatic description of how g81 works.
Your initial point is 29 mm above the material.
The first movement is the rapid from its initial point to the retract plane which you have specified as -15.25mm
BELOW the surface of the material. Note the retract plane is NOT a RELATIVE move, but an absolute one.
Try this code:
g82 x0 y0 z-2.65 r5 p0.06 f56
Now what will happen is that the first move will be a rapid from its initial 29mm to 5mm above the surface then
drill to a depth of 2.65mm below the surface at a feed rate of 56mm/min then dwell then retract at rapid rate to 5mm
above the surface.
Note also that I have deliberately coded all letters as lower case and stripped out all leading zeros.
The Gcode interpreter does just exactly that, so it would convert G082 to g82 for instance. Usually this
happens without fault but every once and a while it fails and you end up with a weird fault which is really hard
to spot. As a consequence I am slowly getting into the habit of lowercase letters and no leading zeros.
Note the interpreter also strips out white space but I find it just too hard to read without blank spaces.
Another trap is that the Gcode interpreter expects a certain number of arguments and if it does not get them it
can fail. In this regard Mach3 was quite slack. For instance this was acceptable in Mach3:
g82 x0 y0 z-2.65 r5 p0.06 f56
g82 x10 y10
g82 x20 y20
but it would fail in Mach4 because if it encounters a canned cycle declaration it requires all parameters to be on that
line. In the code snippet above the second and third lines are effectively new definitions of the canned cycle and as
such require complete parameters. This is how you would code it in Mach4:
g82 x0 y0 z-2.65 r5 p0.06 f56
x10 y10
x20 y20
g80
So the g82 canned cycle is MODAL and therefore the second line repeats the g82 cycle but with x and y parameters
only modified to 10 and 10 and all remaining parameters stay the same. The g80 at the end concludes the cycle.
In interest of completeness I would add the 'l' parameter to the coded line. I believe however a l parameter of 1
works because each time the canned cycle is executed it gets called anew. If you had l=2 then the hole would be
drilled twice but in the same location.
g82 x0 y0 z-2.65 r5 p0.06 f56 l1
Mach4 is somewhat stricter about canned cycles whereas mach3 was slack.
Craig