Originally Posted by
sinha_nsit
It so turns out that many things are parameter dependent, and nothing can be said with certainty. So, I have written the following, which is a part of my notes. If you have patience, please read it once, and point out mistakes/ambiguity, if any.
Hole position data
The location of the axis of the hole can be specified in both absolute and incremental coordinate systems. In front drilling, (X, C) are absolute coordinates, and (U, H) are corresponding incremental coordinates. In side drilling, (Z, C) and (W, H) are, respectively, absolute and incremental coordinates. The incremental coordinates are measured from the position of the tool at the time of calling the canned cycle. In front drilling, X/U are diameter values, if diameter programming is being used. In G-code system B and C, G90/G91 with X, C, and Z are used for absolute/incremental coordinates.
Position of the bottom of the hole
Z and X are absolute coordinates of the bottom of the hole, in front drilling and side drilling, respectively. The corresponding incremental coordinates are W and U, which are measured from the R-point level, and are always negative. In side drilling, X/U are diameter values, if diameter programming is being used. Therefore, for example, if the distance between the R-point and the bottom of the hole is 10 mm, U-20 (G91 X-20 in G-code system B and C) would need to be specified, in diameter programming.
Position of R-point
In G-code system B and C, depending on certain parameter settings, R would either always be incremental distance from the initial level (irrespective of G90/G91), or it can be either absolute coordinate or incremental distance from the initial level (depending on G90 and G91, respectively). In system A, which we are following, this is again parameter dependent; it can be either absolute coordinate or incremental distance from the initial level. Since parameter settings are going to vary on different machines, the best way would be to execute a program on the machine, in a safe working zone, to find out whether R is absolute or incremental. Another way would be to set the parameter 5102#6 to 0, which would force R to always be the incremental distance from initial level, in all the three G-code systems. The incremental distance would always be negative in this case.
Another issue regarding its value, in side drilling (in front drilling, it is always the actual distance), is that whether it would be a diameter value (in diameter programming) or a radius value (even in diameter programming), depending on parameters. Therefore, either conduct an experiment on the machine to find out what it is, or set parameter 5102#7 to 0 which would always force it to be a radius value.
Peck length
This is specified in multiples of least input increment, without a decimal point. Thus, in millimeter mode, micron (0.001 mm) is used, and in inch mode, thou, which is thousandth part of an inch (i.e., 0.0001 inch), is used. For example, for a peck length of 5 mm, Q5000 is programmed in millimeter mode. In inch mode, if 0.2 inch peck length is desired, Q2000 is programmed. If Q is not commanded, the entire hole is made in a single peck, converting the peck drilling cycle into a simple drilling cycle.
Dwell at the bottom of the hole
If needed, e.g., for a better-machined bottom, a dwell can be specified in milliseconds without a decimal point.
Feedrate
It can be specified either in feed/minute or feed/revolution, depending on selection of feedrate mode (G98/G99, respectively, in G-code system A). The two feedrate forms are related as
Feed in mm/min = Feed in mm/rev x RPM
Repeat count
Repeating a cycle in absolute coordinate mode (X, Z, and/or C) is meaningless since the specified drilling operation would be carried out at the same place repeatedly. However, in incremental coordinate mode (U, W, and/or H), a desired number of equi-spaced holes can be very conveniently made just by a single command.
The repeat count is specified in K_, as a one-shot (non-modal) data, effective only in the block where it is commanded. Up to 9999 repeats can be specified. For a single execution, specify K1, or do not specify K at all. K0 is same as K1, if parameter 5102#4 is set to 0. When 5102#4 is set to 1, the specified modal drilling data is just stored without drilling being performed.
M codes for C-axis clamp/unclamp
After orienting the main spindle at the specified angle, it is necessary to hold it rigidly (as if in a vice) for drilling holes in the workpiece. In other words, the C-axis must be clamped. This is done through an M code, specified in parameter 5110, which applies a mechanical brake on the spindle. For example, if 31 (the usual choice) is stored in parameter 5110, M31 would clamp the spindle. The next number automatically becomes the code for spindle unclamp. Thus, in this example, M32 would release the brake. Of course, spindle unclamp at R-point, during final retraction, is a built-in feature of these cycles, obviating the need for explicitly commanding M32. In fact, this is the reason why M31 is needed in every subsequent block of these cycles (for making holes at other locations). Note that, for light machining applications, mechanical clamping of the spindle is not needed. In fact, M31 should not be commanded unless it is absolutely necessary, since it increases the cycle time.
Final retraction after hole machining
There is some difference in the way these cycles are commanded/behave in different G-code systems. The description here refers to system A. System-B and system-C cycles are similar to canned cycles on milling machines, with provision for selection between R-point retraction and initial level retraction with G99 and G98, respectively. In system A, the final retraction is always up to the initial level.
Cancellation of canned cycles
Apart from the cancellation code G80, which is the usual and recommended method, these cycles can also be cancelled by commanding a G code belonging to group 1 (G00, G01, G02 and G03).