Turning stock removal cycle
INCT_LatheStockRemovalCycleFormer - a CAM system interface that simplifies forming the movements of a turning cycle along a specified contour. The object implementing this interface is returned by the function INCT_CLData.CreateLatheCycleFormer, INCT_GeomCLData.CreateLatheCycleFormer when it is called with the lctStockRemoval parameter.
The INCT_LatheStockRemovalCycleFormer2 interface extends the capabilities of the turning cycle generator along a specified contour. Its new properties and methods are described below. The object implementing this interface is returned by the function CreateLatheCycleFormer (as for INCT_LatheStockRemovalCycleFormer).
Purpose:
The movements in the various types of turning cycles along a specified contour generally follow the same tool path on different controllers:
- Approach of the tool to the start point or to the point of the next pass at rapid traverse.
- Approach to the level of the roughing pass at rapid traverse.
- Movement to the point of the roughing pass parallel to the longitudinal axis at working feed (roughing pass).
- Return parallel to the contour, along the contour with the finishing allowance, to the last point of the roughing pass at working feed (end of the roughing pass).
- Return to the retraction plane at rapid traverse.
- Returning to step 1 if the machining depth is not reached.
- Finishing of the contour (approach to the start point at rapid traverse, finishing along the contour at working feed, retraction at rapid traverse).
Example of such a cycle: Sinumerik: CYCLE95.
The generator forms the tool path from the specified parameters: contour path, retraction plane, machining step, machining type and direction, etc. It also allows adding to any section of the tool path the features required by a particular cycle, changing the feed type or value, or skipping a tool movement prepared by the generator.
Using the generator:
We recommend creating a new turning cycle generator for each new cycle in a block of the NC program, except when the cycle is repeated in a new block. 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:
- Get the generator interface (INCT_CLData.CreateLatheCycleFormer, INCT_GeomCLData.CreateLatheCycleFormer).
- Set the indexes of the longitudinal and transverse axes along which the movements are made (Set_AxisIndexes).
- Set the cycle parameters (Set_NCProgram, Set_MachiningType, Set_MachiningDirection, Set_Overlap, etc., see the description below).
- Assign a cycle event handler (Set_Events) if the cycle path needs to be changed.
- Form the tool movement commands along the cycle path (MakeWorkpath).
Description of the interface methods:
| Method | Method description |
|---|---|
| Set_AxisIndexes | The method sets the indexes of the longitudinal and transverse axes along which the movements are made when the cycle path is formed. Input parameters: Value (TNCLCAxisIndexes) - Transverse (integer) - index of the transverse axis, Longitudinal (integer) - index of the longitudinal axis. No output parameters. |
| Get_AxisIndexes | The function returns the indexes of the longitudinal and transverse axes along which the movements are made when the cycle path is formed (TNCLCAxisIndexes). No input parameters. |
| Set_Plane | The method sets the current plane for the NC program of the contour. If the plane is not set, the current plane at the moment of getting the contour geometry is used. Input parameters: Value (TNCPlaneType) - current plane for the NC program of the contour. No output parameters. |
| Get_Plane | The function returns the current plane for the NC program of the contour. No input parameters. |
| Set_NCProgram | The method passes to the generator the interface implementing the text of the contour NC program. Input parameter: Value (INCT_Program) - interface implementing the text of the contour NC program. The contour text can be obtained using the INCT_ProgramManager.GetPartByIndex, INCT_ProgramManager.GetPartByLabels methods. No output parameters. |
| Get_NCProgram | The function returns the interface implementing the text of the contour NC program (INCT_Program). No input parameters. |
| Set_RecalcContourGeometry | The method sets the flag of whether the contour NC program must be interpreted. Input parameter: Value (boolean) - False - do not interpret the contour NC program if it has already been interpreted, True - interpret the contour NC program in any case. |
| Get_RecalcContourGeometry | The function returns the flag of whether the contour NC program must be interpreted. No input parameters. |
| Set_MachiningProcessing | The method sets the machining kind. Input parameter: Value (TNCMachiningProcessing) - machining kind. mpRoughing - roughing (several passes are made taking into account the specified allowance, step, etc.); No output parameters. |
| Get_MachiningProcessing | The function returns the machining kind. No input parameters. |
| Set_MachiningType | The method sets the machining type. Input parameter: Value (TNCLatheMachiningType) - machining type. mtInside - inside; No output parameters. |
| Get_MachiningType | The function returns the machining type (TNCLatheMachiningType). No input parameters. |
| Set_MachiningDirection | The method sets the machining direction. Input parameter: Value (TNCLatheMachiningDirection) - machining direction. mdLongitudinal - longitudinal; No output parameters. |
| Get_MachiningDirection | The function returns the machining direction (TNCLatheMachiningDirection). No input parameters. |
| Set_MachiningStyle | The method sets the contour machining style for roughing. Input parameters: Value (TNCLatheMachiningStyle) - machining style. msBars - at each iteration the machining is parallel to the axis (longitudinal or transverse depending on MachiningDirection); msCopyContour - at each iteration the machining is parallel to the contour (contour copy). No output parameters. |
| Get_MachiningStyle | The function returns the contour machining style for roughing. No input parameters. |
| Set_Overlap | The method sets the overtravel type. Input parameter: Value (boolean) - overtravel type. True - with return along the contour, False - with direct return. No output parameters. |
| Get_Overlap | The function returns the overtravel type (boolean). No input parameters. |
| Set_AxialStock | The method sets the axial allowance on the contour. Input parameter: Value (real number) - axial allowance on the contour. No output parameters. |
| Get_AxialStock | The function returns the axial allowance on the contour (real number). No input parameters. |
| Set_RadialStock | The method sets the radial allowance on the contour. Input parameter: Value (real number) - radial allowance on the contour. No output parameters. |
| Get_RadialStock | The function returns the radial allowance on the contour (real number). No input parameters. |
| Set_ProfileStock | The method sets the equidistant allowance on the contour. Input parameter: Value (real number) - equidistant allowance on the contour. No output parameters. |
| Get_ProfileStock | The function returns the equidistant allowance on the contour (real number). No input parameters. |
| Set_StartPointMode | The method sets the mode of setting the contour start point. Input parameters: Value (TNCLatheStartPointMode) - mode of setting the contour start point. spmCalcPoint - the start point is calculated by the cycle; spmSetPoint - the start point is set (see StartPoint). No output parameters. |
| Get_StartPointMode | The function returns the mode of setting the contour start point. No input parameters. |
| Set_StartPoint | The method sets the cycle start point (for the mode StartPointMode = spmSetPoint). Input parameters: Value (TNC2DPoint) - cycle start point. No output parameters. |
| Get_StartPoint | The function returns the cycle start point. No input parameters. |
| Set_EachReliefcutSeparately | The method sets the flag of machining the relief cuts. Input parameter: Value (boolean) - True - each relief cut is machined separately, False - all relief cuts are machined in one pass. No output parameters. |
| Get_EachReliefcutSeparately | The function returns the flag of machining the relief cuts. No input parameters. |
| Set_DoReliefcutsInReverseOrder | The method sets the flag of the order of machining the relief cuts. Input parameters: Value (boolean) - flag of the order of machining the relief cuts. True - machine the relief cuts in reverse order. False - machine the relief cuts in direct order. No output parameters. |
| Get_DoReliefcutsInReverseOrder | The function returns the flag of the order of machining the relief cuts. No input parameters. |
| Set_StepType | The method sets the type of calculating the roughing step. Input parameter: Value (TNCLatheStepType) - type of calculating the roughing step. stConst - at each pass the machining depth equals the machining step (Set_Step); No output parameters. |
| Get_StepType | The function returns the type of the roughing step (TNCLatheStepType). No input parameters. |
| Set_Step | The method sets the machining step. Input parameter: Value (real number) - machining step. No output parameters. |
| Get_Step | The function returns the machining step (real number). No input parameters. |
| Set_SafeDist | The method sets the retraction for the return (the side retraction before the tool exits). Input parameter: Value (real number) - retraction value. No output parameters. |
| Get_SafeDist | The function returns the retraction for the return (real number). No input parameters. |
| Set_LengthChipBreaking | The method sets the travel length for chip breaking. Input parameter: Value (real number) - travel length for chip breaking. No output parameters. |
| Get_LengthChipBreaking | The function returns the travel length for chip breaking (real number). No input parameters. |
| Set_Feedrate | The method sets the working feed. Input parameter: Value (real number) - working feed. No output parameters. |
| Get_Feedrate | The function returns the working feed. No input parameters. |
| Set_MPM | The method sets the working feed units. Input parameter: Value (boolean) - working feed units. True - mm/min, False - mm/rev. No output parameters. |
| Get_MPM | The function returns the working feed units. No input parameters. |
| Set_UseContourFeedrate | The method sets the flag of using the feed set in the NC program of the contour. Input parameters: Value (boolean) - flag of using the feed. True - the feed set in the contour NC program is used when machining the same contour sections. False - the feed set in the contour is ignored. No output parameters. |
| Get_UseContourFeedrate | The function returns the flag of using the feed set in the NC program of the contour. 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, etc.), changing the feed type or value, or skipping a tool movement prepared by the generator. Input parameter: Value (interface) - object implementing the interfaces INCT_LatheCycleEvents (described in detail in the article Turning grooving cycle) and INCT_LatheCycleArcEvents (described below), as well as INCT_LatheStockRemovalCycleEvents, INCT_LatheStockRemovalCycleEvents2, INCT_LatheStockRemovalCycleEvents3 (described below). The generator requests all these interfaces from the passed object; the object may implement only the ones it needs. No output parameters. |
| Get_Events | The function returns the object implementing the events that is linked to the cycle generator (INCT_LatheCycleEvents, INCT_LatheCycleArcEvents). No input parameters. |
| Get_SignLongitudinal | The function returns the sign of the longitudinal machining (integer). 1 - the direction coincides with the longitudinal axis, 0 - the direction is not defined, -1 - the direction is opposite to the longitudinal axis. No input parameters. |
| Get_SignTransverse | The function returns the sign of the transverse machining (integer). 1 - the direction coincides with the transverse axis, 0 - the direction is not defined, -1 - the direction is opposite to the transverse axis. No input parameters. |
| MakeWorkpath | The method forms the cycle path from the specified parameters. The tool path is formed as follows:
|
INCT_LatheStockRemovalCycleFormer2 extends the capabilities of the turning cycle generator along a specified contour.
| Method | Method description |
|---|---|
| Set_PassReturnMethod | The method sets the order of the return to the pass entry point. Input parameter: Value (TNCPassReturnMethod) - order of the return to the pass entry point. prmStepwise - at each cycle iteration the return is made first normal to the feed axis and then normal to the machining axis; prmDirect - at each cycle iteration the return is made directly to the entry point of the next pass. No output parameters. |
| Get_PassReturnMethod | The function returns the order of the return to the pass entry point (TNCPassReturnMethod). No input parameters. |
| Set_CutDepthCalcMethod | The method sets the way the depth of cut is determined. Input parameter: Value (TNCCutDepthCalcMethod) - way of determining the depth of cut. cdcByStep - the depth of each cut is equal to or (at the last cycle iteration) less than the specified machining step; cdcByCount - the depth of each cut is calculated from the specified number of cycle repetitions. No output parameters. |
| Get_CutDepthCalcMethod | The function returns the way the depth of cut is determined (TNCCutDepthCalcMethod). No input parameters. |
| Set_Count | The method sets the number of cycle repetitions (for the way of determining the depth of cut by the number of repetitions, cdcByCount). Input parameter: Value (integer) - number of repetitions. No output parameters. |
| Get_Count | The function returns the number of cycle repetitions (for the way of determining the depth of cut by the number of repetitions, cdcByCount). No input parameters. |
| Set_Offset | The method sets the offset of the contour machining start point at each pass. Input parameter: Value (real number) - offset of the contour start point. No output parameters. |
| Get_Offset | The function returns the offset of the contour machining start point at each pass. No input parameters. |
| Get_ContourStartPoint | The function returns the coordinates of the contour start point taking into account the allowance set in the generator (TNC2DPoint). |
| Get_ContourEndPoint | The function returns the coordinates of the contour end point taking into account the allowance set in the generator (TNC2DPoint). |
| Set_AxialStockDependsOnContour | The method sets how the axial and radial allowances (Set_AxialStock, Set_RadialStock) are taken into account. Input parameter: Value (boolean). True (default) - the allowances are taken as absolute values, and the shift direction is determined by the contour and the machining direction; False - the allowances are treated as shifts along the axes with the specified sign. No output parameters. |
| Get_AxialStockDependsOnContour | The function returns how the axial and radial allowances are taken into account (boolean). No input parameters. |
| Set_StartPointContainsSafeDist | The method sets whether the retraction value (Set_SafeDist) is taken into account when the cycle start point is calculated (for the mode StartPointMode = spmCalcPoint). Input parameter: Value (boolean). True (default) - the start point is moved away from the contour by the allowance and the retraction value; False - by the allowance only. No output parameters. |
| Get_StartPointContainsSafeDist | The function returns whether the retraction value is taken into account when the cycle start point is calculated (boolean). No input parameters. |
INCT_LatheCycleArcEvents - an interface implemented in the interpreter that allows controlling the behavior of a turning cycle when arcs are formed. The interface consists of one event method executed when the tool moves along an arc inside the cycle path generator. With this method, the features required by a particular cycle (dwell, oriented spindle stop, etc.) can be added to any section of the tool path, the feed type can be changed, or a tool movement prepared by the generator can be skipped.
Description of the interface method:
| Method | Method description | Description of use |
|---|---|---|
| OnArc | The method is executed before each tool movement along an arc when the cycle path is formed. Input parameters: MoveType (TNCLatheCycleMoveType) - movement type, see Turning grooving cycle; Input and output parameters: Center (TNC2DPoint) - coordinates of the arc center; Point (TNC2DPoint) - coordinates of the arc end point; Radius (real number) - arc radius; 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 OnArc call, the movement has been made inside the OnArc implementation, and the cycle generator does not add an arc movement command to the tool path. If Handled is False after the OnArc call, the generator considers that the arc movement has not been made inside the OnArc implementation and adds to the tool path a command to move along an arc to the point Point with the feed type Feed. |
To override the arc movement or the feed, or to skip the movement. For example, to change the feed type for the pass along the contour, in the OnArc implementation change the returned Feed parameter under the condition MoveType = lmOverlapContour (for the feed type, see OutStandardFeed). To move the tool to a point other than the one calculated by the cycle, change the Center, Point, Radius parameters returned by OnArc. If the movement to the point calculated by the cycle is not needed, set the Handled parameter to True inside the OnArc implementation. |
INCT_LatheStockRemovalCycleEvents - an interface implemented in the interpreter that allows controlling the behavior of the turning stock removal cycle. The interface consists of one event method executed after the contour geometry is obtained and before the cycle path is calculated. With this method and the INCT_InterpreterState interface, the contour parameters can be obtained from the NC program text and passed to the cycle path generator for correct forming (for example, the machining direction if it is set by a command in the contour path).
Description of the interface methods:
| Method | Method description | Description of use |
|---|---|---|
| OnCalcContourGeometry | The method is executed after the contour geometry is obtained and before the generator calculates the cycle path. No parameters. |
With this method and the INCT_InterpreterState interface, the contour parameters can be obtained from the NC program text and passed to the cycle path generator for correct forming (for example, the machining direction if it is set by a command in the contour path). |
INCT_LatheStockRemovalCycleEvents2 - an interface implemented in the interpreter that allows controlling the behavior of the turning stock removal cycle. It extends the INCT_LatheStockRemovalCycleEvents interface.
Description of the interface methods:
| Method | Method description | Description of use |
|---|---|---|
| OnCalcNextStep | The method is executed when the tool path is calculated for each pass. It is intended for changing the step and the offset used to calculate the next start point of the pass along the contour and the return point after the pass along the contour for the current iteration. Input parameters: Iteration (integer) - pass number starting from 1; PointType (TNCLSRPointType) - type of the contour point: ptProfilePoint - start point of the pass along the contour; ptReturnPoint - return point after the pass along the contour. Input and output parameters: Step (real number) - step for calculating the current pass (infeed axis); Offset (real number) - offset for calculating the current pass (the other axis, perpendicular to the infeed axis). |
With this method, your own algorithm of calculating the start points of the passes along the contour and the return points after them can be set for each pass by operating the step and the offset at the current iteration. |
| OnCalcNextPoint | The method is executed when the tool path is calculated for each pass. It is intended for changing the coordinates of the start point of the pass along the contour and of the return point after the pass, calculated for the current iteration. Input parameters: Iteration (integer) - pass number starting from 1; PointType (TNCLSRPointType) - type of the contour point: ptProfilePoint - start point of the pass along the contour; ptReturnPoint - return point after the pass along the contour. Input and output parameters: Point (TNC2DPoint) - point coordinates. |
With this method, your own algorithm of calculating the start points of the passes along the contour and the return points after them can be set for each pass by operating the point coordinates at the current iteration. |
INCT_LatheStockRemovalCycleEvents3 - an interface implemented in the interpreter that allows controlling the behavior of the turning cycle. It extends the INCT_LatheStockRemovalCycleEvents2 interface.
Description of the interface methods:
| Method | Method description | Description of use |
|---|---|---|
| OnCalcSafeCut | The method is executed when the tool path is calculated. It is intended for changing the retraction values for the return calculated inside the cycle (the side retraction before the tool exits). Input and output parameters: Point (TNC2DPoint) - point coordinates (relative). |
Before the method is called, the cycle calculates the retraction from Set_SafeDist along both axes away from the contour. With this method, your own retraction value can be set, for example, retraction along one axis only. The new value is used for the approach to the machining start, for the return to the safe distance after a pass and for calculating the levels of the passes. |
INCT_InterpreterState - an interface implemented by the interpreter (by the same object that implements the INCT_Interpreter interface) that allows saving the current state of the interpreter and loading it into a newly created interpreter instance for correct forming of the contour path.
For example, the current plane must be known to form the contour path. For this, the interpreter must create an object, save the current plane in it (method Save), and, when a new interpreter instance is created, restore the current plane from the object passed to it (method Load).
Description of the interface methods:
| Method | Method description | Description of use |
|---|---|---|
| Save | The method must create an object implementing its own interface, save the data of the current state in the object and pass the interface of the object in the output parameter. No input parameters. Output parameter: State - IUnknown interface. | To form the contour path, the current plane set in the NC program text must be known. In the implementation of the Save method, save the current plane in the object created inside the method. The CAM system kernel passes the reference to the object to the new interpreter instance by calling the Load method. In its implementation, get the current plane from the passed object. |
| Load | The method must get its own interface from the object passed in the input parameter and get the current state of the interpreter required to form the contour path. Input parameter: State - IUnknown interface. No output parameters. |