Interpreters development
  • Interpreters development
v3.0.4
Search Results for

    Show / Hide Table of Contents

    Drilling cycle

    INCT_DrillingCycleFormer - a CAM system interface that simplifies forming the movements of drilling cycles. The object implementing this interface is returned by the function INCT_CLData.CreateDrillingCycleFormer, INCT_GeomCLData.CreateDrillingCycleFormer when it is called with any of the parameters dctSimple, dctWithShift, dctPeck.

    DrillingCycleFormer

    Purpose:

    The movements in the various drilling cycles generally follow the same tool path on different controllers (Fanuc: G74, G81, G82, G84, G85, G86, G88, G89; Sinumerik: CYCLE81, CYCLE82, CYCLE85, CYCLE87, CYCLE88, CYCLE89; Heidenhain: CYCL DEF 201, CYCL DEF 206, CYCL DEF 207, etc.):

    1. Positioning the tool above the center of the hole or of the next hole at rapid traverse.
    2. Moving the tool to the rapid level at rapid traverse.
    3. Moving the tool to the hole bottom level at working feed.
    4. Returning to the rapid level at rapid traverse.
    5. Returning to the retract level at rapid traverse.
    6. If the number of repetitions is not reached, returning to step 1.

    The generator forms the tool path from the specified parameters: initial position, rapid level, hole bottom level, number of repetitions, etc. It also allows adding to any section of the tool path the features required by a particular cycle (dwell, oriented spindle stop, tapping, etc.), changing the feed type or value, or skipping a tool movement prepared by the generator.

    Using the generator:

    We recommend creating a new drilling cycle generator for each new cycle in a block of the NC program, except when the cycle is repeated in a new block (like CYCL CALL for Heidenhain). Therefore, the interface of the old generator must be released when a new one is created or when the interpreter finishes its work.

    To form the tool movement commands along the cycle path, do the following:

    1. Get the generator interface (INCT_CLData.CreateDrillingCycleFormer, INCT_GeomCLData.CreateDrillingCycleFormer).
    2. Set the indexes of the X, Y, Z axes along which the movements are made (Set_AxisIndexes).
    3. Set the current plane (Set_Plane).
    4. Set the hole center point (Set_HoleCenter).
    5. Set the center point mode (Set_HoleCenterMode).
    6. Set the rapid level (Set_RapidLevel).
    7. Set the hole bottom level (Set_BottomLevel).
    8. Set the retract level (Set_TopLevel).
    9. Set the feed (Set_Feedrate) and the feed units (Set_MPM).
    10. Set the number of cycle repetitions (Set_Count).
    11. Assign a cycle event handler (Set_Events) if the cycle path needs to be changed.
    12. Form the tool movement commands along the cycle path (MakeWorkpath).

    Description of the interface methods:

    MethodMethod description
    Set_AxisIndexes

    The method sets the indexes of the X, Y, Z axes along which the movements are made when the cycle path is formed.

    Input parameters: Value (TNCDCAxisIndexes) - X (integer) - index of the X axis, Y (integer) - index of the Y axis, Z (integer) - index of the Z axis.

    No output parameters.

    Get_AxisIndexes

    The function returns the indexes of the X, Y, Z axes along which the movements are made when the cycle path is formed (TNCDCAxisIndexes).

    No input parameters.

    Set_HoleCenter

    The method sets the coordinates of the hole center point.

    Input parameters: Value (TNC3DPoint), X, Y, Z - coordinate values for the corresponding axes.

    No output parameters.

    Get_HoleCenter

    The function returns the coordinates of the hole center point (TNC3DPoint).

    No input parameters.

    Set_HoleCenterMode

    The method sets the center point mode.

    Input parameter: Value (boolean) - center point mode. True - the coordinates of the hole center point (Set_HoleCenter) are absolute. False - the coordinates of the hole center point are relative to the current tool position.

    No output parameters.

    Get_HoleCenterMode

    The function returns the center point mode (boolean).

    No input parameters.

    Set_Plane

    The method sets the current plane.

    Input parameter: Value (TNCPlaneType) - current plane.

    ptXY - XY plane, the hole is drilled along the Z axis.
    ptYZ - YZ plane, the hole is drilled along the X axis.
    ptZX - ZX plane, the hole is drilled along the Y axis.

    No output parameters.

    Get_Plane

    The function returns the current plane (TNCPlaneType).

    No input parameters.

    Set_RapidLevel

    The method sets the rapid level along the drilling axis.

    Input parameter: Value (real number) - rapid level.

    No output parameters.

    Get_RapidLevel

    The function returns the rapid level along the drilling axis (real number).

    No input parameters.

    Set_BottomLevel

    The method sets the hole bottom level along the drilling axis.

    Input parameter: Value (real number) - hole bottom level.

    No output parameters.

    Get_BottomLevel

    The function returns the hole bottom level along the drilling axis (real number).

    No input parameters.

    Set_TopLevel

    The method sets the retract level along the drilling axis.

    Input parameter: Value (real number) - retract level.

    No output parameters.

    Get_TopLevel

    The function returns the retract level along the drilling axis (real number).

    No input parameters.

    Set_Feedrate

    The method sets the working feed.

    Input parameter: Value (real number) - feed value.

    No output parameters.

    Get_Feedrate

    The function returns the working feed (real number).

    No input parameters.

    Set_MPM

    The method sets the feed units flag.

    Input parameter: Value (boolean) - feed units flag. True - mm/min. False - mm/rev.

    No output parameters.

    Get_MPM

    The function returns the feed units flag (boolean).

    No input parameters.

    Set_Count

    The method sets the number of cycle repetitions.

    Input parameter: Value (integer) - number of cycle repetitions.

    No output parameters.

    The cycle works differently depending on the hole center point mode (Set_HoleCenterMode):

    • if the number of repetitions = 0, only the tool positioning above the hole center is made;
    • if the number of repetitions = 1, one iteration of the cycle is made;
    • if the number of repetitions > 1, the cycle is repeated the specified number of times: at the same place if the coordinates of the hole center point are absolute; if they are relative, each iteration is shifted by the value set in Set_HoleCenter from the point where the previous iteration ended.
    Get_Count

    The function returns the number of cycle repetitions (integer).

    No input parameters.

    Set_Events

    The method assigns events that control the cycle behavior. Events allow adding to any section of the tool path the features required by a particular cycle (dwell, oriented spindle stop, tapping, etc.), changing the feed type or value, or skipping a tool movement prepared by the generator.

    Input parameter: Value (INCT_DrillingCycleEvents) - object implementing the events. See the detailed description below.

    No output parameters.

    Get_Events

    The function returns the object implementing the events that is linked to the cycle generator (INCT_DrillingCycleEvents).

    No input parameters.

    MakeWorkpathThe method forms the cycle path from the specified parameters.
    Get_NextHoleThe function returns the coordinates of the current hole point calculated for the current iteration (TNC3DPoint). The value can be used only inside the events (Set_Events).
    Get_RapidPointThe function returns the coordinates of the rapid level point calculated for the current iteration (TNC3DPoint). The value can be used only inside the events (Set_Events).
    Get_TopPointThe function returns the coordinates of the retract level point calculated for the current iteration (TNC3DPoint). The value can be used only inside the events (Set_Events).
    Get_BottomPointThe function returns the coordinates of the hole bottom point calculated for the current iteration (TNC3DPoint). The value can be used only inside the events (Set_Events).

    INCT_DrillingCycleEvents - an interface implemented in the interpreter that allows controlling the behavior of a drilling cycle. The interface is a set of event methods executed during the tool movements inside the cycle path generator. With these methods, the features required by a particular cycle (dwell, oriented spindle stop, tapping, etc.) can be added to any section of the tool path, the feed type or value can be changed, or a tool movement prepared by the generator can be skipped.

    If events are assigned to the cycle path generator, every tool movement inside the generator consists of 3 stages:

    1. The INCT_DrillingCycleEvents.BeforeMove method is executed. It receives the values set by the cycle: movement type, coordinates of the movement point, feed type.
    2. The INCT_DrillingCycleEvents.OnMove method is executed. It receives: movement type, coordinates of the movement point, feed type and the flag of whether the movement has been made. All parameters except the movement type can be changed in the method implementation. Depending on the flag set in OnMove, the tool moves to the specified point with the specified feed, or the movement is not made.
    3. The INCT_DrillingCycleEvents.AfterMove method is executed. It receives the values returned by OnMove: movement type, coordinates of the movement point, feed type.

    Description of the interface methods:

    Method Method description Description of use
    BeforeMove The method is executed before each tool movement when the cycle path is formed.
    Input parameters: MoveType (TNCDrillingCycleMoveType) - movement type, see the description below; Point (TNC3DPoint) - coordinates of the movement point; Feed (TNCFeedType) - feed type.
    mtMoveToNextHole - movement to the first or the next hole;
    mtMoveToRapidLevel - movement to the rapid level;
    mtMoveToBottomLevel - movement to the hole bottom;
    mtReturnToRapidLevel - return to the rapid level;
    mtReturnToTopLevel - return to the retract level;
    mtPeck* - used when a cycle with chip breaking is formed.
    No output parameters.
    If some commands must be added before a movement, add them to the method implementation.
    For example, to set clockwise spindle rotation before drilling the hole, call INCT_CLData.AddSpindleSpeedOnRPM with the appropriate parameters in the BeforeMove implementation under the condition MoveType = mtMoveToBottomLevel.
    OnMove The method is executed before each tool movement when the cycle path is formed.
    Input parameters: MoveType (TNCDrillingCycleMoveType) - movement type, see the description above;
    Input and output parameters: Point (TNC3DPoint) - coordinates of the movement point; Feed (TNCFeedType) - feed type; Handled (boolean) - flag of whether the movement has been made inside the implementation (True - the movement has been made, False - it has not).
    If Handled is True after the OnMove call, the movement has been made inside the OnMove implementation, and the cycle generator does not add a movement command to the tool path.
    If Handled is False after the OnMove call, the generator considers that the movement has not been made inside the OnMove implementation and adds to the tool path a command to move to the point Point with the feed type Feed.
    To override the movement point or the feed, or to skip the movement.
    For example, to change the feed type from rapid to working when returning after drilling, in the OnMove implementation set the returned Feed parameter to ffWorking under the condition MoveType = mtReturnToRapidLevel (for the feed type, see OutStandardFeed).
    To move the tool to a point other than the one calculated by the cycle, change the Point parameter returned by OnMove.
    If the movement to the point calculated by the cycle is not needed, set the Handled parameter to True inside the OnMove implementation.
    AfterMove The method is executed after each tool movement when the cycle path is formed, even if the movement has been canceled in OnMove.
    Input parameters: MoveType (TNCDrillingCycleMoveType) - movement type, see the description above; Point (TNC3DPoint) - coordinates of the movement point; Feed (TNCFeedType) - feed type.
    No output parameters.
    If some commands must be added after a movement, add them to the method implementation.
    For example, to add a dwell after drilling the hole, call INCT_CLData.AddDelay with the appropriate parameters in the AfterMove implementation under the condition MoveType = mtMoveToBottomLevel.
    In this article