📄 canon.hh
字号:
In CANON_WORKPIECE mode, some motions cannot be carried out as fast asthe programmed feed rate would require because axis motions tend tocancel each other. For example, an arc in the YZ-plane can exactlycancel a rotation around the A-axis, so that the location of the tooltip with respect to the workpiece does not change at all during themotion; in this case, the motion should take no time, which isimpossible at any finite rate of axis motion. In such cases, the axesshould be moved as fast as possible consistent with accuratemachining.It would be possible to omit the SET_FEED_REFERENCE command from thecanonical commands and operate always in one mode or the other,letting the interpreter issue SET_FEED_RATE commands, if necessary tocompensate if the NC language being interpreted used the other mode.This would create two disadvantages when the feed_reference modeassumed by the canonical commands differed from that assumed by the NClanguage being interpreted:1. The output code could have a lot of SET_FEED_RATE commands notfound in the input code; this is a relatively minor consideration.2. If the interpreter reads a program in language which uses theCANON_XYZ mode and writes canonical commands in the CANON_WORKPIECEmode, both the interpreter and the executor of the output canonicalcommands would have to perform a lot of complex calculations. With theSET_FEED_REFERENCE command available, both do only simple calculationsfor the same motions.*/extern void SET_FEED_MODE(int mode);/* This sets the feed mode: 0 for feed in units per minute, and 1 for feed in * units per revolution. In units per revolution mode, the values are in * inches per revolution (G20 in effect) or mm per minute (G21 in effect) */extern void SET_MOTION_CONTROL_MODE(CANON_MOTION_MODE mode, double tolerance);/*This sets the motion control mode to one of: CANON_EXACT_STOP,CANON_EXACT_PATH, or CANON_CONTINUOUS.For CANON_CONTINUOUS another parameter defines the maximum path deviation. If tolerance=0 then any path deviation may occur, speed is maximized.*/extern void SET_CUTTER_RADIUS_COMPENSATION(double radius);/* Set the radius to use when performing cutter radius compensation. */extern void START_CUTTER_RADIUS_COMPENSATION(int direction);/* Conceptually, the direction must be left (meaning the cutterstays to the left of the programmed path) or right. */extern void STOP_CUTTER_RADIUS_COMPENSATION();/* Do not apply cutter radius compensation when executing spindletranslation commands. *//* used for threading */extern void START_SPEED_FEED_SYNCH(double feed_per_revolution, bool velocity_mode);extern void STOP_SPEED_FEED_SYNCH();/* Machining Functions */extern void 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, double u, double v, double w);/* Move in a helical arc from the current location at the existing feedrate. The axis of the helix is parallel to the x, y, or z axis,according to which one is perpendicular to the selected plane. Thehelical arc may degenerate to a circular arc if there is no motionparallel to the axis of the helix.1. If the selected plane is the xy-plane:A. first_end is the x-coordinate of the end of the arc.B. second_end is the y-coordinate of the end of the arc.C. first_axis is the x-coordinate of the axis (center) of the arc.D. second_axis is the y-coordinate of the axis.E. axis_end_point is the z-coordinate of the end of the arc.2. If the selected plane is the yz-plane:A. first_end is the y-coordinate of the end of the arc.B. second_end is the z-coordinate of the end of the arc.C. first_axis is the y-coordinate of the axis (center) of the arc.D. second_axis is the z-coordinate of the axis.E. axis_end_point is the x-coordinate of the end of the arc.3. If the selected plane is the zx-plane:A. first_end is the z-coordinate of the end of the arc.B. second_end is the x-coordinate of the end of the arc.C. first_axis is the z-coordinate of the axis (center) of the arc.D. second_axis is the x-coordinate of the axis.E. axis_end_point is the y-coordinate of the end of the arc.If rotation is positive, the arc is traversed counterclockwise asviewed from the positive end of the coordinate axis perpendicular tothe currently selected plane. If rotation is negative, the arc istraversed clockwise. If rotation is 0, first_end and second_end mustbe the same as the corresponding coordinates of the current point andno arc is made (but there may be translation parallel to the axisperpendicular to the selected plane and motion along the rotational axes).If rotation is 1, more than 0 but not more than 360 degrees of arcshould be made. In general, if rotation is n, the amount of rotationin the arc should be more than ([n-1] x 360) but not more than (n x360).The radius of the helix is determined by the distance from the currentlocation to the axis of helix or by the distance from the end locationto the axis of the helix. It is recommended that the executing systemverify that the two radii are the same (within some tolerance) at thebeginning of executing this function.While the XYZ motion is going on, move the rotational axes so thatthey have always covered the same proportion of their total motion asa point moving along the arc has of its total motion.*/extern void STRAIGHT_FEED(double x, double y, double z, double a, double b, double c, double u, double v, double w);/* Move at existing feed rate so that at any time during the move,all axes have covered the same proportion of their required motion.The meanings of the parameters is the same as for STRAIGHT_TRAVERSE.*/extern void RIGID_TAP(double x, double y, double z);/* Move linear and synced with the previously set pitch.Only linear moves are allowed, axes A,B,C are not allowed to move.*/extern void STRAIGHT_PROBE(double x, double y, double z, double a, double b, double c, double u, double v, double w);/* Perform a probing operation. This is a temporary addition to thecanonical machining functions and its semantics are not defined.When the operation is finished, all axes should be back where theystarted. */extern void STOP();/* stop motion after current feed */extern void DWELL(double seconds);/* freeze x,y,z for a time *//* Spindle Functions */extern void SET_SPINDLE_MODE(double);extern void SPINDLE_RETRACT_TRAVERSE();/* Retract the spindle at traverse rate to the fully retracted position. */extern void START_SPINDLE_CLOCKWISE();/* Turn the spindle clockwise at the currently set speed rate. If thespindle is already turning that way, this command has no effect. */extern void START_SPINDLE_COUNTERCLOCKWISE();/* Turn the spindle counterclockwise at the currently set speed rate. Ifthe spindle is already turning that way, this command has no effect. */extern void SET_SPINDLE_SPEED(double r);/* Set the spindle speed that will be used when the spindle is turning.This is usually given in rpm and refers to the rate of spindlerotation. If the spindle is already turning and is at a differentspeed, change to the speed given with this command. */extern void STOP_SPINDLE_TURNING();/* Stop the spindle from turning. If the spindle is already stopped, thiscommand may be given, but it will have no effect. */extern void SPINDLE_RETRACT();extern void ORIENT_SPINDLE(double orientation, CANON_DIRECTION direction);extern void LOCK_SPINDLE_Z();extern void USE_SPINDLE_FORCE();extern void USE_NO_SPINDLE_FORCE();/* Tool Functions */extern void USE_TOOL_LENGTH_OFFSET(double xoffset, double zoffset);extern void CHANGE_TOOL(int slot); /* slot is slot number *//* It is assumed that each cutting tool in the machine is assigned to aslot (intended to correspond to a slot number in a tool carousel).This command results in the tool currently in the spindle (if any)being returned to its slot, and the tool from the slot designated byslot_number (if any) being inserted in the spindle.If there is no tool in the slot designated by the slot argument, therewill be no tool in the spindle after this command is executed and noerror condition will result in the controller. Similarly, if there isno tool in the spindle when this command is given, no tool will bereturned to the carousel and no error condition will result in thecontroller, whether or not a tool was previously selected in theprogram.It is expected that when the machine tool controller is initialized,the designated slot for a tool already in the spindle will beestablished. This may be done in any manner deemed fit, including(for, example) recording that information in a persistent, crash-prooflocation so it is always available from the last time the machine wasrun, or having the operator enter it. It is expected that the machinetool controller will remember that information as long as it isnot re-initialized; in particular, it will be remembered betweenprograms.For the purposes of this command, the tool includes the tool holder.For machines which can carry out a select_tool command separately froma change_tool command, the select_tool command must have been givenbefore the change_tool command, and the value of slot must be the slotnumber of the selected tool. */extern void SELECT_TOOL(int i); /* i is slot number *//* Miscellaneous Functions */extern void CLAMP_AXIS(CANON_AXIS axis);/* Clamp the given axis. If the machining center does not have a clampfor that axis, this command should result in an error condition in thecontroller.An attempt to move an axis while it is clamped should result in anerror condition in the controller. */extern void COMMENT(char *s);/* This function has no physical effect. If commands are being printed orlogged, the comment command is printed or logged, including the stringwhich is the value of comment_text. This serves to allow formalcomments at specific locations in programs or command files. *//* used for EDM adaptive moves with motion internal feed override (0..1) */extern void DISABLE_ADAPTIVE_FEED();extern void ENABLE_ADAPTIVE_FEED();/* used to deactivate user control of feed override */extern void DISABLE_FEED_OVERRIDE();extern void ENABLE_FEED_OVERRIDE();/* used to deactivate user control of spindle speed override */extern void DISABLE_SPEED_OVERRIDE();extern void ENABLE_SPEED_OVERRIDE();/* used to deactivate user control of feed hold */extern void DISABLE_FEED_HOLD();extern void ENABLE_FEED_HOLD();extern void FLOOD_OFF();/* Turn flood coolant off. */extern void FLOOD_ON();/* Turn flood coolant on. */extern void MESSAGE(char *s);extern void MIST_OFF();/* Turn mist coolant off. */extern void MIST_ON();/* Turn mist coolant on. */extern void PALLET_SHUTTLE();/* If the machining center has a pallet shuttle mechanism (a mechanismwhich switches the position of two pallets), this command should causethat switch to be made. If either or both of the pallets are missing,this will not result in an error condition in the controller.If the machining center does not have a pallet shuttle, this command
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -