Hello Guest it is March 29, 2024, 08:15:25 AM

Author Topic: incremental mode, absolute movements in cycles  (Read 2145 times)

0 Members and 1 Guest are viewing this topic.

incremental mode, absolute movements in cycles
« on: April 01, 2019, 03:34:09 PM »
Following composition:

Milling machine 3 axes, Z+ upwards
Controller: CSMIO IP-M v3.016
Control: Mach4 v3804
CAM: Fusion 360
Postprocessor: newest Mach4 Config from Autodesk Portal: https://cam.autodesk.com/hsmposts?p=mach4mill

Program:
Code: [Select]
(1001)
N1 G90 G94 G91.1 G40 G49 G17
N2 G21

(DRILL3)
N3 M5
N4 M9
N5 T3 M6
(MRKLEN_1115600600 - D6MM - SPOT DRILL)
N6 S1857 M3
N7 G54.1 P2
N8 M8
N10 G0 X8.08 Y4.075
N11 G43 Z39. H3
N12 M98 P0001
N13 G54.1 P3
N14 M8
N15 G0 X8.08 Y4.075
N16 Z39.
N17 M98 P0001


N142 M9
N143 M64 P41
N144 G04 P1.0
N145 M65 P41
N146 M30

O0001(DRILL3)
G91
G17
G0 Z-10.
G98 G82 X0. Y0. Z-2.65 R-15.25 P0.06 F56.
G80
Z10.
G90
M99


Quote
O0001(DRILL3)
G91
...
G0 Z-10.
G98 G82 X0. Y0. Z-2.65 R-15.25 P0.06 F56.

G91: incremental mode,
G0 Z-10 .: Z moves down 10mm = absolute Z=29
G98 G82 X0. Y0. Z-2.65 R-15.25 P0.06 F56 .: Z moves with rapid traverse to absolute Z=-15.25 through the workpiece and drills up with F=56 to absoulte Z=-2.65.  ???
Correct would be: Z drive down 15.25mm and drill 2.65mm deep.
G82 values are not interpreted incrementally.

Information about G82 in the Mill GCode Programming.pdf page 57, 60 in the Docs folder.


Is it due to mach4 or the csmio controller?

« Last Edit: April 01, 2019, 03:37:01 PM by HeadyCS »

Offline reuelt

*
  •  520 520
    • View Profile
Re: incremental mode, absolute movements in cycles
« Reply #1 on: April 01, 2019, 04:23:11 PM »
your subroutine call
N17 M98 P0001
is missing an L parameter
e.g. If you call subroutine 2 times,
line 17 should be
N17 M98 P0001 L2 


Reuel
« Last Edit: April 01, 2019, 04:30:38 PM by reuelt »
"the gift of God is eternal life through Jesus Christ our Lord"
Re: incremental mode, absolute movements in cycles
« Reply #2 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 enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline reuelt

*
  •  520 520
    • View Profile
Re: incremental mode, absolute movements in cycles
« Reply #3 on: April 01, 2019, 04:54:47 PM »
G82 depth is always absolute
G91 (incremental mode) will allow shifting x & y incrementally so you can drill multiple holes using G82 canned cycles.
(info is from Fanuc as I think Mach4 (unlike Mach3) is following Fanuc very closely)
"the gift of God is eternal life through Jesus Christ our Lord"
Re: incremental mode, absolute movements in cycles
« Reply #4 on: April 02, 2019, 04:30:16 AM »
The program code comes from the post processor.


I tried the G82 line with different values in the Mach4 with simulation device to see what happens.
First some information:
Absolute Z 11.1 is 0.5mm above surface --> surface at 10.6
The drilling depth should be 2.15mm below the surface --> 2.65-0.5=2.15

G98 G82 X0. Y0. Z-2.65 R11.1 P5.06 F56.

This happens:
Move to absolute Z=11.1 and start drilling to absolute Z=-2.65
The drilling depth under the surface is 13.25mm

This shows Z and R are absolute values.

I add a picture of Mach4 CNC Controller Mill Programming Guide Version 1.1 Build 3775 from the Docs folder.
"In G91: Distance and direction along Z axis, from point R, to bottom of hole"
Then that does not match.


Offline reuelt

*
  •  520 520
    • View Profile
Re: incremental mode, absolute movements in cycles
« Reply #5 on: April 02, 2019, 05:49:57 AM »
FYI: See G82 of FANUC (attached)
Z is absolute
"the gift of God is eternal life through Jesus Christ our Lord"
Re: incremental mode, absolute movements in cycles
« Reply #6 on: April 02, 2019, 02:23:50 PM »
Thanks for sharing.

I have adapted the postprocessor. Subprograms use absolute mode now.
If it runs, the next run will show.
Re: incremental mode, absolute movements in cycles
« Reply #7 on: April 02, 2019, 07:06:58 PM »
Hi,
I must say I always thought that the X an Y coordinates were capable of incremental movement whereas the Z and R coordinates
were not. However the screen shot from the Gcode manual (build3775) certainly shows R and Z as being incremental.

I have a copy of Peter Smid "CNC Programming Handbook, 2nd ed.", often called the "Bible of CNC" and it describes
(page 179) R and Z parameters as being capable of incremental adjustment. It is repeated explicitly at the bottom
of page 180.

Thus we have two references that would indicate that incremental R and Z would work however your experimentation
and the Fanuc reference indicate otherwise. Mach Gcode has always been touted as 'Fanuc like', so much so that it
is often possible to use a Fanuc post and get nearly compliant code for a Mach machine.

Mach4 has progressed with new features and much improved rework of existing features over the last two years
and has outstripped the documentation. It is often negatively commented on but NFS has not the resources to do both.
I think this is another example of that.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: incremental mode, absolute movements in cycles
« Reply #8 on: April 04, 2019, 12:14:11 AM »
I use G91 in canned cycles if I'm doing a single hole and i don't want to adjust the operators current work offset.
I can even use G91 on our new Haas machines.
I will try and double check tomorrow and see about G99 and G98 with the G91.  We've been busy at the shop this past week, but I'll see if I can give it a try on two mills tomorrow.
Chad Byrd

Offline reuelt

*
  •  520 520
    • View Profile
Re: incremental mode, absolute movements in cycles
« Reply #9 on: April 04, 2019, 02:14:52 PM »
I use G91 in canned cycles if I'm doing a single hole and i don't want to adjust the operators current work offset.
I can even use G91 on our new Haas machines.
I will try and double check tomorrow and see about G99 and G98 with the G91.  We've been busy at the shop this past week, but I'll see if I can give it a try on two mills tomorrow.
G82 canned cycle on Haas
R can be anything on a HAAS. Unlike some other controls, the R value is absolute. R-.05 means Z-.05 which is the way it makes sense

So Fanuc (world most popular) and Haas (world 2nd most popular) both says Z & R in G82 are ABSOLUTE!
There are some other controls (less popular one!!) that allow incremental mode for z and R

MACH4 following the world #1 & world #2,  is a GOOD thing.
"the gift of God is eternal life through Jesus Christ our Lord"