Structure for setting G-code properties.
More...
#include <TGM_CNC.h>
Structure for setting G-code properties.
Definition at line 1259 of file TGM_CNC.h.
◆ 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:
- CORR_STRATEGY_G41_ALREADY_CORRECTED (0x00000000):
G41, G42 means already corrected coordinate; G40 says that only the end of the following motion will be left uncorrected
- CORR_STRATEGY_G41_STARTS_CORRECTION (0x00000001):
G41, G42 only corrects the end of the following motion; G40 says the end of the previous motion will not be corrected
- CORR_STRATEGY_SEARCH_DEEP_10 (0x00000100):
Search at least 10 parts for possible crosses
- CORR_STRATEGY_SEARCH_DEEP_50 (0x00000200):
Search at least 50 parts for possible crosses
- CORR_STRATEGY_SEARCH_DEEP_100 (0x00000300):
Search at least 100 parts for possible crosses
- CORR_STRATEGY_SEARCH_DEEP_500 (0x00000400):
Search at least 500 parts for possible crosses
- CORR_STRATEGY_SEARCH_DEEP_1000 (0x00000500):
Search at least 1000 parts for possible crosses
- CORR_STRATEGY_SEARCH_DEEP_2000 (0x00000600):
Search at least 2000 parts for possible crosses
- CORR_STRATEGY_SEARCH_DEEP_ALL (0x00000700):
Search the maximal number of parts for possible crosses in the internal buffer (approx 5000)
- CORR_STRATEGY_ALLOW_FIRST_LAST_CROSS (0x00010000):
Allow crossing of the first and last part of the closed conture. In that case, parts inside are not removed.
- CORR_STRATEGY_CONNECT_WRONG_BY_MOVE (0x00020000):
After correction calculation, if there are unconnected parts, connect them by move of starting point to endpoint of the previous part
- CORR_STRATEGY_CONNECT_WRONG_BY_G1 (0x00040000):
After correction calculation, if there are unconnected parts, connect them by inserted G1
- CORR_STRATEGY_REMOVE_CROSSES (0x00080000):
After the calculation, if there are crossed parts (which are not crossed in the original G-code), these parts are removed.
- CORR_STRATEGY_ALLOW_REVERSE_LINES (0x00100000):
It is allowed to traverse the line or arc backwards, if the correction is not possible to calculate otherwise. Slows down the calculation.
- CORR_STRATEGY_REMOVE_SMALL_ARCS (0x00200000):
After tool compensation calculation, there could be arcs with negative or very small radius. If the calculated radius of such arcs is smaller than a value given in GCODE_PARAMETERS::tolerance[GCODE_MINIMAL_ALLOWED_ARC_R], the arc will be removed. This bit is usually set.
- CORR_STRATEGY_NO_ADD_R (0x00400000):
If possible, do not connect two parts by and additional arc (with radius equal to tool radius), but uses theirs cross point. The allowed distance is specified as a multiple of tool radius (see GCODE_PARAMETERS::tolerance).
- CORR_STRATEGY_REMOVE_FIRST_ARC (0x00800000):
Removes the first arc of a closed conture (in the case that the arc is the approach of the conture) if the equidistants do not cross.
- CORR_STRATEGY_REMOVE_LAST_ARC (0x01000000):
Removes the last arc of a closed conture (in the case that the arc is the exit of the conture) if the equidistants do not cross.
- CORR_STRATEGY_CHECK_ORIGINAL_GCODE (0x02000000):
checks continuity of the G-code with the given tolerance (see GCODE_PARAMETERS::tolerance).
- CORR_STRATEGY_FORCE_TO_CONTINUE (0x20000000):
In the case of wrong G-code (impossible to calculate tool compensation), do not throw an error and continue. Usable for simulation only (to visualize where the problem lies).
- CORR_STRATEGY_G00_WITHOUT_CORR (0x40000000):
If this bit is set, G00 is always without correction.
- CORR_STRATEGY_OLD_VERSION (0x80000000):
If this bit is set, the mode of compatibility with the old system is set. Specifically, the first G41/G42 is ignored, if there is no motion in front of it. Further, the G40 - G41/G42 pair is ignored, if they follow closely one by one (i.e. no motion between G40 and G41/G42).
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 function switches to mode 0, i.e. speed consistent with G-code.
switches to the previous mode
Definition at line 1406 of file TGM_CNC.h.
◆ motion
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
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
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
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
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: