TG Motion  version 421 - 4033/904 cnc 121
Real-time system for controlling servo drives and I/O modules
GCODE_PARAMETERS Struct Reference

Structure for setting G-code properties. More...

#include <TGM_CNC.h>

Public Attributes

int32_t absMode
 
int32_t swapG2G3
 
int32_t correctionStrategy
 
int32_t forceMode
 
GCODE_FEED motion [8]
 
GCODE_CORRECTION correction [8]
 
double maxConnectionDistance
 
double startAngle
 
double endAngle
 
double minAngleFeed
 
int32_t disableG0FeedOverride
 
int32_t interpolatorConfig0
 
double overrideInc
 
ARC_FEED_TABLE arcFeedTable [5]
 
double centripetalAcc
 Maximum allowed centripetal acceleration for arcs (not yet implemented)
 
INTERNAL_MFUNC_INSERT_TABLE mFuncInsertTable [3]
 
int32_t mFuncInsertType
 
int32_t callbackWarningsInvokeMode
 
double reserved
 reserved
 
int32_t M02_programEnd1
 
int32_t M30_programEnd2
 
int32_t M03_startSpindleCW
 
int32_t M04_startSpindleCCW
 
int32_t M05_stopSpindle
 
int32_t M06_changeTool
 
int32_t M07_coolOn
 
int32_t M08_oilOn
 
int32_t M09_coolOilOff
 
int32_t M17_return
 
int32_t M29_print
 
int32_t M80_mirrorOff
 
int32_t M81_mirrorX
 
int32_t M82_mirrorY
 
int32_t M83_mirrorZ
 
int32_t M84_mirrorXY
 
int32_t M85_mirrorXZ
 
int32_t M86_mirrorYZ
 
int32_t M87_mirrorXYZ
 
int32_t M99_defFeed
 
int32_t insertArcMode
 
int32_t disableAdditionalProgramFlowInfo
 
double insertArcToleranceRMax
 
double insertArcToleranceRMin
 
double insertArcMaxAngle
 
double insertArcMinAngle
 
int32_t insertArcPlane
 
int32_t reserved1
 reserved
 
int32_t calcTime
 
int32_t reserved2
 reserved
 
double dynamicG41Correction_mm
 
double dynamicG42Correction_mm
 
AXIS_LIMITS axisLimits [ACTUAL_N_AXES]
 
double dynamicG42Correction_percent
 
double tolerance [10]
 

Detailed Description

Structure for setting G-code properties.

Definition at line 1259 of file TGM_CNC.h.

Member Data Documentation

◆ absMode

int32_t GCODE_PARAMETERS::absMode

Meaning of G-code coordinates:

Value Description
0 relative
1 absolute

Definition at line 1261 of file TGM_CNC.h.

◆ swapG2G3

int32_t GCODE_PARAMETERS::swapG2G3

If non-zero: swap G2/G3. Used for non-standard (not right-handed) G-code coordinate systems.

Definition at line 1268 of file TGM_CNC.h.

◆ correctionStrategy

int32_t GCODE_PARAMETERS::correctionStrategy

bit coded value for strategy of correction calculations:

Definition at line 1345 of file TGM_CNC.h.

◆ forceMode

int32_t GCODE_PARAMETERS::forceMode

Meaning of address F in G-code

  • F_BY_GCODE (0):
    F, FF, FP speeds are consistent with G-code
  • F_BY_PARAMETERS (1):
    F, FF, FP is ignored, all speeds meet the parameters in motion
  • F_BY_PARAMETERS_FP_BY_GCODE (2):
    F, FF feeds are used from motion array, FP generates a relative speed according to the parameters in motion
    Note
    G-code function
    G9 Q0
    function switches to mode 0, i.e. speed consistent with G-code.
    G9 // (without any address)
    switches to the previous mode

Definition at line 1406 of file TGM_CNC.h.

◆ motion

GCODE_FEED GCODE_PARAMETERS::motion[8]

Default speeds, acceleration, deceleration and ramp type for the following movements:

Index to array Used for movement
0 fastfeed (G0)
1 forward (G1, G2, G3)
2 backward
3 connect
4 speed of forward motion without M function (regime 31 of function ToolChainCore_StartCNCEx)
5 feed in function ToolChainCore_GoToPosition
6 deceleration for normal stop, only the dec field
7 deceleration for emergency stop, only dec field

Definition at line 1430 of file TGM_CNC.h.

◆ correction

GCODE_CORRECTION GCODE_PARAMETERS::correction[8]

correction table defines tool radius compensation values for the following G functions:

Index to array Used for G function
0 G41
1 G42
2 G43
3 G44
4 G45
5 G46
6 G47
7 G48

Definition at line 1443 of file TGM_CNC.h.

◆ maxConnectionDistance

double GCODE_PARAMETERS::maxConnectionDistance

Maximum distance from given point to the trajectory for ToolChainCore_ConnectCNCEx_Plane. If the distance from the trajectory part is greater, this part is not used for calculation of the connection point.

Definition at line 1456 of file TGM_CNC.h.

◆ startAngle

double GCODE_PARAMETERS::startAngle

The two parts in the G-code can follow each other tangentially or with some angle. If the angle is small enough the system can move through with any deceleration. The threshold is given by this value in degrees. If the mutual angle of the two parts is larger, the system decelerates up to minAngleFeed, depending on the endAngle value.

Definition at line 1460 of file TGM_CNC.h.

◆ endAngle

double GCODE_PARAMETERS::endAngle

If the mutual angle of two parts of G-code is larger than this value, the system slows down to the feed defined in minAngleFeed. Values between startAngle and endAngle are interpolated.

Definition at line 1466 of file TGM_CNC.h.

◆ minAngleFeed

double GCODE_PARAMETERS::minAngleFeed

Minimum feed for motion if the mutual angle of two sections is greater than endAngle. Can be set to zero, in which case the system stops between two parts (with the mutual angle larger than endAngle)

Definition at line 1470 of file TGM_CNC.h.

◆ disableG0FeedOverride

int32_t GCODE_PARAMETERS::disableG0FeedOverride

If equal to 1, then the interpolator ignores feed override during fastfeed. Also enables automatic stop between two G0.

Definition at line 1474 of file TGM_CNC.h.

◆ interpolatorConfig0

int32_t GCODE_PARAMETERS::interpolatorConfig0

Bit coded value for change the interpolator behavior. Only bit 0 is used. Other bits are reserved for future use.

  • bit 0:
    • 0 - relative speed is changed only during achieved speed (i.e. during the acceleration or deceleration, the ToolChainCore_SetRelFeed is not active and the change is performed only after the full speed is reached)
    • 1 - relative speed change by time quantum, i.e. function ToolChainCore_SetRelFeed changes the speed immediatelly. Note that ToolChainCore_SetRelFeed than changes the acceleration and deceleration as well.

Definition at line 1477 of file TGM_CNC.h.

◆ overrideInc

double GCODE_PARAMETERS::overrideInc

Increment of feed override at 100us time slice. When the relative speed is changed by ToolChainCore_SetRelFeed, it cannot be done immediatley, but smoothly with a ramp. This value describes how fast the relative speed will be chnaged from one value to other.
Maximum is 0.1 = 10%
If equals 0, default value 0.001 is used, i.e. 0,1%.

Definition at line 1484 of file TGM_CNC.h.

◆ arcFeedTable

ARC_FEED_TABLE GCODE_PARAMETERS::arcFeedTable[5]

Table of relative speeds in relation to arc radius, 5 pairs all together [radius; rel_speed]. Zero radius value in the table means that the remaining values are not used, i.e. the table can have 0 - 5 items.
Examples:

  • all values set to zero - table is not used (default)
  • arcFeedTable[0].m_r = 0, arcFeedTable[0].m_relFeed = 0.5
    all arcs are run by relative speed of 50% (50% of the required arc speed)
  • arcFeedTable[0].m_r = 10, arcFeedTable[0].m_relFeed = 1.25,
    arcFeedTable[1].m_r = 0.9, arcFeedTable[1].m_relFeed = 0.1
    arcs with radius >= 10 (R=10) will have relative speed 125%, arcs smaller than R=10 up to R=0.9 will gradually have decreasing speeds up to 10% and all arcs smaller than R=0.9 will have 10% relative speed

Definition at line 1491 of file TGM_CNC.h.

◆ mFuncInsertTable

INTERNAL_MFUNC_INSERT_TABLE GCODE_PARAMETERS::mFuncInsertTable[3]

automatic insertion of continuous M functions to signal decrease in speed or reaching cutting speed.

table index description
0 M function before deceleration on arc - signalling future deceleration. If mFuncInsertTable[0].mFunc = 0, signalling is not used.
1 M function before acceleration on arc - signalling future full cutting speed. If mFuncInsertTable[1].mFunc = 0, signalling is not used.
2 M function before fastfeed G00. If mFuncInsertTable[2].mFunc = 0, signalling is not used.

Definition at line 1507 of file TGM_CNC.h.

◆ mFuncInsertType

int32_t GCODE_PARAMETERS::mFuncInsertType

Strategy of inserting M functions (see mFuncInsertTable), so far only 0 - off and 1 - on

Definition at line 1514 of file TGM_CNC.h.

◆ callbackWarningsInvokeMode

int32_t GCODE_PARAMETERS::callbackWarningsInvokeMode

During tool compensation calculation, a plenty math warnings callbacks could be called. To speed up the whole process, some of the warnings could be supressed.

Value Description
0 invoke math warnings callback always (default)
1 invoke math warnings callback only once for each warning ID
2 supress all math warnings

Definition at line 1517 of file TGM_CNC.h.

◆ M02_programEnd1

int32_t GCODE_PARAMETERS::M02_programEnd1

M function number for G-code ending. Default is 2, i.e. M2 function in G-code. If set to 0, the M2 in the G-code is treated as normal M function.

Definition at line 1529 of file TGM_CNC.h.

◆ M30_programEnd2

int32_t GCODE_PARAMETERS::M30_programEnd2

Alternative no. of M function to end G-code. Default = M30, 0 - off

Definition at line 1533 of file TGM_CNC.h.

◆ M03_startSpindleCW

int32_t GCODE_PARAMETERS::M03_startSpindleCW

No. of M function to start the spindle CW. Default = M3, 0 - off

Definition at line 1536 of file TGM_CNC.h.

◆ M04_startSpindleCCW

int32_t GCODE_PARAMETERS::M04_startSpindleCCW

No. of M function to start the spindle CCW. Default = M4, 0 - off

Definition at line 1539 of file TGM_CNC.h.

◆ M05_stopSpindle

int32_t GCODE_PARAMETERS::M05_stopSpindle

No. of M function to stop the spindle. Default = M5, 0 - off

Definition at line 1542 of file TGM_CNC.h.

◆ M06_changeTool

int32_t GCODE_PARAMETERS::M06_changeTool

No. of M function to change tool. Default = M6, 0 - off

Definition at line 1545 of file TGM_CNC.h.

◆ M07_coolOn

int32_t GCODE_PARAMETERS::M07_coolOn

No. of M function to switch on cooling. Default = M7, 0 - off

Definition at line 1548 of file TGM_CNC.h.

◆ M08_oilOn

int32_t GCODE_PARAMETERS::M08_oilOn

No. of M function to switch on lubrication. Default = M8, 0 - off

Definition at line 1551 of file TGM_CNC.h.

◆ M09_coolOilOff

int32_t GCODE_PARAMETERS::M09_coolOilOff

No. of M function to switch off cooling and lubrication. Default = M9, 0 - off

Definition at line 1554 of file TGM_CNC.h.

◆ M17_return

int32_t GCODE_PARAMETERS::M17_return

No. of M function to return from routine (keyword RETURN). Default = M17, 0 - off

Definition at line 1557 of file TGM_CNC.h.

◆ M29_print

int32_t GCODE_PARAMETERS::M29_print

No. of M function to print text report (PRINT) Default = M29, 0 - off

Definition at line 1560 of file TGM_CNC.h.

◆ M80_mirrorOff

int32_t GCODE_PARAMETERS::M80_mirrorOff

No. of M function to switch off mirroring. Default = M80, 0 - off

Definition at line 1563 of file TGM_CNC.h.

◆ M81_mirrorX

int32_t GCODE_PARAMETERS::M81_mirrorX

No. of M function to enable mirroring on X axis. Default = M81, 0 - off

Definition at line 1566 of file TGM_CNC.h.

◆ M82_mirrorY

int32_t GCODE_PARAMETERS::M82_mirrorY

No. of M function to enable mirroring on Y axis. Default = M82, 0 - off

Definition at line 1569 of file TGM_CNC.h.

◆ M83_mirrorZ

int32_t GCODE_PARAMETERS::M83_mirrorZ

No. of M function to enable mirroring on Z axis. Default = M83, 0 - off

Definition at line 1572 of file TGM_CNC.h.

◆ M84_mirrorXY

int32_t GCODE_PARAMETERS::M84_mirrorXY

No. of M function to enable mirroring on X and Y axes. Default = M84, 0 - off

Definition at line 1575 of file TGM_CNC.h.

◆ M85_mirrorXZ

int32_t GCODE_PARAMETERS::M85_mirrorXZ

No. of M function to enable mirroring on X and Z axes. Default = M85, 0 - off

Definition at line 1578 of file TGM_CNC.h.

◆ M86_mirrorYZ

int32_t GCODE_PARAMETERS::M86_mirrorYZ

No. of M function to enable mirroring on Y and Z axes. Default = M86, 0 - off

Definition at line 1581 of file TGM_CNC.h.

◆ M87_mirrorXYZ

int32_t GCODE_PARAMETERS::M87_mirrorXYZ

No. of M function to enable mirroring on X, Y and Z axes. Default = M87, 0 - off

Definition at line 1584 of file TGM_CNC.h.

◆ M99_defFeed

int32_t GCODE_PARAMETERS::M99_defFeed

No. of M function to define the initial value of feed, default = M99, 0 - off

Definition at line 1587 of file TGM_CNC.h.

◆ insertArcMode

int32_t GCODE_PARAMETERS::insertArcMode

Mode to insert small tangent arcs for sections not tangentially connected: 0 - off, 1 - off. Inserted arcs are defined in the following variables: insertArcToleranceRMax, insertArcToleranceRMin insertArcMaxAngle, insertArcMinAngle

Definition at line 1591 of file TGM_CNC.h.

◆ disableAdditionalProgramFlowInfo

int32_t GCODE_PARAMETERS::disableAdditionalProgramFlowInfo

by default all the elements in the G-code are signalled to the user application through callback function. Some of them can be disabled to speed up the G-code execution.

Set bit Description
0 disable info about Opcode (IF, FOR, RETURN, BREAK)
1 disable info about Assignment (Pxx = ...)
2 disable refresh of all params

Definition at line 1600 of file TGM_CNC.h.

◆ insertArcToleranceRMax

double GCODE_PARAMETERS::insertArcToleranceRMax

Maximum allowed distance between the intersection of two non-tangential sections and an inserted arc, the distance is used to calculate the inserted arc radius, implicitly 0.03 mm.

Definition at line 1609 of file TGM_CNC.h.

◆ insertArcToleranceRMin

double GCODE_PARAMETERS::insertArcToleranceRMin

Minimum allowed distance between the intersection of two non-tangential sections and an inserted arc, the distance is used to calculate the inserted arc radius, implicitly 0.03 mm.

Definition at line 1613 of file TGM_CNC.h.

◆ insertArcMaxAngle

double GCODE_PARAMETERS::insertArcMaxAngle

Max angle between G1 sections, up to which further arcs are added

Definition at line 1617 of file TGM_CNC.h.

◆ insertArcMinAngle

double GCODE_PARAMETERS::insertArcMinAngle

Min angle between G1 sections, from the value of which arcs are still added (not implemented, so far always = 0)

Definition at line 1620 of file TGM_CNC.h.

◆ insertArcPlane

int32_t GCODE_PARAMETERS::insertArcPlane

A plane on which arcs are inserted (17 - XY, 18 - XZ, 19 - YZ or 0, the system then determines a plane)

Definition at line 1623 of file TGM_CNC.h.

◆ calcTime

int32_t GCODE_PARAMETERS::calcTime

When set to 1, the system calculates the time which is necessary to finish the complete G-code. The calculation is done in simulation only. The time is only an estimated value.

Definition at line 1627 of file TGM_CNC.h.

◆ dynamicG41Correction_mm

double GCODE_PARAMETERS::dynamicG41Correction_mm

Additional dynamic correction in relation to speed for G41 in mm, carried out by interpolator

Definition at line 1632 of file TGM_CNC.h.

◆ dynamicG42Correction_mm

double GCODE_PARAMETERS::dynamicG42Correction_mm

Additional dynamic correction in relation to speed for G42 in mm, carried out by interpolator

Definition at line 1635 of file TGM_CNC.h.

◆ axisLimits

AXIS_LIMITS GCODE_PARAMETERS::axisLimits[ACTUAL_N_AXES]

Speed limits, acceleration and deceleration for all axes. When set the system lowers the feed and/or acceleration/deceleration if needed.

Definition at line 1638 of file TGM_CNC.h.

◆ dynamicG42Correction_percent

double GCODE_PARAMETERS::dynamicG42Correction_percent

Additional dynamic correction in relation to speed for G41 in percent, carried out by interpolator

Definition at line 1645 of file TGM_CNC.h.

◆ tolerance

double GCODE_PARAMETERS::tolerance[10]

Tolerance array:

Index Description
GCODE_ALLOWED_CIRC_CENTER_ACCURACY = 0 Allowed error in specifying the centre of circular interpolation, default 0.005 mm
GCODE_CROSSING_ACCURACY = 1 Crossing calculation tolerance, default is 0.001
GCODE_ANGULAR_PRECISION = 2 Angular tolerance of two connected lines in degrees, default is 0.03
GCODE_ANGULAR_DISTANCE_PRECISION = 3 When two lines are joined to one, max allowed distance between the new line and original lines, default 0.005
GCODE_MINIMAL_ALLOWED_ARC_R = 4 Arcs with readius below this value will be removed
GCODE_NO_ADD_R_MULTIPLIER = 5 Multiplier of correction value - use line connection of two parts instead of an arc
GCODE_SOURCE_PRECISION = 6 Precision of the source G-code

Definition at line 1659 of file TGM_CNC.h.


The documentation for this struct was generated from the following file: