Circular movements
INCT_CircularMotionFormer - a CAM system interface that simplifies forming movements along an arc. The interface is returned by the functions INCT_CLData.CreateCircularMotionFormer, INCT_GeomCLData.CreateCircularMotionFormer.
Purpose:
Arc movements are formed from a block of the NC program as follows. The NC program text is translated, that is, split into registers with values. The registers with values are added to the list of objects for interpretation. The objects of the list are interpreted. When the objects are interpreted, an arc movement command (INCT_CLData.AddCircle/INCT_GeomCLData.ArcTo2d) is added to the tool path (INCT_CLData/INCT_GeomCLData) according to the changed values of the registers linked to the machine axes of the kinematic scheme.
In more detail, the process consists of the following actions.
Before a block is interpreted:
- Get the indexes of the X, Y, Z axes for the current tool or working object.
- Store the axis indexes.
- Get the current tool position coordinates for the stored axes, separately for the arc center point.
When registers are interpreted:
- Get the new values of the block registers linked to the arc center point, end point, radius or angle, and direction.
- Set the new values for all changed arc parameters.
After the block is interpreted, or during the interpretation but after all registers are interpreted:
- Calculate the missing parameters for INCT_CLData.AddCircle/INCT_GeomCLData.ArcTo2d.
- Call INCT_CLData.AddCircle/INCT_GeomCLData.ArcTo2d.
The actions from the list above that are in italics are implemented in the arc movement generator (INCT_CircularMotionFormer). Using the generator makes writing an interpreter easier.
We recommend creating one arc movement generator for the whole cycle of interpreting the NC program. Create it when the interpreter is initialized (INCT_Interpreter.Initialize).
Description of the interface methods:
| Method | Method description | Description of use |
|---|---|---|
| InitBlock | The method stores in the internal list the axis indexes and the current X, Y, Z coordinates of the current tool or working object. No input or output parameters. | Must be used before interpreting the objects linked to registers. It is recommended to use it in the implementation of the INCT_Interpreter.BeforeInterprete method. |
| InitCenterPoint | The method stores the current X, Y, Z coordinates of the current tool or working object as the center point. No input or output parameters. | Must be used before interpreting the objects linked to registers. It is recommended to use it in the implementation of the INCT_Interpreter.BeforeInterprete or INCT_Interpreter.Interprete method (if the circle center point is not set in the current block). |
| SetConstructMode | The method sets the arc construction mode. Input parameter: Mode (TNCConstructArcMode) - arc construction mode: caByCircleCenter - by the direction, end point and center of the arc; No output parameters. | Must be used when interpreting registers in the implementation of the INCT_Interpreter.Interprete method. |
| SetMode | The method sets the arc direction. Input parameter: Mode (TNCCircularMode) - arc direction: cmCW - clockwise; No output parameters. | |
| SetEndPoint | The method sets the coordinate of one axis of the end point. Input parameters: Abs (boolean) - type of the end point value, True - absolute value, False - relative value (relative to the current coordinate, see InitBlock); AxisType (TNCAxisType) - axis: axX - X axis, axY - Y axis, axZ - Z axis; Value (real number) - coordinate value. No output parameters. | |
| SetEndPointByAngle | The method sets the arc end point by the specified angle relative to the current point. Input parameters: Plane (TNCPlaneType) - current plane: ptXY - XY plane, ptYZ - YZ plane, ptZX - ZX plane; Angle (real number) - arc angle. No output parameters. Important! When a full circle is constructed (the arc angle is 360 degrees), the end point of the path must be forced to equal the start (current) point. Otherwise, because of a calculation error of hundredths or thousandths in the end point coordinates, the next movement command may become incorrect. This is especially important for commands in which the start point is used to calculate auxiliary parameters of the path (for example, when the tool moves along a circular arc set by the coordinates of its center, the end point and the movement direction). | |
| SetCenterPoint | The method sets the coordinate of one axis of the arc center point. Input parameters: Abs (boolean) - type of the center point value, True - absolute value, False - relative value (relative to the current coordinate, see InitCenterPoint); AxisType (TNCAxisType) - axis: axX - X axis, axY - Y axis, axZ - Z axis; Value (real number) - coordinate value. No output parameters. | |
| SetRadius | The method sets the arc radius. Input parameter: Value (real number) - radius value. No output parameters. | |
| MakeWorkpath | The method calculates the arc end point if an angle has been set (SetEndPointByAngle). Depending on the arc construction mode (SetConstructMode), it calculates the missing parameters for AddCircle. It adds to the tool path an arc movement command (INCT_CLData.AddCircle/INCT_GeomCLData.ArcTo2d) with the calculated parameters. Input parameter: LastPlane (TNCPlaneType) - arc plane. No output parameters. | To form an arc movement command. Used when interpreting in INCT_Interpreter.Interprete after all registers are interpreted (add it to the end of the list of objects for interpretation), or in INCT_Interpreter.AfterInterprete. |