Heidenhain Postprocessor

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Zibibbo84
Posts: 21
Joined: Fri May 01, 2020 2:07 pm

Re: Heidenhain Postprocessor

Post by Zibibbo84 »

chrisb wrote: Sat May 02, 2020 2:48 pm Retract should be what we call in FreeCAD Safe Height.
What is the difference from Clearence Height and Safe Height
Cause i need to implement it to the cicle

i can get:
obj.ClearanceHeight = 6.00005 mm
obj.RetractHeight = 10 mm
obj.SafeHeight = 4.00005 mm
obj.StartDepth = 1.00005 mm

RetractHeight it's ClearanceHeight + SafeHeight ?

And it's always the same?
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Heidenhain Postprocessor

Post by chrisb »

Zibibbo84 wrote: Sat May 02, 2020 5:02 pm What is the difference from Clearence Height and Safe Height
See this discussion and the image from the Path documentation: https://forum.freecadweb.org/viewtopic.php?f=15&t=45678.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Zibibbo84
Posts: 21
Joined: Fri May 01, 2020 2:07 pm

Re: Heidenhain Postprocessor

Post by Zibibbo84 »

chrisb wrote: Sat May 02, 2020 11:41 pm
Zibibbo84 wrote: Sat May 02, 2020 5:02 pm What is the difference from Clearence Height and Safe Height
See this discussion and the image from the Path documentation: https://forum.freecadweb.org/viewtopic.php?f=15&t=45678.
Ok, so the tool go back to Clearence Height for movements
But, if i have no clumps, i can set Clearence Height = Safe Height and this is ok
Can be made something like this?
500px-Path-DepthsAndHeights2.gif
500px-Path-DepthsAndHeights2.gif (27.87 KiB) Viewed 4010 times
I know i'm inside the stock but if the piece is already worked it's a time waster the distance from Clearence Height to Start Depth
It change if i use G99 ?

Is i'm asking for futile things, but the use of "Safe Height" should allow a vertical rapid movent from Clearence Height befor start drilling
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Heidenhain Postprocessor

Post by chrisb »

You can set clearance in the job setup and you can set clearance height in each Path operation.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Zibibbo84
Posts: 21
Joined: Fri May 01, 2020 2:07 pm

Re: Heidenhain Postprocessor

Post by Zibibbo84 »

chrisb wrote: Sun May 03, 2020 10:55 am You can set clearance in the job setup and you can set clearance height in each Path operation.
I'm not sure on what to do if these values are greyed
img.jpg
img.jpg (55.81 KiB) Viewed 3995 times
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Heidenhain Postprocessor

Post by chrisb »

That means they are set by a calculated expression. Click on the f(x) symbol to edit them. See Expressions.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Zibibbo84
Posts: 21
Joined: Fri May 01, 2020 2:07 pm

Re: Heidenhain Postprocessor

Post by Zibibbo84 »

Ok i think i made it more comfortable
DRILL.jpg
DRILL.jpg (46.22 KiB) Viewed 3969 times

Code: Select all

<Path count="9" version="2">
     <Center x="0" y="0" z="0"/>
     <Command gcode="(Drilling)" />
     <Command gcode="(Begin Drilling)" />
     <Command gcode="G0 F0.000000 Z5.000000" />
     <Command gcode="G90" />
     <Command gcode="G98" />
     <Command gcode="G82 F300.000000 P5.000000 R5.000000 X-135.000000 Y-11.000000 Z-60.000000" />
     <Command gcode="G82 F300.000000 P5.000000 R5.000000 X135.000000 Y-51.000000 Z-60.000000" />
     <Command gcode="G80" />
     <Command gcode="G0 Z5.000000" />
</Path>
obj.RetractHeight = 5 mm
obj.ReturnLevel = G98
obj.SafeHeight = -11 mm
obj.StartDepth = -16 mm
And the result:

Code: Select all

0 BEGIN PGM DRILL MM
1 TOOL CALL 1 Z S1000 ;Default Tool
2 L Z5.000 R0 FMAX M3
3 L X-135.000 Y-11.000 R0 FMAX M
4 CYCL DEF 1.0 FORATURA PROF.
5 CYCL DEF 1.1 DIST-21.000
6 CYCL DEF 1.2 PROF-44.000
7 CYCL DEF 1.3 INCR-44.000
8 CYCL DEF 1.4 SOSTA5
9 CYCL DEF 1.5 F300
10 CYCLE CALL M
11 L X135.000 Y-51.000 R0 FMAX M
12 CYCLE CALL M
13 L Z5.000 R0 FMAX M5
14 END PGM DRILL MM
Where we have the surface at Z-16
So th cycle goes to Z-60 cause we start at Z+5, -21 is the distance from cycle call and the surface (5+16), 44 is the depth (+5 -21 -44 = -60)

I will update the the file on the fist post
Zibibbo84
Posts: 21
Joined: Fri May 01, 2020 2:07 pm

Re: Heidenhain Postprocessor

Post by Zibibbo84 »

New update:
Helix now it's parsed

Code: Select all

<Path count="52" version="2">
	<Center x="0" y="0" z="0"/>
	<Command gcode="(Helix)" />
	<Command gcode="(helix cut operation)" />
	<Command gcode="G0 F0.000000 Z6.000048" />
	<Command gcode="G0 F0.000000 X-57.494890 Y-39.502670" />
	<Command gcode="G0 F0.000000 Z4.000048" />
	<Command gcode="G1 F50.000000 Z1.000048" />
	<Command gcode="G2 F200.000000 I-2.500000 J0.000000 X-62.494890 Y-39.502670 Z-1.099957" />
	<Command gcode="G2 F200.000000 I2.500000 J0.000000 X-57.494890 Y-39.502670 Z-3.199961" />
	<Command gcode="G2 F200.000000 I-2.500000 J0.000000 X-62.494890 Y-39.502670 Z-5.299966" />
	<Command gcode="G2 F200.000000 I2.500000 J0.000000 X-57.494890 Y-39.502670 Z-7.399971" />
	<Command gcode="G2 F200.000000 I-2.500000 J0.000000 X-62.494890 Y-39.502670 Z-9.499976" />
	<Command gcode="G2 F200.000000 I2.500000 J0.000000 X-57.494890 Y-39.502670 Z-11.599981" />
	<Command gcode="G2 F200.000000 I-2.500000 J0.000000 X-62.494890 Y-39.502670 Z-13.699986" />
	<Command gcode="G2 F200.000000 I2.500000 J0.000000 X-57.494890 Y-39.502670 Z-15.799990" />
	<Command gcode="G2 F200.000000 I-2.500000 J0.000000 X-62.494890 Y-39.502670 Z-17.899995" />
	<Command gcode="G2 F200.000000 I2.500000 J0.000000 X-57.494890 Y-39.502670 Z-20.000000" />
	<Command gcode="G2 F200.000000 I-2.500000 J0.000000 X-62.494890 Y-39.502670 Z-20.000000" />
	<Command gcode="G2 F200.000000 I2.500000 J0.000000 X-57.494890 Y-39.502670 Z-20.000000" />
	<Command gcode="G0 F0.000000 Z4.000048" />
	<Command gcode="G0 F0.000000 X-53.744890 Y-39.502670" />
	<Command gcode="G0 F0.000000 Z4.000048" />
	<Command gcode="G1 F50.000000 Z1.000048" />
	<Command gcode="G2 F200.000000 I-6.250000 J0.000000 X-66.244890 Y-39.502670 Z-1.099957" />
	<Command gcode="G2 F200.000000 I6.250000 J0.000000 X-53.744890 Y-39.502670 Z-3.199961" />
	<Command gcode="G2 F200.000000 I-6.250000 J0.000000 X-66.244890 Y-39.502670 Z-5.299966" />
	<Command gcode="G2 F200.000000 I6.250000 J0.000000 X-53.744890 Y-39.502670 Z-7.399971" />
	<Command gcode="G2 F200.000000 I-6.250000 J0.000000 X-66.244890 Y-39.502670 Z-9.499976" />
	<Command gcode="G2 F200.000000 I6.250000 J0.000000 X-53.744890 Y-39.502670 Z-11.599981" />
	<Command gcode="G2 F200.000000 I-6.250000 J0.000000 X-66.244890 Y-39.502670 Z-13.699986" />
	<Command gcode="G2 F200.000000 I6.250000 J0.000000 X-53.744890 Y-39.502670 Z-15.799990" />
	<Command gcode="G2 F200.000000 I-6.250000 J0.000000 X-66.244890 Y-39.502670 Z-17.899995" />
	<Command gcode="G2 F200.000000 I6.250000 J0.000000 X-53.744890 Y-39.502670 Z-20.000000" />
	<Command gcode="G2 F200.000000 I-6.250000 J0.000000 X-66.244890 Y-39.502670 Z-20.000000" />
	<Command gcode="G2 F200.000000 I6.250000 J0.000000 X-53.744890 Y-39.502670 Z-20.000000" />
	<Command gcode="G0 F0.000000 Z4.000048" />
	<Command gcode="G0 F0.000000 X-49.994890 Y-39.502670" />
	<Command gcode="G0 F0.000000 Z4.000048" />
	<Command gcode="G1 F50.000000 Z1.000048" />
	<Command gcode="G2 F200.000000 I-10.000000 J0.000000 X-69.994890 Y-39.502670 Z-1.099957" />
	<Command gcode="G2 F200.000000 I10.000000 J0.000000 X-49.994890 Y-39.502670 Z-3.199961" />
	<Command gcode="G2 F200.000000 I-10.000000 J0.000000 X-69.994890 Y-39.502670 Z-5.299966" />
	<Command gcode="G2 F200.000000 I10.000000 J0.000000 X-49.994890 Y-39.502670 Z-7.399971" />
	<Command gcode="G2 F200.000000 I-10.000000 J0.000000 X-69.994890 Y-39.502670 Z-9.499976" />
	<Command gcode="G2 F200.000000 I10.000000 J0.000000 X-49.994890 Y-39.502670 Z-11.599981" />
	<Command gcode="G2 F200.000000 I-10.000000 J0.000000 X-69.994890 Y-39.502670 Z-13.699986" />
	<Command gcode="G2 F200.000000 I10.000000 J0.000000 X-49.994890 Y-39.502670 Z-15.799990" />
	<Command gcode="G2 F200.000000 I-10.000000 J0.000000 X-69.994890 Y-39.502670 Z-17.899995" />
	<Command gcode="G2 F200.000000 I10.000000 J0.000000 X-49.994890 Y-39.502670 Z-20.000000" />
	<Command gcode="G2 F200.000000 I-10.000000 J0.000000 X-69.994890 Y-39.502670 Z-20.000000" />
	<Command gcode="G2 F200.000000 I10.000000 J0.000000 X-49.994890 Y-39.502670 Z-20.000000" />
	<Command gcode="G0 F0.000000 Z4.000048" />
	<Command gcode="G0 Z6.000048" />
</Path>
transformed

Code: Select all

0 BEGIN PGM MyJob MM
1 TOOL CALL 1 Z S500 ;FR D6
2 L Z6.000 R0 FMAX M3
3 L X-57.495 Y-39.503 R0 FMAX M
4 L Z4.000 R0 FMAX M
5 L Z1.000 R0 F50 M
6 CC X-59.995 Y-39.503
7 CP PA+180.000 Z-1.100 DR- R0 F200 M
8 CP PA+0.000 Z-3.200 DR- R0 F200 M
9 CP PA+180.000 Z-5.300 DR- R0 F200 M
10 CP PA+0.000 Z-7.400 DR- R0 F200 M
11 CP PA+180.000 Z-9.500 DR- R0 F200 M
12 CP PA+0.000 Z-11.600 DR- R0 F200 M
13 CP PA+180.000 Z-13.700 DR- R0 F200 M
14 CP PA+0.000 Z-15.800 DR- R0 F200 M
15 CP PA+180.000 Z-17.900 DR- R0 F200 M
16 CP PA+0.000 Z-20.000 DR- R0 F200 M
17 CP PA+180.000 Z-20.000 DR- R0 F200 M
18 CP PA+0.000 Z-20.000 DR- R0 F200 M
19 L Z4.000 R0 FMAX M
20 L X-53.745 R0 FMAX M
21 L Z1.000 R0 F50 M
22 CP PA+180.000 Z-1.100 DR- R0 F200 M
23 CP PA+0.000 Z-3.200 DR- R0 F200 M
24 CP PA+180.000 Z-5.300 DR- R0 F200 M
25 CP PA+0.000 Z-7.400 DR- R0 F200 M
26 CP PA+180.000 Z-9.500 DR- R0 F200 M
27 CP PA+0.000 Z-11.600 DR- R0 F200 M
28 CP PA+180.000 Z-13.700 DR- R0 F200 M
29 CP PA+0.000 Z-15.800 DR- R0 F200 M
30 CP PA+180.000 Z-17.900 DR- R0 F200 M
31 CP PA+0.000 Z-20.000 DR- R0 F200 M
32 CP PA+180.000 Z-20.000 DR- R0 F200 M
33 CP PA+0.000 Z-20.000 DR- R0 F200 M
34 L Z4.000 R0 FMAX M
35 L X-49.995 R0 FMAX M
36 L Z1.000 R0 F50 M
37 CP PA+180.000 Z-1.100 DR- R0 F200 M
38 CP PA+0.000 Z-3.200 DR- R0 F200 M
39 CP PA+180.000 Z-5.300 DR- R0 F200 M
40 CP PA+0.000 Z-7.400 DR- R0 F200 M
41 CP PA+180.000 Z-9.500 DR- R0 F200 M
42 CP PA+0.000 Z-11.600 DR- R0 F200 M
43 CP PA+180.000 Z-13.700 DR- R0 F200 M
44 CP PA+0.000 Z-15.800 DR- R0 F200 M
45 CP PA+180.000 Z-17.900 DR- R0 F200 M
46 CP PA+0.000 Z-20.000 DR- R0 F200 M
47 CP PA+180.000 Z-20.000 DR- R0 F200 M
48 CP PA+0.000 Z-20.000 DR- R0 F200 M
49 L Z4.000 R0 FMAX M
50 L Z6.000 R0 FMAX M5
51 END PGM MyJob MM
I tested it and it's ok
helix2.jpg
helix2.jpg (19.21 KiB) Viewed 3941 times
helix.jpg
helix.jpg (78.75 KiB) Viewed 3941 times
update on first post
Zibibbo84
Posts: 21
Joined: Fri May 01, 2020 2:07 pm

Re: Heidenhain Postprocessor

Post by Zibibbo84 »

Update:
Added Post Arguments
arguments.png
arguments.png (17.01 KiB) Viewed 3910 times
Fixed Little bugs
Cleaned some things

Update on first post
Zibibbo84
Posts: 21
Joined: Fri May 01, 2020 2:07 pm

Re: Heidenhain Postprocessor

Post by Zibibbo84 »

UPDATE:
Fixed G91 G90 incremental and absolute computing (i think :roll: )

Added a new feature LBLize, yes because i want to kill my brain
This funtion replace repeated movements with LBL's
Need to be tested but seems to work correctly
rep.jpg
rep.jpg (23.79 KiB) Viewed 3865 times
The picture show a profile path repeated with different depth values
And the original code is very long

Code: Select all

0 BEGIN PGM MyJob MM
1 TOOL CALL 1 Z S1600 ;FR D6
2 L Z100.000 R0 F8000 M3
3 L X-50.000 Y30.000 Z6.000 R0 F8000 M
4 L Z100.000 R0 F8000 M
5 L Y1.000 Z-2.000 R0 F1000 M
6 L X-39.948 R0 F480 M
7 CC X-39.999 Y-14.999
8 C X-24.000 Y-14.948 DR- R0 F480 M
9 L Y-67.550 R0 F480 M
10 CC X-29.989 Y-67.402
11 C X-28.764 Y-73.266 DR- R0 F480 M
12 CC X-29.987 Y-67.551
13 C X-31.395 Y-73.224 DR- R0 F480 M
14 L X-96.226 Y-55.852 R0 F480 M
15 CC X-82.996 Y-6.635
16 C X-107.938 Y-51.079 DR- R0 F480 M
17 CC X-173.791 Y-167.883
18 C X-139.105 Y-38.358 DR+ R0 F480 M
19 L X-183.903 Y-26.355 R0 F480 M
20 CC X-182.200 Y-20.601
21 C X-182.355 Y-14.602 DR- R0 F480 M
22 L X-120.695 R0 F480 M
23 CC X-120.631 Y-13.352
24 C X-119.951 Y-14.402 DR+ R0 F480 M
25 L X-94.595 Y0.237 R0 F480 M
26 CC X-91.680 Y-4.947
27 C X-91.748 Y1.000 DR- R0 F480 M
28 L X-50.000 R0 F480 M
29 L Z-5.000 R0 F1000 M
30 L X-39.948 R0 F480 M
31 CC X-39.999 Y-14.999
32 C X-24.000 Y-14.948 DR- R0 F480 M
33 L Y-67.550 R0 F480 M
34 CC X-29.989 Y-67.402
35 C X-28.764 Y-73.266 DR- R0 F480 M
36 CC X-29.987 Y-67.551
37 C X-31.395 Y-73.224 DR- R0 F480 M
38 L X-96.226 Y-55.852 R0 F480 M
39 CC X-82.996 Y-6.635
40 C X-107.938 Y-51.079 DR- R0 F480 M
41 CC X-173.791 Y-167.883
42 C X-139.105 Y-38.358 DR+ R0 F480 M
43 L X-183.903 Y-26.355 R0 F480 M
44 CC X-182.200 Y-20.601
45 C X-182.355 Y-14.602 DR- R0 F480 M
46 L X-120.695 R0 F480 M
47 CC X-120.631 Y-13.352
48 C X-119.951 Y-14.402 DR+ R0 F480 M
49 L X-94.595 Y0.237 R0 F480 M
50 CC X-91.680 Y-4.947
51 C X-91.748 Y1.000 DR- R0 F480 M
52 L X-50.000 R0 F480 M
53 L Z-8.000 R0 F1000 M
54 L X-39.948 R0 F480 M
55 CC X-39.999 Y-14.999
56 C X-24.000 Y-14.948 DR- R0 F480 M
57 L Y-67.550 R0 F480 M
58 CC X-29.989 Y-67.402
59 C X-28.764 Y-73.266 DR- R0 F480 M
60 CC X-29.987 Y-67.551
61 C X-31.395 Y-73.224 DR- R0 F480 M
62 L X-96.226 Y-55.852 R0 F480 M
63 CC X-82.996 Y-6.635
64 C X-107.938 Y-51.079 DR- R0 F480 M
65 CC X-173.791 Y-167.883
66 C X-139.105 Y-38.358 DR+ R0 F480 M
67 L X-183.903 Y-26.355 R0 F480 M
68 CC X-182.200 Y-20.601
69 C X-182.355 Y-14.602 DR- R0 F480 M
70 L X-120.695 R0 F480 M
71 CC X-120.631 Y-13.352
72 C X-119.951 Y-14.402 DR+ R0 F480 M
73 L X-94.595 Y0.237 R0 F480 M
74 CC X-91.680 Y-4.947
75 C X-91.748 Y1.000 DR- R0 F480 M
76 L X-50.000 R0 F480 M
77 L Z-10.000 R0 F1000 M
78 L X-39.948 R0 F480 M
79 CC X-39.999 Y-14.999
80 C X-24.000 Y-14.948 DR- R0 F480 M
81 L Y-67.550 R0 F480 M
82 CC X-29.989 Y-67.402
83 C X-28.764 Y-73.266 DR- R0 F480 M
84 CC X-29.987 Y-67.551
85 C X-31.395 Y-73.224 DR- R0 F480 M
86 L X-96.226 Y-55.852 R0 F480 M
87 CC X-82.996 Y-6.635
88 C X-107.938 Y-51.079 DR- R0 F480 M
89 CC X-173.791 Y-167.883
90 C X-139.105 Y-38.358 DR+ R0 F480 M
91 L X-183.903 Y-26.355 R0 F480 M
92 CC X-182.200 Y-20.601
93 C X-182.355 Y-14.602 DR- R0 F480 M
94 L X-120.695 R0 F480 M
95 CC X-120.631 Y-13.352
96 C X-119.951 Y-14.402 DR+ R0 F480 M
97 L X-94.595 Y0.237 R0 F480 M
98 CC X-91.680 Y-4.947
99 C X-91.748 Y1.000 DR- R0 F480 M
100 L X-50.000 R0 F480 M
101 L Z6.000 R0 F8000 M5
102 END PGM MyJob MM
After LBLize you can see there's a very big difference

Code: Select all

0 BEGIN PGM MyJob MM
1 TOOL CALL 1 Z S1600 ;FR D6
2 L Z100.000 R0 F8000 M3
3 L X-50.000 Y30.000 Z6.000 R0 F8000 M
4 L Z100.000 R0 F8000 M
5 L Y1.000 Z-2.000 R0 F1000 M
6 LBL 1
7 L X-39.948 R0 F480 M
8 CC X-39.999 Y-14.999
9 C X-24.000 Y-14.948 DR- R0 F480 M
10 L Y-67.550 R0 F480 M
11 CC X-29.989 Y-67.402
12 C X-28.764 Y-73.266 DR- R0 F480 M
13 CC X-29.987 Y-67.551
14 C X-31.395 Y-73.224 DR- R0 F480 M
15 L X-96.226 Y-55.852 R0 F480 M
16 CC X-82.996 Y-6.635
17 C X-107.938 Y-51.079 DR- R0 F480 M
18 CC X-173.791 Y-167.883
19 C X-139.105 Y-38.358 DR+ R0 F480 M
20 L X-183.903 Y-26.355 R0 F480 M
21 CC X-182.200 Y-20.601
22 C X-182.355 Y-14.602 DR- R0 F480 M
23 L X-120.695 R0 F480 M
24 CC X-120.631 Y-13.352
25 C X-119.951 Y-14.402 DR+ R0 F480 M
26 L X-94.595 Y0.237 R0 F480 M
27 CC X-91.680 Y-4.947
28 C X-91.748 Y1.000 DR- R0 F480 M
29 L X-50.000 R0 F480 M
30 LBL 0
31 L Z-5.000 R0 F1000 M
32 CALL LBL 1
33 L Z-8.000 R0 F1000 M
34 CALL LBL 1
35 L Z-10.000 R0 F1000 M
36 CALL LBL 1
37 L Z6.000 R0 F8000 M5
38 END PGM MyJob MM
UPDATED on first post

I think this could be useful
Post Reply