TOC PREV NEXT INDEX

National Institute of Standards and Technology


4 Output: the Canonical Machining Functions


4.1 Introduction

This section describes the canonical machining functions. This section is intended to be useful to developers, researchers, and NC programmers using the SAI. Others should not need to read it. Earlier, but nearly identical, versions of these functions were described in a separate report, "Canonical Machining Commands" [Proctor].

The context for canonical machining functions is in a hierarchical control system. These functions are intended to tell a controller what to do at the control level below the level in which the Interpreter is running.

4.1.1 Objectives of Canonical Machining Functions

The canonical machining functions were devised with three objectives in mind.

First, all the functionality of common 3-axis to 6-axis machining centers (not turning centers) had to be covered by the functions; for any function a machining center can perform, there has to be a way to tell it to do that function.

Second, it was desired that it be possible to use readily available commercial motion control boards from various vendors to carry out those canonical functions which call for motion, with roughly a one-to-one correspondence between a canonical motion function and a command a commercial board recognizes.

Third, it must be possible to interpret RS274 commands into canonical machining function calls.

The first and third objectives still apply completely. The second objective, compatibility with motion control boards, has become less important as computer speed and power has increased to the point that motion control boards are not essential.

The canonical machining functions are atomic commands. Each function produces a single tool motion or a single logical action. Keeping the functions atomic was a side condition we imposed, both for clarity and to make mappings to commercial control boards straightforward. RS274 commands, on the other hand, include two types: those for which a single RS274 command corresponds exactly to a canonical function call, and those for which a single RS274 command will be decomposed into several canonical function calls (possibly dozens). Things like "move in a straight line" or "turn flood coolant on" are of the first type. Things like "turn all coolant off" or "run a peck drilling cycle" are of the second type.

4.1.2 Implementing Canonical Machining Functions

The name of each canonical machining function indicates roughly what it does. This report gives the syntax of the functions and gives function prototypes in the C or C++ programming language. The report also gives the semantics of the functions - what should happen when each function is executed. To aid in expressing functions, a number of types are defined (CANON_PLANE, for example). Each such type can have only a few symbolic values. CANON_PLANE must be one of CANON_PLANE_XY, CANON_PLANE_YZ, or CANON_PLANE_XZ, for example. All of these types are defined in Section 4.3.

This report does not provide definitions of the functions in any programming language. Sets of definitions for the canonical machining functions have been written in C++ for the controllers we have built which use them. Executing a function from any of these sets of definitions causes a machining center to do something.

We have used two other types of sets of definitions. The first alternate type simply has the function call print itself. Executing a function call causes a line of text containing the function call to be written to standard output or to a file. This type of set of definitions is used in the SAI. The second alternate type is also used for testing and debugging. In this type, executing a canonical function call generates a set of graphics calls for displaying a computer picture of the tool path made by executing the function call. A system has been built using this set with the Interpreter and the SAI driver to provide a graphical simulation of executing an RS274 program.

The Interpreter uses most but not all of the canonical machining functions. Those that are used are listed in Table 9.

Functionality
Functions
Representation
SET_ORIGIN_OFFSETS(double x, double y, double z, double a, double b, double c)
USE_LENGTH_UNITS(CANON_UNITS units)
Free Space Motion
STRAIGHT_TRAVERSE(double x, double y, double z, double a, double b, double c)
Machining
Attributes
SELECT_PLANE(CANON_PLANE plane)
SET_FEED_RATE(double rate)
SET_FEED_REFERENCE(CANON_FEED_REFERENCE reference)
SET_MOTION_CONTROL_MODE(CANON_MOTION_MODE mode)
START_SPEED_FEED_SYNCH()
STOP_SPEED_FEED_SYNCH()
Machining
Functions
ARC_FEED(double first_end, double second_end, double first_axis, double second_axis, int rotation, double axis_end_point, double a, double b, double c)
DWELL(double seconds)
STRAIGHT_FEED(double x, double y, double z, double a, double b, double c)
Probe
Functions
STRAIGHT_PROBE(double x, double y, double z, double a, double b, double c)
Spindle
Functions
ORIENT_SPINDLE(double orientation, CANON_DIRECTION direction)
SET_SPINDLE_SPEED(double r)
START_SPINDLE_CLOCKWISE()
START_SPINDLE_COUNTERCLOCKWISE()
STOP_SPINDLE_TURNING()
Tool
Functions
CHANGE_TOOL(int slot)
SELECT_TOOL(int i)
USE_TOOL_LENGTH_OFFSET(double offset)
Miscellaneous
Functions
COMMENT(char * s)
DISABLE_FEED_OVERRIDE()
DISABLE_SPEED_OVERRIDE()
ENABLE_FEED_OVERRIDE()
ENABLE_SPEED_OVERRIDE()
FLOOD_OFF()
FLOOD_ON()
INIT_CANON()
MESSAGE(char * s)
MIST_OFF()
MIST_ON()
PALLET_SHUTTLE()
Program
Functions
OPTIONAL_PROGRAM_STOP()
PROGRAM_END()
PROGRAM_STOP()
Table 9. Canonical Machining Functions Called By Interpreter
Function arguments are written in ANSI C style. All functions return nothing

4.2 Canonical Machining Function View of a Machining Center

The canonical machining functions are based on a particular view of what a machining center to be controlled is like. The view is as described in Section 2.1, with the changes described below. Some differences between the canonical machining function view and the RS274/NGC language view are given here.

4.2.1 Mechanical Components

4.2.1.1 Coolant

In addition to mist coolant and flood coolant, a machining center may have through-tool coolant. In the RS274/NGC language view, there is no through-tool coolant.

4.2.1.2 Axis Clamps

Each axis may have a physical device which, when activated, clamps the axis so it does not move. In the RS274/NGC language view, there are no axis clamps.

4.2.2 Control Components

The following control components are included in the canonical machining function view of a how a machining center may be controlled, but are not included in the RS274/NGC view. These control components cannot be used by a direct command from an RS274/NGC program, since they are not included in the language. Only coordination of axis and spindle motion is used indirectly by the Interpreter. That is used for implementing the G84 tapping canned cycle.

4.2.2.1 Coolant

Each type of coolant can be turned off independently. In the RS274/NGC view, although the different types of coolant may be turned on independently, all coolant is turned off by a single command.

4.2.2.2 Axis Clamps

Each axis may be commanded to clamp so it does not move, and commanded to unclamp. If the axis has a physical clamp, that clamp should be used. A software clamp may be used. Clamping any one axis or set of axes does not affect motion along the unclamped axes.

4.2.2.3 Elliptical Arc Motion

Any pair of the linear axes (XY, YZ, XZ) can be controlled to move in an elliptical arc in the plane of that pair of axes. While this is occurring, the third linear axis and the rotational axes can be controlled to move simultaneously at effectively a constant rate. As above, the motions can be coordinated so that acceleration and deceleration do not affect the path.

4.2.2.4 Coordinated Motion of Axes and Spindle

The rotation of the spindle can be coordinated with axis motion or de-coupled from it. In the RS274/NGC view, this is not programmable, but coordination occurs during tapping; see Section 3.5.16.5.

4.2.2.5 Feed Reference

The current feed rate may be referenced either to XYZ axis motion or to motion of the controlled point with respect to the workpiece. Only the XYZ feed reference is used in the Interpreter. In the RS274/NGC view, the XYZ feed reference is always used, so there is no command to change the feed reference.

4.2.2.6 Feed and Speed Overrides

These two switches may be enabled or disabled independently; in the RS274/NGC view, one single command enables both, and another single command disables both.

4.2.2.7 Units

Units used for distances along the X, Y, and Z axes may be measured centimeters, in addition to millimeters or inches. The RS274/NGC view does not include using centimeters. Centimeters are not used in the Interpreter.

4.2.2.8 Coordinate Systems

There are two coordinate systems: the absolute coordinate system of a machining center and a "program" coordinate system in which all axes may be offset from their absolute position. The offsets may be changed. All axis values given in all function calls (other than a function call setting the offsets) are expressed in terms of the program coordinate system.

4.2.3 Error Conditions

The controller which executes the canonical machining function calls should have at least two conditions: OK and error. If the controller is in the OK condition, it should perform as described here. If the controller is in the error condition, its behavior is up to the implementation. An implementation should document what its behavior is for all errors. A generic error behavior which we believe is reasonable is to stop execution of the current function call as soon as an error is detected and to be unwilling to execute any other canonical function calls until the error condition is corrected.

Many situations should put the controller into the error condition, as described later in this report. Wherever the phrase "it is an error" (or the equivalent) is used to describe a situation that may occur in the execution of a function call, the controller should always check for that situation during execution of the function call and should go into the error condition as soon as the situation is detected if the situation occurs.

In this report, error detection is described as being performed only by the controller receiving the canonical machining function calls. In an implementation, error detection might also be performed by the controller sending the function calls.

4.3 The Canonical Machining Functions Defined

4.3.1 Preliminaries

4.3.1.1 Syntax

The canonical machining functions are defined here using C++ syntax in courier type font. The same syntax is usable in ANSI C. Syntaxes for other computer languages may be derived readily without changing the semantics of the functions. All the canonical functions return void, so that bit of syntax is suppressed here.

Where an attribute may take on discrete values from a fixed set of values, the set is given here. The values in such sets are represented here as symbols beginning with "CANON_". In our implementations we have used both #define's and enum's for these symbols.

As given here, the functions include the A, B, and C rotational axes. If any of the rotational axis is not to be used, just omit the argument for that axis.

4.3.1.2 Function Call Errors

It is an error to call any function incorrectly. The arguments to a function must be as described here. This applies to the number and type of the arguments and also to the stated constraints on the arguments (such as being non-negative or being positive).

4.3.1.3 Groups of Functions

The canonical machining functions are grouped here into related sets. The grouping is for convenience only, and is not part of the definition. Within each group, the functions are listed alphabetically.

4.3.1.4 Rotational Motion Required

In the descriptions of the functions, the phrase "if there is rotational motion" is often used. In all cases, there is rotational motion if any of the rotational axis values in the function call differs from the current value of that axis.

4.3.2 Initialization and Termination

4.3.2.1 Init_canon
INIT_CANON ()

Do whatever initialization is required to be ready to execute other canonical machining functions. A call to this function should always be made before calling any other canonical machining function. Of course, the controller must already have been brought up to the state where it can read and execute this function call before the function call is received. That phase of initialization is outside the scope of this report.

4.3.2.2 End_canon
END_CANON ()

Do whatever is required to shut down in an orderly fashion. After a call to this function has been executed, if it is desired to begin executing function calls again, the first function call must be an INIT_CANON function call.

4.3.3 Representation

4.3.3.1 Select_plane
SELECT_PLANE (CANON_PLANE plane)

Use the plane designated by plane as the selected plane. The type CANON_PLANE may have the value CANON_PLANE_XY, CANON_PLANE_YZ, or CANON_PLANE_XZ. Any of these is an acceptable values for plane.

4.3.3.2 Set_origin_offsets
SET_ORIGIN_OFFSETS (double x, double y, double z,
double a, double b, double c)

Set the program origin at the point with absolute coordinates x, y, z, a, b, and c. The units for x, y, and z are whatever length units are being used at the time a call to this function is made. The units for a, b, and c are degrees. The effective location of the program origin should not change when units change. It is expected that controllers dealing with the program origin will ensure this. In a typical implementation, the numbers representing the coordinates will be changed when units change.

4.3.3.3 Use_length_units
USE_LENGTH_UNITS (CANON_UNITS units)

Use the specified units for length. The type CANON_UNITS is defined which may have the value CANON_UNITS_INCHES, CANON_UNITS_MM (millimeters), or CANON_UNITS_CM (centimeters). Any of these is an acceptable values of units. Changing units changes the effective numerical value of the current position. All other stored values which involve length units are not changed, including: coordinate system offsets, tool length offsets, tool diameters, feed rate, and traverse rate.

The Interpreter does not use CANON_UNITS_CM because there is no code for it in the RS274/NGC language.

4.3.4 Free Space Motion

4.3.4.1 Set_traverse_rate
SET_TRAVERSE_RATE (double rate)

Set the upper limit on the rate that will be used during rapid axis motion, motion during which cutting does not normally take place. During moves conducted at traverse rate, coordinated linear motion should take place as fast as possible or at this rate, whichever is less. The rate must be positive. The application of the rate is as described in Section 2.1.2.5.

4.3.4.2 Straight_traverse
STRAIGHT_TRAVERSE (double x, double y, double z,
double a, double b, double c)

Make a coordinated linear motion at traverse rate from the current position to the point given by x, y, z, a, b, and c. The application of the rate is as described in Section 4.3.5.1 for when the feed reference mode is CANON_XYZ, regardless of the setting of feed reference mode.

It is expected that no cutting will occur while a traverse move is being made.

4.3.5 Machining Attributes

4.3.5.1 Set_feed_rate
SET_FEED_RATE (double rate)

Set to rate the feed rate that will be used when the controlled point is told to move at the currently set feed rate. The rate must be non-negative.

The canonical machining functions (unlike the RS274/NGC language) do not include the notion of inverse time feed rate, so the question of behavior under inverse time feed rate does not arise.

The feed rate may also be affected by the feed override switch, if that switch is enabled.

If the USE_SPINDLE_FORCE or USE_SPINDLE_TORQUE mode is in effect, the set feed rate is an upper limit for the feed rate determined from the force or torque. While either of these modes is in effect, if the feed override switch is enabled and is set to change the feed rate, the feed rate determined from the force or torque and the upper limit are both changed proportionally. For example, if the feed rate is set to 600 millimeters per minute and the feed override switch is enabled and set to 80%, and the torque on the spindle is such that the machine would feed at 500 millimeters per minute if the override switch were disabled, then the actual feed rate should be 400 millimeters per minute (80% of 500), and the upper limit should be 480 millimeters per minute (80% of 600).

4.3.5.2 Set_feed_reference
SET_FEED_REFERENCE (CANON_FEED_REFERENCE reference)

This sets the feed reference mode. The type CANON_FEED_REFERENCE is defined. It may have the value CANON_WORKPIECE (feed rate is from the point of view of the workpiece) or CANON_XYZ (feedrate is in terms of axis motion). Either is an acceptable value of reference.

The meaning of feed rate changes depending on the feed reference mode. See the discussion immediately above.

The CANON_WORKPIECE feed reference mode is more natural and general, since the rate at which the tool passes through the material must be controlled for safe and effective machining. This mode does introduce complications, however.

First, some rule is required to define what the path should be. We have adopted the rule that the path should be the same as it is in the CANON_XYZ mode.

Second, computing the feed rate for each axis may be time-consuming because the trajectories that result from motion in four or more axes may be complex. Computation of axis feed rates when only XYZ motion is considered is relatively simple for two of the standard motion types (straight lines and helical or circular arcs).

Third, in CANON_WORKPIECE mode, some motions cannot be carried out as fast as the programmed feed rate would require because axis motions may tend to cancel each other. For example, an arc in the XZ-plane can exactly cancel a rotation around the B-axis, so that the location of the controlled point with respect to the workpiece does not change at all during the motion; in this case, the motion should take no time, which is impossible at any finite rate of axis motion. In such cases, the axes should be moved as fast as possible consistent with accurate machining.

Some (perhaps most or all) existing dialects of RS274 use only the CANON_XYZ mode [K&T, page 3.9]. The specification of RS274/NGC is not clear [NCMS, page 22], but appears to intend CANON_XYZ mode. Some dialects avoid the problem of dealing with how to interpret a per-minute feed rate when rotational axis motion occurs simultaneously with XYZ motion by suggesting [K&T, page 3.9] or requiring [Monarch, page 17-3] that the programmer use inverse-time feed rate mode. It may be that the calculations required in CANON_WORKPIECE mode were too extensive to be carried out sufficiently fast by real-time processors that existed at the time these languages were defined. Current real-time processors should be sufficiently fast to handle the calculations.

4.3.5.3 Set_motion_control_mode
SET_MOTION_CONTROL_MODE (CANON_MOTION_MODE mode)

Set the path control mode. The type CANON_MOTION_MODE is defined. It may have the value CANON_EXACT_STOP, CANON_EXACT_PATH, or CANON_CONTINUOUS. Any of these is an acceptable value of mode.

In CANON_EXACT_STOP mode, the control stops motion at the end of each move exactly (within the tolerance the control system can achieve) at the programmed or calculated end point. The stop is preceded by deceleration at the maximum normal rate, so that motion is kept at the set feed rate for as long as possible. If there is a subsequent move, the stop is as brief as possible and is followed by acceleration to the programmed feed rate at the maximum normal rate of acceleration.

In CANON_EXACT_PATH mode, the control keeps the controlled point on the programmed or calculated path within the tolerance the control system can achieve at all times. At points which are the end point of one move and the start point of the next move, the feed rate is kept constant if possible. It should be possible to avoid changing the rate of motion at such a juncture if the direction of the path of the controlled point does not change sharply at the juncture, for example if one straight move is in the same direction as the previous one, or if a straight move is tangent to a preceding or following arc move.

In CANON_CONTINUOUS mode, the control tries to keep the feed rate constant and does not try to keep the controlled point exactly on the path at all times. Rather, at junctures between moves where the direction changes sharply, the corner is rounded. There is a maximum allowable deviation at such junctures, and the control should never allow that to be exceeded; acceleration and deceleration may be performed if necessary to do this.

Currently, there is no function to set the maximum deviation allowable in CANON_CONTINUOUS mode.

4.3.5.4 Start_speed_feed_synch
START_SPEED_FEED_SYNCH ()

Begin exact synchronization of spindle turning with feed motion.

The primary purpose of this synchronization is to provide for effective tapping of holes. In order to make a clean thread, the axial motion of a tap must be synchronized with its turning motion. In addition to this synchronization, the feed and speed rates must be set so their ratio is suitable for the pitch of the thread.

The type CANON_SPEED_FEED_MODE is defined. It may have the value CANON_SYNCHED (for coupled) or CANON_INDEPENDENT (for uncoupled). The type is used by the Interpreter to keep track of the current state of synchronization.

4.3.5.5 Stop_speed_feed_synch
STOP_SPEED_FEED_SYNCH ()

Stop forcing synchronization of spindle turning with feed motion. Deal with acceleration and deceleration of the spindle and the axes independently.

4.3.6 Machining Functions

4.3.6.1 Arc_feed
ARC_FEED (double first_end, double second_end,
double first_axis, double second_axis, int rotation,
double axis_end_point, double a, double b, double c)

Move in a helical arc from the current position at the existing feed rate. The axis of the helix is parallel to the X, Y, or Z-axis, according to which one is perpendicular to the selected plane. The helical arc may degenerate to a circular arc if there is no motion parallel to the axis of the helix.

If the selected plane is the XY-plane:

If the selected plane is the YZ-plane:

If the selected plane is the XZ-plane:

If rotation is positive, the arc is traversed counterclockwise as viewed from the positive end of the coordinate axis perpendicular to the currently selected plane. If rotation is negative, the arc is traversed clockwise. If rotation is 0, first_end and second_end must be the same as the corresponding coordinates of the current position and no arc is made (but there may be translation parallel to the axis perpendicular to the selected plane and rotational axis motion). If rotation is 1, more than 0 but not more than 360 degrees of arc should be made. In general, if rotation is n, n is not 0, and we let N be the absolute value of n, the absolute value of the amount of rotation in the arc should be more than ([N-1] x 360) but not more than (N x 360).

The radius of the helix is determined by the distance from the current position to the axis of helix or by the distance from the end location to the axis of the helix. It is an error if the two radii are not the same (within some tolerance, to be set by the implementation).

The feed rate applies to the distance traveled along the helix. This differs from many existing systems, which apply the feed rate to the distance traveled by a point on a circle which is the projection of the helix on a plane perpendicular to the axis of the helix.

Rotational axis motion along with helical XYZ motion has no known applications, but is not illegal. Rotational axis motion is handled as follows, if there is rotational motion.

4.3.6.2 Dwell
DWELL (double seconds)

Do not move the axes for the time specified by the seconds argument, which must be positive.

4.3.6.3 Ellipse_feed
ELLIPSE_FEED (double major, double minor,
double angle_to_first, double first_end,
double second_end,
double first_axis, double second_axis, int rotation,
double axis_end_point, double a, double b, double c)

Move in an elliptical helical arc from the current position at the existing feed rate. The axis of the helix is parallel to the X, Y, or Z-axis, according to which one is perpendicular to the selected plane. The elliptical helical arc may degenerate to an elliptical arc if there is no motion parallel to the axis of the helix.

The length of the major axis (not the semi-major axis) of the ellipse is given by major, and the length of the minor axis by minor.

If the selected plane is the XY-plane:

If the selected plane is the YZ-plane:

If the selected plane is the XZ-plane:

If rotation is positive, the arc is traversed counterclockwise as viewed from the positive end of the coordinate axis perpendicular to the currently selected plane. If rotation is negative, the arc is traversed clockwise. If rotation is 0, first_end and second_end must be the same as the corresponding coordinates of the current position and no arc is made (but there may be translation parallel to the axis perpendicular to the selected plane and rotational axis motion). If rotation is 1, more than 0 but not more than 360 degrees of arc should be made. In general, if rotation is n, n is not 0, and we let N be the absolute value of n, the absolute value of the amount of rotation in the arc should be more than ([N-1] x 360) but not more than (N x 360).

Rotational axis motion along with elliptical helix XYZ motion has no known applications, but is not illegal. Rotational axis motion is handled as follows, if there is rotational motion.

The ellipse_feed function is much like the arc_feed function, except that the tool path is an elliptical helix rather than a circular helix. With an elliptical helix, there are at least two choices for how to coordinate motion parallel to the axis of the helix with motion around the axis. In both cases, we focus on a point P traveling along the elliptical helix. The "projected ellipse" of the helix is the projection of the helix on any plane perpendicular to the axis of the helix (which is, by definition, an ellipse). We define P' to be the projection of P on the projected ellipse and P" to be the projection of P on the axis.

We have implemented the second of these - because that is what the motion control board we were using would do. It might be useful to add a setting for the machining center or another argument to the function so that either of the two trajectory types could be selected.

The feed rate applies to the distance travelled along the helix by P. This differs from the one existing system we have used, which applies the feed rate to the distance traveled by a point on a circle which is a projection of the projected ellipse.

It is an error if the projections of the current point and the end point of the arc do not lie on the projected ellipse (within some tolerance, to be set by the implementation).

The functionality of the arc_feed function is the same as what the ellipse_feed function will do if the major and minor axes of the ellipse are equal. In that case, the value of the angle of the X-axis with the major axis of the ellipse is irrelevant, and the two trajectory rules give the same trajectory. It is useful to have both functions, however, because many applications may wish to implement only arc_feed, and because the arc_feed function is simpler.

4.3.6.4 Stop
STOP ()

Stop axis motion. Regardless of the current path control mode, come briefly to a stop at the end point of the last programmed move before going on to the next move.

4.3.6.5 Straight_feed
STRAIGHT_FEED (double x, double y, double z,
double a, double b, double c)

If there is no rotational motion, move the controlled point in a straight line at feed rate from the current position to the point given by the x, y, and z arguments. Do not move the rotational axes.

If there is rotational motion:

4.3.6.6 Straight_probe
STRAIGHT_PROBE (double x, double y, double z,
double a, double b, double c)

This performs a probing operation. A probe must be in the spindle. The probe may be a touch probe or a non-contact probe. There must be no rotational motion. The probe must not be already tripped when execution of a call to this function starts. The spindle must not be turning. The probe must be turned on. It is an error if any of those "musts" does not hold.

Points to be probed are usually not exactly where expected, so a small overshoot distance is included in probe motion. An overshoot point is defined by extending the line from the current point to the programmed point by the overshoot distance.

To execute a call to this function, start by moving the probe in a straight line at the currently programmed feed rate from the current position toward the overshoot point. The next steps depend on what type of probe is being used.

For a touch probe, it is expected that the probe will be tripped before the overshoot point is reached. It is an error for the probe to reach that position without being tripped. If the probe is tripped before the overshoot point is reached, the control should stop moving the axes as quickly as possible, move the axes back to where they were when the probe tripped, and stop at that point.

For a non-contact probe, it is expected that the probe will reach the programmed position. It is an error if not. The probe should either decelerate and stop at that point (gathering data all the way), or continue at full feed rate through the point (gathering data all the way), stop gathering data and stop moving as fast as feasible, then move back to the programmed position and stop.

An implementation may put limits on the acceptable range of feed rates for probing, as strict as requiring a specific value. It is an error to execute a straight_probe function call if the feed rate is not within the allowed range.

Functions for the Interpreter to call to get data after probing are given in Appendix D.6.

4.3.7 Spindle Functions

4.3.7.1 Orient_spindle
ORIENT_SPINDLE (double orientation, CANON_DIRECTION direction)

Turn the spindle (if it is not already correctly oriented) in the direction specified by direction to the angle specified by the orientation in degrees. Stop the spindle at that angle. Do not make a full turn or more. The type CANON_DIRECTION is defined. It may have the value CANON_STOPPED, CANON_CLOCKWISE, or CANON_COUNTERCLOCKWISE. Of these, only CANON_CLOCKWISE, or CANON_COUNTERCLOCKWISE is an acceptable value of direction. Orientation must be between 0 and 359.999.

The rate at which the spindle turns while orienting is up to the implementation.

The zero point of spindle rotation is along the positive X-axis.

The CANON_DIRECTION type is also used in the Interpreter to represent the state of the spindle. For that use, CANON_STOPPED is needed in addition to CANON_CLOCKWISE and CANON_COUNTERCLOCKWISE.

4.3.7.2 Set_spindle_speed
SET_SPINDLE_SPEED (double speed)

Set to speed the spindle speed that will be used when the spindle is turning. Speed is given in revolutions per minute (rpm) and refers to the rate of spindle rotation. Speed must be positive. If the spindle is already turning and is at a different speed, change to the speed given with this function. This function does not start the spindle if it is not turning.

An implementation should set an upper limit on spindle speed. It is an error if speed is larger than that limit.

4.3.7.3 Spindle_retract
SPINDLE_RETRACT ()

Retract the spindle at the current feed rate to the fully retracted position.

4.3.7.4 Spindle_retract_traverse
SPINDLE_RETRACT_TRAVERSE ()

Retract the spindle at traverse rate to the fully retracted position.

4.3.7.5 Start_spindle_clockwise
START_SPINDLE_CLOCKWISE ()

Turn the spindle clockwise at the currently set speed rate. If the spindle is already turning that way, this function has no effect. If the spindle speed is set outside the allowable range, it is an error to execute this function.

4.3.7.6 Start_spindle_counterclockwise
START_SPINDLE_COUNTERCLOCKWISE ()

Turn the spindle counterclockwise at the currently set speed rate. If the spindle is already turning that way, this function has no effect. If the spindle speed is set outside the allowable range, it is an error to execute this function.

4.3.7.7 Stop_spindle_turning
STOP_SPINDLE_TURNING ()

Stop the spindle from turning. If the spindle is already stopped, this function has no effect.

4.3.7.8 Use_no_spindle_force
USE_NO_SPINDLE_FORCE ()

Do not consider spindle force. Instead, use the feed rate to determine spindle motion. A call to this function does not reinstate use_spindle_torque (if, for example, using spindle torque was stopped earlier by a call to use_spindle_force).

4.3.7.9 Use_no_spindle_torque
USE_NO_SPINDLE_TORQUE ()

Do not consider spindle torque. Instead, use the feed rate to determine spindle motion. A call to this function does not reinstate use_spindle_force (if, for example, using spindle force was stopped earlier by a call to use_spindle_torque).

4.3.7.10 Use_spindle_force
USE_SPINDLE_FORCE (double force)

If the force on the spindle exceeds force (in newtons), reduce the feed rate until the force on the spindle drops below that amount. Use the programmed feed rate as an upper limit on the feed rate.

This is intended for adaptive machining. It requires that the machining center have a mechanism to measure the force. It is an error to execute this function if the machining center does not have such a mechanism.

A call to use_spindle_force cancels the use of spindle torque to affect feed rate (if it is in effect before the call).

4.3.7.11 Use_spindle_torque
USE_SPINDLE_TORQUE (double torque)

If the torque on the spindle exceeds torque (in newton-meters), reduce the feed rate until the torque on the spindle drops below that amount. Use the programmed feed rate as an upper limit on the feed rate.

This is intended for adaptive machining. It requires that the machining center have a mechanism to measure the torque. It is an error to execute this function if the machining center does not have such a mechanism.

A call to use_spindle_torque cancels the use of spindle force to affect feed rate (if it is in effect before the call).

4.3.8 Tool Functions

CHANGE_TOOL (int slot)

The slots of a tool changer are taken to be numbered consecutively from 1 to however many slots there are in the changer. The value of slot may be zero. It is an error if slot is not zero or the number of an actual changer slot.

This function results in the tool currently in the spindle (if any) being returned to its slot, and the tool from the slot designated by slot (if any) being inserted in the spindle. If slot is zero, no tool should be inserted in the spindle.

If there is no tool in the slot designated by slot, there will be no tool in the spindle after this function is executed and no error condition will result in the controller. Similarly, if there is no tool in the spindle when this function is executed, no tool will be returned to the carousel and no error condition will result in the controller, whether or not a tool was previously selected in the program. On the machining centers we have used, these actions do not harm the machine. If the machine design is such that these actions will harm the machine, we suggest that the superior controller check for potential harm before calling the CHANGE_TOOL function.

It is expected that when the machining center controller is initialized, the designated slot for a tool already in the spindle will be established. This may be done in any manner deemed fit, including (for, example) recording that information in a persistent, crash-proof location so it is always available from the last time the machining center was run, or having the operator enter it. It is expected that the machining center controller will remember that information as long as it is not re-initialized; in particular, it will be remembered between programs.

For the purposes of this function, the tool includes the tool holder.

For machining centers which can carry out a SELECT_TOOL function call separately from a CHANGE_TOOL function call, the SELECT_TOOL function call must have been executed before the CHANGE_TOOL function call, and the value of slot in the CHANGE_TOOL function call must be the slot number of the selected tool.

If the spindle is turning before a tool change, the spindle should be stopped by the CHANGE_TOOL function call and should not be restarted.

During a tool change, the machining center may move the axes, but when the tool change is complete, the axes should all be back to where they were before the tool change began. If the new tool is a different length than the old one, the tool tip will be in a different location.

If the spindle was oriented before a CHANGE_TOOL function call, changing the tool may disorient it.

A tool change has no effect on coolant use. Coolant must be turned on and off by a coolant function.

4.3.8.1 Select_tool
SELECT_TOOL (int slot)

Select the tool in the given slot. It is an error if slot is not zero or the number of an actual changer slot. If it is possible and efficient to do so, move the tool carousel so that the selected slot is in position for access by the tool changer.

If the changer mechanism can handle only one tool at a time, moving the carousel when a call to this function is executed is not usually an efficient thing to do, since the tool in the spindle must usually be removed and put into its slot first when the CHANGE_TOOL function call is executed. If the changer mechanism can handle two tools simultaneously, moving the carousel is usually an efficient thing to do.

4.3.8.2 Use_tool_length_offset
USE_TOOL_LENGTH_OFFSET (double length)

Set the tool length offset to the given length (in current length units). The length must be non-negative. The effective value of a tool length offset changes if length units are changed, as discussed in Section 4.3.3.3.

4.3.9 Miscellaneous Functions

4.3.9.1 Clamp_axis
CLAMP_AXIS (CANON_AXIS axis)

Clamp the given axis. The type CANON_AXIS is defined. It may have the value CANON_AXIS_X, CANON_AXIS_Y, CANON_AXIS_Z, CANON_AXIS_A, CANON_AXIS_B, or CANON_AXIS_C. Any of these is an acceptable value of axis, provided the machining center has such an axis.

It is an error to execute a function call which would move an axis while the axis is clamped.

4.3.9.2 Comment
COMMENT (char * text)

This function has no physical effect. If function calls are being printed or logged, the comment function call is printed or logged, including the string which is the value of text.

4.3.9.3 Disable_feed_override
DISABLE_FEED_OVERRIDE ()

Do not pay attention to the setting of the feed override switch. Make the feed rate have its programmed value immediately.

4.3.9.4 Disable_speed_override
DISABLE_SPEED_OVERRIDE ()

Do not pay attention to the setting of the speed override switch. Make the spindle speed have its programmed value immediately.

4.3.9.5 Enable_feed_override
ENABLE_FEED_OVERRIDE ()

Pay attention to the setting of the feed override switch. Modify feeds in accordance with the switch settings.

4.3.9.6 Enable_speed_override
ENABLE_SPEED_OVERRIDE ()

Pay attention to the setting of the speed override switch. Modify spindle speeds in accordance with the switch settings.

4.3.9.7 Flood_off
FLOOD_OFF ()

Turn flood coolant off. It is an error to execute a call to this function if the machining center does not have flood coolant.

4.3.9.8 Flood_on
FLOOD_ON ()

Turn flood coolant on. It is an error to execute a call to this function if the machining center does not have flood coolant.

4.3.9.9 Message
MESSAGE (char * text)

Display the text on the message display device.

4.3.9.10 Mist_off
MIST_OFF ()

Turn mist coolant off. It is an error to execute a call to this function if the machining center does not have mist coolant.

4.3.9.11 Mist_on
MIST_ON ()

Turn mist coolant on. It is an error to execute a call to this function if the machining center does not have mist coolant.

4.3.9.12 Pallet_shuttle
PALLET_SHUTTLE ()

If the machining center has a pallet shuttle mechanism (a mechanism which switches the position of two pallets), a call to this function should cause that switch to be made. If either or both of the pallets are missing, this will not result in an error condition in the controller.

4.3.9.13 Through_tool_off
THROUGH_TOOL_OFF ()

Turn through-tool coolant off. It is an error to execute a call to this function if the machining center does not have through-tool coolant.

4.3.9.14 Through_tool_on
THROUGH_TOOL_ON ()

Turn through-tool coolant on. It is an error to execute a call to this function if the machining center does not have through-tool coolant.

4.3.9.15 Turn_probe_off
TURN_PROBE_OFF ()

Turn the probe off. It is an error to execute a call to this function if the tool in the spindle is not a probe. It is not an error to call this function when the probe is already off.

4.3.9.16 Turn_probe_on
TURN_PROBE_ON ()

Turn the probe on. It is an error to execute a call to this function if the tool in the spindle is not a probe. It is not an error to call this function when the probe is already on.

4.3.9.17 Unclamp_axis
UNCLAMP_AXIS (CANON_AXIS axis)

Unclamp the given axis.

4.3.10 Program Functions

OPTIONAL_PROGRAM_STOP();

If the optional stop switch is on when a call to this function is read from a program, stop executing the program at this point, but be prepared to resume with the next line of the program.

PROGRAM_END();

If a program is being read, stop executing the program and be prepared to accept a new program or to be shut down.

PROGRAM_STOP();

Stop executing the program at this point, but be prepared to resume with the next line of the program.

4.3.11 Cutter Radius Compensation

Canonical machining functions for cutter radius compensation are defined as follows. These functions are not used in the Interpreter, which performs the cutter radius compensation itself, rather than passing the work on to lower levels of control, so NC programmers and machine operators should ignore this section. The type CANON_COMP_SIDE is defined which may have the value CANON_COMP_RIGHT, CANON_COMP_LEFT, or CANON_COMP_OFF.

4.3.11.1 Set_cutter_radius_compensation
SET_CUTTER_RADIUS_COMPENSATION (double radius)

Set to radius the radius to use when performing cutter radius compensation. The radius must be positive. The effective cutter radius changes if length units are changed.

4.3.11.2 Start_cutter_radius_compensation
START_CUTTER_RADIUS_COMPENSATION (CANON_COMP_SIDE side)

This starts cutter radius compensation. Acceptable values of side are CANON_COMP_LEFT and CANON_COMP_RIGHT, where left means the cutter stays to the left of the programmed path (when viewed from the positive end of the axis perpendicular to the currently selected plane) as the cutter moves forward and right means the cutter stays to the right of the programmed path.

4.3.11.3 Stop_cutter_radius_compensation
STOP_CUTTER_RADIUS_COMPENSATION ()

Do not apply cutter radius compensation when executing spindle translation function calls.


TOC PREV NEXT INDEX