Turning machining cycle

INCT_LatheStockRemovalCycleFormer - SprutCAM X interface that implements the functionality to simplify the formation of the movements of the turning cycle of turning along the given contour. The object that implements this interface is returned by the INCT_CLData.CreateLatheCycleFormer, INCT_GeomCLData.CreateLatheCycleFormer function when it is executed with the lctStockRemoval parameter.

The interface INCT_LatheStockRemovalCycleFormer2 extends the capabilities of the former for turning cycle movements along a given contour. The new properties and methods are described below. The CreateLatheCycleFormer function returns an object that implements this interface (similar to INCT_LatheStockRemovalCycleFormer).

images/download/attachments/113361113/LatheStockRemovalCycle_Bars.png

images/download/attachments/113361113/LatheStockRemovalCycle_CopyContour.png

images/download/attachments/113361113/LatheStockRemovalCycle_Finishing.png

images/download/attachments/113361113/LatheStockRemovalCycle_Params.png

Purpose:

The execution of movements in different types of turning cycles on a given contour, for different racks in general, repeat the same path:

  1. Tool approach to the starting point or the point of the next approach at the accelerated feed.

  2. Approaching the roughing cut level at rapid feed.

  3. Approach to the roughing cut point parallel to the longitudinal axis at the working feed (rough cut).

  4. Return parallel to the contour along the contour, taking into account the finishing stock to the last point of the roughing cut on the working feed (completion of the roughing cut).

  5. Return to the retraction plane in the flow with accelerated movement.

  6. Return to step 1 if the depth of processing is not reached.

  7. Finishing contour operation (approach to the starting point at an accelerated feed, finishing along the contour at a working feed, retraction at an accelerated feed).

Examples of such cycles, Sinumerik: CYCLE95.

Using a former allows you to set the path of the contour, the retraction plane, the machining step, the type and direction of machining, etc., according to the specified parameters, to form the tool path. And also add the features that are necessary for a particular cycle to the path on any formed section, change the type or value of feed, or skip the tool path prepared by the former.


Former use:

We recommend creating a new turning cycle generator for each new cycle in the NC-code frame, except when the cycle operation is repeated in a new frame. Thus, the interface of the old former must be freed when creating a new one or shutting down the interpreter.

To form commands for tool path along a cycle path, the following steps must be performed:

  1. Get the former interface ( INCT_CLData.CreateLatheCycleFormer, INCT_GeomCLData.CreateLatheCycleFormer ).

  2. Set the indexes of the longitudinal and transverse axes along which the movements will be made (Set_AxisIndexes).

  3. Set the cycle parameters (Set_NCProgram, Set_MachiningType, Set_MachiningDirection, Set_Overlap etc.. see the description below).

  4. If changes to the loop path are needed, set a loop event handler (Set_Events).

  5. Generate commands for the tool path along the cycle path (MakeWorkpath).


Description of interface methods:

Method

Method description

Set_AxisIndexes

The method establishes the indices of the longitudinal and transverse axes along which the movements will be made till the formation of the cycle path.

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 indices of the longitudinal and transverse axes in which the movements will be made till the formation of the cycle path (TNCLCAxisIndexes).

No input parameters

Set_Plane

The method sets the current plane for the text of the contour of the NC-code. If the plane is not set, then the current plane from INCT_CLData is used.

Input parameters: Value (TNCPlaneType) - current plane for the text of the contour of the NC-code .

No output parameters.

Get_Plane

The function returns current plane for the text of the contour of the NC-code .

No input parameters.

Set_NCProgram

The method sets the interface that implements the text of the contour of the NC-code in the former.

Input parameter: Value (INCT_Program) - an interface that implements the text of the contour of the NC-code.

The contour text can be obtained using the INCT_Kernel.GetProgramByLabels method.

No output parameters.

Get_NCProgram

The function returns an interface that implements the text of the contour of the NC-code (INCT_Program).

No input parameters.

Set_RecalcContourGeometry

The method sets a sign of the need to perform an interpretation of the contours NC program.

Input parameter: Value (logical) - False - do not interpret the NC program of ther contour if it has already been completed, True - to interpret the NC program of ther contour in any case.

No output parameters.

Get_RecalcContourGeometry

The function returns the sign of the need to perform the interpretation of the contours NC program.

No input parameters.

Set_MachiningProcessing

The method sets the machining processing.

Input parameter: Value (TNCMachiningProcessing) - machining processing.

mpRoughing - roughing (several passes performed taking predetermined parameters: stock, step, etc.).;
mpFinishing - Finishing (performed only one pass through the loop without stock).

No output parameters.

Get_MachiningProcessing

The function returns the machining processing.

No input parameters.

Set_MachiningType

The method sets the machining type.

Input parameter: Value ( TNCLatheMachinigType ) - machining type.

mtInside - inside;
mtOutside - outside.

No output parameters.

Get_MachiningType

The function returns the type of machining (TNCLatheMachinigType).

No input parameters.

Set_MachiningDirection

The method sets the value of the machining direction.

Input parameter: Value (TNCLatheMachiningDirection) - machining direction value.

mdLongitudinal - longitudinal;
mdTransverse - transverse.

No output parameters.

Get_MachiningDirection

The function returns the value of the machining direction (TNCLatheMachiningDirection).

No input parameters.

Set_MachiningStyle

The method sets the style of the contour when roughing.

Input parameters: Value (TNCLatheMachiningStyle) - the style of the contour when roughing. msBars - at each iteration processing paraxial (longitudinal or transverse depending on MachiingDirection); msCopyContour - at each iteration parallel processing contour (repeat countour).

No output parameters.

Get_MachiningStyle

The function returns the style of the contour when roughing.

No input parameters.

Set_Overlap

The method sets the overlap type.

Input parameter: Value (boolean) - overlap type value. True - with a return along the contour, False - with a direct return.

No output parameters.

Get_Overlap

The function returns an overlap type (number).

No input parameters.

Set_AxialStock

The method sets the value of the axial stock for the contour.

Input parameter: Value (number) - the value of the axial stock on the contour.

No output parameters.

Get_AxialStock

The function returns the value of the axial stock for the contour (number).

No input parameters.

Set_RadialStock

The method sets the value of the radial stock for the contour.

Input parameter: Value (number) - the radial stock value of the contour.

No output parameters.

Get_RadialStock

The function returns the value of the radial stock for the contour (number).

No input parameters.

Set_ProfileStock

The method sets the value of equidistant stock on the contour.

Input parameter: Value (number) - the value of equidistant stock on the contour.

No output parameters.

Get_ProfileStock

The function returns the value of equidistant stock for the contour (number).

No input parameters.

Set_StartPointMode

Method sets setting mode 'Starting point of the contour'.

Input parameters: Value (TNCLatheStartPointMode) - setting mode 'Starting point of the contour'. spmCalcPoint - cycle is calculated starting point; spmSetPoint - start point is set manually (см. StartPoint).

No output parameters.

Get_StartPointMode

The function returns the setting mode 'Starting point of the contour'.

No input parameters.

Set_StartPoint

The method sets a starting point of the cycle (for mode StartPointMode = spmSetPoint).

Input parameters: Value (TNC2DPoint) - starting point of the cycle.

No output parameters.

Get_StartPoint

The function returns the starting point of the cycle.

No input parameters.

Set_EachReliefcutSeparately

The method sets the value of feature relief cuts processing.

Input parameter: Value (logical) - True - each relief cut handled separately, False - all relief cuts are processed in a single pass.

No output parameters.

Get_EachReliefcutSeparately

The function returns the value of feature relief cuts processing.

No input parameters.

Set_DoReliefcutsInReverseOrder

This method sets a flag for the order in which reliefcuts are processed.

Input parameters: Value (boolean) - a flag for the order in which relief cuts are processed. True - process reliefcuts in the reverse order. False - process relief cuts in the direct order.

No output parameters.

Set_DoReliefcutsInReverseOrder

The function returns a flag for the order in which relief cuts are processed .

No input parameters.

Set_StepType

The method sets the type of calculation of the roughing machining .

Input parameter: Value (TNCLatheStepType) - type of calculation roughing machining.

stConst - with each pass, the depth of processing is the value of the machining step (Set_Step);
stCalcEvenly - at each stage (undercut) by the value of the machining step (Set_Step) the former calculates the number of steps, and performs machining in equal steps (depth of cut/number of steps).

No output parameters.

Get_StepType

The function returns the type of calculation of the roughing machining . (TNCLatheStepType).

No input parameters.

Set_Step

The method sets the value of the machining step.

Input parameter: Value (number) - machining step value.

No output parameters.

Get_Step

The function returns the value of the machining step (number).

No input parameters.

Set_SafeDist

The method sets the retraction value for the return (the value of the rebound to the side before outputting the tool).

Input parameter: Value (number) - the value of the outlet.

No output parameters.

Get_SafeDist

The function returns the value of the retract (number).

No input parameters.

Set_LengthChipBreaking

The method sets the stroke length for chip breaking.

Input parameter: Value (number) - the value of the stroke length for chip breaking.

No output parameters.

Get_LengthChipBreaking

The function returns the stroke length for chip breaking (number).

No input parameters.

Set_Feedrate

The method sets the value of the work feed.

Input parameter: Value (number) - value of the work feed.

No output parameters.

Get_Feedrate

The function returns the value of the work feed.

No input parameters.

Set_MPM

The method sets the type of working feed.

Input parameter: Value (logical) - type of working feed. True - mm/min, False - rev/min.

No output parameters.

Get_MPM

The function returns the type of working feed.

No input parameters.

Set_UseContourFeedrate

The method sets the flag 'Use feed specified in the NC-code of the contour'.

Input parameters: Value (boolean) - flag 'Use feed specified in the NC-code of the contour'. True - feed specified in the NC-code of the contour, used when processing the same sections of the contour. False - feed specified in the NC-code of the contour is ignored.

No output parameters.

Get_UseContourFeedrate

The function returns the flag 'Use feed specified in the NC-code of the contour' .

No input parameters.

Set_Events

The method assigns events to control the behavior of the loop. When using events, you can add features that are necessary for a particular cycle to the movement path on any formed section: stop, oriented stop, etc., change the type or value of feed, or skip the tool movement prepared by the former.

Input parameter: Value (interface) - an object that implements the INCT_LatheCycleEvents interfaces. Described in detail in the article Turning cycle threading. , INCT_LatheCycleArcEvents (described below)

No output parameters.

Get_Events

The function returns an object that implements the events associated with the loop generator (INCT_LatheCycleEvents, INCT_LatheCycleArcEvents ).

No input parameters.

Get_SignLongitudinal

The function returns the sign of the longitudinal processing (integer). 1 - direction coincides with longitudinal axis, 0 - direction undefined; -1 - direction opposite to longitudinal axis.

No input parameters.

Get_SignTransverse

The function returns the sign of the transversional processing (integer). 1 - direction coincides with transverse axis, 0 - direction undefined; -1 - direction opposite transverse axis.

No input parameters.

MakeWorkpath

The method forms a cycle path according to specified parameters. The process of forming the path of movement:

  1. Get the current interpreter state (Save method) if the interpreter supports the interface INCT_InterpreterState (described below).

  2. Create and initiate a new instance of the interpreter.

  3. Restore the current state for a new instance (INCT_InterpreterState.Load).

  4. Launch a new interpreter on the NC program of the cycle contour, to form the trajectory of the contour.

  5. After the completion of the new interpreter, the trajectory of the instrument is formed according to the specified parameters and the resulting trajectory of the contour.


INCT_LatheStockRemovalCycleFormer2 extends the capabilities of the former for the movement of the turning cycle along a given contour.

Method

Method description

Set_PassReturnMethod

This method sets the order of movement to the return point.

Input parameter: Value (TNCPassReturnMethod) - order of movement to the return point. prmStepwise - For each iteration of the cycle, the return is performed first along the normal to the feed axis, and then along the normal to the processing axis; prmDirect - For each iteration of the cycle, the return is performed directly to the return point.

No output parameters.

Get_PassReturnMethod

The function returns sets the order of movement to the return point. (TNCPassReturnMethod).

No input parameters.

Set_CutDepthCalcMethod

Method for determining the depth of cut.

Input parameter: Value (TNCCutDepthCalcMethod) - method for determining the depth of cut. cdcByStep - The depth of each cut is equal to or less (at the last iteration of the cycle) than the specified processing step; cdcByCount - The depth of each cut is calculated based on the specified number of repetitions of the cycle.

No output parameters.

Get_CutDepthCalcMethod

The function returns method for determining the depth of cut (TNCCutDepthCalcMethod).

No input parameters.

Set_Count

The method sets the number of repetitions of the cycle (for the method 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 repetitions of the cycle (for the method of determining the depth of cut - by the number of repetitions cdcByCount ).

No input parameters.

Set_Offset

This method sets the offset of the start point of contour processing on each pass.

Input parameter: Value (Number) - offset of the start point of contour.

No output parameters.

Get_Offset

The function returns the offset of the start point of contour processing on 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 former (TNC2DPoint)

No input parameters.

Get_ContourEndPoint

The function returns the coordinates of the end point of the contour, taking into account the allowance set in the former (TNC2DPoint)

No input parameters.


INCT_LatheCycleArcEvents - an interface implemented in the interpreter that allows you to control the behavior of the turning cycle while building arcs. The interface consists of a single-event method, which is performed by moving the instrument along the arc trajectory within cycle former. Using the methods of the interface, you can add to the path of the movement on any formed section the features necessary for a specific cycle: stop, oriented stop, etc., change the type of feed, or skip the tool movement prepared by the former.

Interface method description:

Method

Method description

Description of use

OnArc

The method will be executed before each tool movement in an arc during the formation of the cycle path.

Input parameters: MoveType (TNCLatheCycleMoveType) - move type, see the description Turning cycle grooving;

Input and output parameters: Center (TNC2DPoint) - the coordinates of the arc center ; Point (TNC2DPoint) - coordinate movement point; Radius (number) - arc radius; Feed (TNCFeedType) - feedrate type; Handled (boolean) - sign of moving inside the OnMove implementation (True - move completed, False - move not completed).

If, after calling OnArc, the Handled parameter takes the value True, this means that the movement was performed inside the implementation of the OnArc method and the loop former does not add a move command to the tool path.

If, after calling OnArc, the Handled parameter takes the value False, the former assumes that the movement was not performed within the implementation of the OnArc method and adds a command to the point of the tool movement path to the Point with feed Feed type.

If necessary, override the values of the point of movement in an arc or feed, or to refuse to move (skip).

For example, if you need to change the feed type to accelerated, when you return to the initial level, after turning the groove, then in the implementation of the OnArc method you need to change the value of the Feed parameter returned by the method to ffRapid on the condition MoveType = lmReturnToTopLevel (the feed type is described in the article OutStandardFeed ).

If you need to move the tool to a point other than the one calculated by the cycle, you need to change the value of the Center, Point, Radius parameter returned by the OnArc method.

If moving to a point calculated by the cycle is not necessary, then within the implementation of the OnArc method, you need to change the value of the Handled parameter to True.


INCT_LatheStockRemovalCycleEvents - an interface implemented in the interpreter that allows you to control the behavior of the turning cycle. The interface consists of a single-event method, which is performed after receiving the cycle geometry and trajectory calculation cycle before. Using the interface method and the INCT_InterpreterState interface, you can get contour parameters from the NC-program and pass them to the cycle former for correct formation (for example, the processing direction, if it is set by the command in the contour path of NC-program).

Interface method description :

Method

Method description

Description of use

OnCalcContourGeometry

The method will be executed after getting the contour geometry and before calculating the cycle path with the former.

No parameters.

Using the interface method and the INCT_InterpreterState interface, you can get contour parameters from the NC-program and pass them to the cycle former for correct formation (for example, the processing direction, if it is set by the command in the contour path of NC-program).


INCT_LatheStockRemovalCycleEvents2 - an interface implemented in the interpreter that allows you to control the behavior of the turning cycle. Extends the interface INCT_LatheStockRemovalCycleEvents.

Method

Method description

Description od use

OnCalcNextStep

The method is performed when calculating the tool path for each pass. It is used to change the step and offset used when calculating the next start point of the contour pass and the return point after the contour pass for the current iteration.

Input parameters: Iteration (Integer) - pass number, starting from 1; PointType (TNCLSRPointType) - the type of contour points: ptProfilePoint - the point where the path starts; ptReturnPoint - the point of return after passing through the circuit.

Input and output parameters: Step (Number) -step for calculating the current pass (Cutting axis); Offset (Number) - offset for calculating the current pass (Opposite axis).

Using the interface method, you can set your own algorithm for calculating the start points of the path and return points after the path for each pass, using the step and offset at the current iteration.

OnCalcNextPoint

The method is performed when calculating the tool path for each pass. It is used to change the coordinates of the points where the path starts and returns after the path is passed, calculated for the current iteration.

Input parameters: Iteration (Целое число) - pass number, starting from 1; PointType (TNCLSRPointType) - the type of contour points: ptProfilePoint - the point where the path starts; ptReturnPoint - the point of return after passing through the circuit.

Input and output parameters: Point (TNC2DPoint) - координаты точки.

Using the interface method, you can set your own algorithm for calculating the points of the beginning of a path along the contour and returning after passing along the contour for each pass, using the coordinates of the points at the current iteration.


INCT_InterpreterState
- interface implemented by the interpreter (the same object that implements the interface INCT_Interpreter), that allows you to save the current state of the interpreter and upload it to a newly created instance of the interpreter to correctly forming the trajectory of the contour.

For example, to form a contour trajectory, you need to know the current plane. To do this, the interpreter must create an object, save the current plane (Save method) to that object, and restore the current plane from the object transmitted to it (Load method) with a new instance of the interpreter.

Interface method description:

Method

Method description

Description of use

Save

The method should create an object that implements its own interface, store the current state data in the object, transfer the interface to the object at the output.

No input parameters.

Output parameter: State - interface IUnknown.

To form the trajectory of the contour, you need to know the current plane set in the main NC program. When implementing the Save method, you need to keep the current plane in the object that is created inside the method. The link to the object will be transferred by the SprutCAM X kernel to a new instance of the interpreter, by calling the Load method. When you realize, you need to get the value of the current plane from the transferred object.

Load

The method should get its own interface from the object transmitted in the input setting, get the current state of the interpreter, necessary to form the trajectory of the contour.

Input parameter: State - interface IUnknown .

No output parameters.