Heidenhain Post-Processor
Description
introduced in 26.3: The heidenhain Post-Processor (Post) writes a Heidenhain Klartext (conversational) program. Klartext is not G-code. The Post translates each command of a Toolpath into a Klartext block and passes no command through unchanged. The target dialect is common to the TNC 4xx, iTNC 530, TNC 620, TNC 640 and TNC7 controls. A second cycle format serves controls that have no Q-parameter cycles.
Properties
Each Post-Processor Property has one Property Scope. A Machine-scope property is edited in the Machine Editor only. A Job-scope property gets its default in the Machine Editor, and the Options tab of the Post-Processing Dialog overrides it for one export. Machine Configuration gives the priority of the value sources.
Properties of the heidenhain Post
| Label | Name | Scope | Values | Default | Effect |
|---|---|---|---|---|---|
Program Name |
|
Job |
Text |
Empty |
The name in the |
Tool Axis |
|
Machine |
|
|
The axis letter in the |
Rapid Feed Rate (0 = FMAX) |
|
Machine |
0 to 999999 |
0 |
A feed in mm/min that the Post writes on rapid blocks as a replacement for |
Drill Cycle Format |
|
Machine |
|
|
|
Drill Cycle Set-Up Clearance |
|
Machine |
0 to 1000 |
2.0 |
The set-up clearance ( |
Chip Breaking Retract |
|
Machine |
0 to 100 |
0.5 |
The retraction distance ( |
Fixture Output |
|
Machine |
|
|
|
Fixture Number for G54 |
|
Machine |
0 to 9999 |
1 |
The preset number or datum number that |
Output BLK FORM |
|
Job |
Checkbox |
Checked |
Writes the Stock bounding box as |
Defaults of the common properties
The heidenhain Post changes the defaults of these common properties. Machine describes each common property.
| Property | Default | Reason |
|---|---|---|
File Extension |
|
The extension of a Klartext program. |
Tool Radius Compensation (G41/G42) |
Checked |
The Post writes radius compensation as the words |
Supported G-code Commands |
The list under Accepted commands |
The Post always uses this list. A value in the Machine has no effect. |
Drill Cycles to Translate |
Empty |
The Post writes each drill cycle as a Klartext cycle. |
TLO after tool-change |
Unchecked |
|
Axis precision in output |
3 |
|
|
0 |
|
Spindle-speed precision in output |
0 |
Machine output options
The Post sets three output options of the Machine to fixed values. The values on the Options tab of the Machine Editor have no effect for these options.
-
The comment symbol is
;. A Klartext comment is a block that starts with;. -
Duplicate Commands is on. Each motion block needs its block word, such as
LorC. -
The Line Numbers options are off. The Post writes the Klartext block numbers itself, as Block numbers describes.
The Post removes empty lines from the program. Output Units selects the units word in the BEGIN PGM and END PGM blocks.
Output
Accepted commands
The Post accepts these commands from a Toolpath:
-
Motion:
G0,G1,G2,G3. -
Dwell:
G4. -
Drill cycles:
G73,G81,G82,G83,G85, and the tapping cyclesG74andG84. -
Radius compensation:
G40,G41,G42. -
Fixture commands:
G54toG59.9. A Fixture is a G54 to G59.9 selection, not the workholding. -
Spindle, coolant and
M6:M3,M4,M5,M6,M7,M8,M9. -
Program stop, optional stop and program end M commands.
-
Modal commands that have no Klartext equivalent:
G17,G20,G21,G43,G80,G90,G94,G97,G98,G99. The Post accepts these commands and writes no block for them.
Program start and end
BEGIN PGM <name> <units> is block 0 of each output file. The header comments follow it. END PGM <name> <units> is the last block, after the postamble.
-
The units word is
INCHwhen the output units of the Machine are imperial, andMMin all other conditions. The Post writes noG20orG21equivalent. -
The program name is Program Name, or the Job label when Program Name is empty.
-
The Post replaces each sequence of characters that are not letters or digits with one underscore.
-
The Post removes underscores at the two ends of the name and changes the letters to upper case.
-
When the result is empty, the name is
FREECAD.
With Output BLK FORM checked, two blocks follow BEGIN PGM. BLK FORM 0.1 has the Tool Axis letter and the minimum corner of the Stock bounding box. BLK FORM 0.2 has the maximum corner. The Post writes no BLK FORM block when the Job has no Stock shape.
Block numbers
Each block has a number. The numbers are the physical line numbers of the file and start at 0 in each output file. A line that ends in a tilde (~) continues its block on the next line. A continuation line has no number.
Coordinates and feed
-
Each coordinate has an explicit sign, for example
X+10.000orZ-2.000. A negative zero gets a plus sign. -
The words
A,BandCare in degrees with the axis precision. The Post does not convert them between millimetres and inches. -
A rapid block ends with
FMAX, or with the feed of therapid_feed_rateproperty. -
A feed block has the F word of its command. When the command has no F word, the block has the last programmed feed.
-
A command with a block-delete annotation gets the prefix
/.
Linear moves
G0 and G1 become an L block. The block has the axis words of the command, then the radius compensation word, then the feed word. The Post writes no block when the command has no axis words.
Radius compensation
G40, G41 and G42 write no block. They set the word that each subsequent L block and arc block contains.
| Command | Word |
|---|---|
|
|
|
|
|
|
An M6 command sets the word to R0.
Arcs
G2 writes DR- and G3 writes DR+. The form of the arc block depends on the parameters of the command.
| Command | Blocks |
|---|---|
An arc with R and no I or J |
A |
An arc with I or J and no change in Z |
A |
An arc with I or J and a change in Z |
A |
The Post writes the CC block only when the centre is different from the centre of the last CC block. An arc whose start point and end point are the same has a swept angle of 360 degrees.
The export stops with an error in these conditions:
-
The start position of the arc is not known. Program a move before the arc.
-
The radius of an arc with R is zero.
-
The arc has no I, no J and no R.
Drill cycles
Drill Cycle Format selects the cycle that the Post writes for each command.
| Command | q_parameter |
legacy |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
None. The export stops with an error. |
The Post calculates the cycle values from the drill command:
-
The set-up clearance is Drill Cycle Set-Up Clearance.
-
The surface coordinate is the R value of the command minus the set-up clearance.
-
The depth is the Z value of the command minus the surface coordinate. The depth is negative.
-
The second set-up clearance is the Z position before the cycle minus the R value. It applies when the return mode is not the R level and that Z position is above R. In all other conditions the value is 0.
-
The dwell time at depth is the P value of the command.
-
The plunging depth of
G83andG73is the Q value of the command. For the other commands, and when Q is absent, it is the full depth.
In the q_parameter format, the first line of a cycle definition is the cycle title with a continuation mark. Each Q parameter follows on its own line with its value and a ; comment that names the parameter. The Post writes a cycle definition only when it is different from the last definition in the file. Each hole is one rapid L block to the X and Y position that ends with M99, which calls the cycle.
CYCL DEF 203 for G73 has the number of chip breaks in Q213. That number is the depth divided by the plunging depth, increased to the next integer. Q256 has the value of Chip Breaking Retract. CYCL DEF 202 for G85 uses the feed of the command as the retraction feed.
In the legacy format, the definition is a sequence of numbered blocks:
-
CYCL DEF 1.0 PECKINGtoCYCL DEF 1.5have the set-up clearance, the depth, the pecking depth, the dwell and the feed. -
CYCL DEF 17.0 RIGID TAPPINGtoCYCL DEF 17.3have the set-up clearance, the depth and the pitch.
A cycle of the legacy format starts from the current position. For each hole the Post writes a rapid L block to the X and Y position, a rapid L block to the retract height, and CYCL CALL. The Post writes each L block only when the position changes. When the second set-up clearance is more than 0, a rapid L block then moves to the initial Z position.
The export stops with an error in these conditions:
-
The cycle has no R value or no Z value.
-
The X and Y position is not known.
-
A drill cycle that is not a tapping cycle has no feed.
-
The Z value is not below the R value minus the set-up clearance.
Tapping
G84 and G74 write the thread pitch into the cycle: Q239 of CYCL DEF 207, or CYCL DEF 17.3 PITCH. The pitch of G74 is negative, for a left-hand thread.
-
When the tapping generator of the Drilling Operation made the command, the F word is the pitch.
-
For all other tapping commands, the Post calculates the pitch from the F word and the Spindle Speed.
The export stops with an error when the command has no F word, when the pitch is not more than 0, or when the calculation has no Spindle Speed.
Dwell
G4 becomes two blocks: CYCL DEF 9.0 DWELL TIME and CYCL DEF 9.1 DWELL with the P value in seconds.
Tool change, spindle and coolant
-
M6becomesTOOL CALLwith the Tool Bit number, the Tool Axis letter and the S word. The S value comes from theM3orM4that follows theM6. -
The Post writes no
G43equivalent.TOOL CALLapplies the length of the Tool Bit from the Tool Bit table of the control. -
M3andM4becomeM3andM4. When the Spindle Speed is different from the speed of the lastTOOL CALL, the blockTOOL CALL S<speed>comes first. This block changes only the Spindle Speed. -
M5becomesM5. -
Coolant commands, program stop commands and program end commands become M words with no zero before the number:
M08becomesM8. -
A
Tcommand with only a number becomesTOOL DEF <number>. This block selects the next Tool Bit before theM6for that Tool Bit. -
With Allow tool-change unchecked, the Post writes no
TOOL CALLthat has a Tool Bit number. The firstM3orM4then sets the Spindle Speed withTOOL CALL S<speed>.
Fixtures
Fixture Output selects the blocks for a Fixture command.
| Value | Blocks |
|---|---|
|
|
|
|
|
No block. |
The number for G54 is Fixture Number for G54. Each subsequent Fixture adds 1, to G59.9, which is the fifteenth Fixture.
Limitations
-
The Post writes arcs in the XY plane only. Tool Axis changes the axis letter in
TOOL CALLandBLK FORMand does not change the arc plane. -
The
legacycycle format has no cycle forG85. Use theq_parameterformat for a Job that containsG85. -
The Post accepts only the commands under Accepted commands.
G38.2,G88andG89are examples of commands that are not in the list. -
A command that has no Klartext equivalent and is not in the list stops the export with an error.
-
The
rapid_feed_rate,drill_setup_clearanceandchip_break_retractproperties are in millimetres for metric output and for imperial output. -
The Machine values of Supported G-code Commands and TLO after tool-change, and the Machine options for the comment symbol, duplicate commands and line numbers, have no effect.