UCCNC postprocessor - change Z-cleareance height G53 from Z0 to Z20

UCCNC postprocessor - change Z-cleareance height G53 from Z0 to Z20

Anonymous
1,466 Views
12 Replies
Message 1 of 13

UCCNC postprocessor - change Z-cleareance height G53 from Z0 to Z20

Anonymous
Not applicable

Got a problem when using the UCCNC post processor in Fusion360..... when I'm setting "G53" instead of "cleareance height" it gives me a code line at the beginning of the gcode "G53 G0 Z0".

How can I change that to G53 G0 Z20 for example? I was searching through the code of the postprocessor but can't find it. My problem is that scratching over the material when moving from zero to the starting point of the very first drilling point.

If someone could help me out, where to find it, or even better, maybe change it for me with description where in the postprocessor code I could find the addition/change, I would appreciate a lot.

 

Thanks a lot in advance & greetings

0 Likes
Accepted solutions (1)
1,467 Views
12 Replies
Replies (12)
Message 2 of 13

AchimN
Community Manager
Community Manager

Search for the onOpen() function and add this code at the beginning of the function

  machineConfiguration.setRetractPlane(toPreciseUnit(20, MM));

 

 



Achim.N
Principal Technology Consultant
0 Likes
Message 3 of 13

engineguy
Mentor
Mentor

@Anonymous 

 

The reason you are getting the tool scraping along the top of the workpiece is because you have your CNC machine incorrectly setup, do not change the Post Processor, instead change the way that you have your CNC machine setup.

 

There are two Z0 settings in a CNC Machine, one is the Machine "Home" position which can be set either by the use of switches at the ends of the machine travels, these will be used as "Limit" switches when running code or as "Home" switches when you are in "Homing" mode, if you have no switches on your machine or your control software doesn`t allow dual use of the switches for both Home and Limit then you can jog your Z axis to a safe height and set that as the "Machine Z0", if you do that then when a G53 Z0 move is commanded in your code your machine will lift the Z axis up to that safe position.

 

The second Z0 is you "Part Z0" which is what you set when you "touch off" with your tool and that is the Z position that the Retract height in your code will lift from between operations and also the Z position that your Clearance height will lift from.

 

If you are not already setting up your machine this way then it may be time to get the Manual out 🙂 🙂 🙂

0 Likes
Message 4 of 13

Anonymous
Not applicable

I did, but can only find:

 

_zHome = machineConfiguration.getRetractPlane() != 0 ? machineConfiguration.getRetractPlane() : toPreciseUnit(0, MM);

 

And even, when I'm changing toPreciseUnit(0, MM); to toPreciseUnit(20, MM); ......it does nothing as if I haven't changed it.

0 Likes
Message 5 of 13

Anonymous
Not applicable

Okay I will try to sort that out.

 

Thanks in advance for the hint.

 

But how is it, that he is doing all clreareance height drives fine through the whole process, and doesn't do it at the very beginning (when going from zeroed centre-point to the beginning of the first drill). Seem's that there is something missing when generating the code.... like writing "G53 G0 Z20" or something like that at the beginning of the gcode). Shouldn't there be a line of code where it sends the machine to "Cleareance Height" like he does inbetween?

 

.....for example like here:

X48.855 Z-2.82
X48.832 Z-2.753
X48.824 Z-2.683
Z5. F500
Y-80.77
Z1. F166.7
Z-5.683
X48.832 Z-5.753 F250
X48.856 Z-5.82
X48.894 Z-5.88

 

 

By the way the code at the beginning looks like that:

 

(Absaugung 3mm Zust. schneller)
(T1 D=3.175 CR=0. - ZMIN=-18. - Schaftfraser)
G90
(When using Fusion 360 for Personal Use, the feedrate of)
(rapid moves is reduced to match the feedrate of cutting)
(moves, which can increase machining time. Unrestricted rapid)
(moves are available with a Fusion 360 Subscription.)

(2D-Kontur4)
T1 M6 (Schaftfraser D=3.175 3mm Flat Endmill)
S10000 M3
G64
G54
M8
G43 H1
G0 X48.824 Y-80.77
Z15.
G1 Z5. F500
Z4. F166.7
Z-2.683
X48.832 Z-2.753 F250
X48.856 Z-2.82
X48.894 Z-2.88
X48.944 Z-2.931
X49.004 Z-2.969
X49.071 Z-2.992
X49.142 Z-3.
X49.459
G3 X49.684 Y-80.677 I0. J0.317
X49.777 Y-80.452 I-0.225 J0.224
G1 X49.776 Y-79.989 F500

0 Likes
Message 6 of 13

engineguy
Mentor
Mentor

@Anonymous 

 

Yes, it would appear that the Post Processor that you are using has been modified and is not producing the correct code, which UCCNC Post Processor are you using? Is it the one for the Stepcraft CNC or the CNC Drive one ?

 

Can you attach it to your reply so it can be checked please.

 

Below is the code for a simple drilling operation from the lates versions of both the CNC Drive and the Stepcraft Post Processors, the code is correct and does have the G53 G0 Z0 line of code.

The G53 command is the "Home Machine" command, so if it has the Z0 after it then it send the cnc machine to the Z axis Home position that has been set in the CNC Control (UCCNC), what is shown below is what I would expect the Post Processor to output. Attached are the two Post Processors that I used to generate the code below. Try posting your Operations with either/both of them and let`s see what you get 🙂 🙂

Hope this is of some help 🙂

 

2929) (CNC DRIVE)
(T11 D=6. CR=0. TAPER=118deg - ZMIN=-6.803 - drill)
G90
G53 G0 Z0.

(Drill M6 Through)
T11 M6 (drill D=6.)
S3000 M3
G61
G54
M8
G43 H11
G0 X-40.221 Y-18.787
Z15.                              
Z5.
G98 G81 X-40.221 Y-18.787 Z-6.803 R5. F600
G80
Z15.
M9
M5
G53 G0 Z0.
M30

 

(2929) (STEPCRAFT)
(T11 D=6. CR=0. TAPER=118deg - ZMIN=-6.803 - drill)
G90
G53 G0 Z0.

(Drill M6 Through)
T11 M6 (drill D=6.)
S3000 M3
G61
G54
M8
G43 H11
G0 X-40.221 Y-18.787
Z15.
Z5.
G98 G81 X-40.221 Y-18.787 Z-6.803 R5. F600
G80
Z15.
M9
M5
G53 G0 Z0.
M30

Message 7 of 13

Anonymous
Not applicable

thanks for your fast answer,

 

I have used the UCCNC PP for Cnc-drive (attached to my first posting with my first questions). The thing with the G53 is clear now an it's okay for me so far and the output is correct like in your example.

 

But if you look at the second option of "safe retracts" in the UCCNC-PostProcessor settings in Fusion, there is (besides the G53) also an option with "Cleareance Hight" in the dropdown menu of the PP-settings under "safe retracts". And this doesn't change anything at the beginning of the code and so the first move from zeroed-Z  to the first drilling point goes straight over the material without lifting to cleareance hight before, what I would have expected it to do.

 

Any help with that point would be very much appreciated.

0 Likes
Message 8 of 13

engineguy
Mentor
Mentor
Accepted solution

@Anonymous 

 

Apologies for the delay responding, I think I have my head round this (Hopefully), there is no Z height on the G43 line of code, this is normally the total "Clearance" height which is made up of the "Retract Height" and the "Clearance Height" as set in the "Heights" tab of each Operation, so if you have set a Retract height of say 5mm and a Clearance height from the Retract of say 20mm the you will get a total clearance height of 25mm then the machine should move the Z axis to a position with the tip of the tool at 25mm above your stock.

I have modifed your Post Processor to output that Total Clearance value on the G43 line so carefully test it out, if I have it correct and the UCCNC Control recognizes that G43 line correctly you should be OK.

Doing it this way should mean that you have full control over your total clearance heights so it can be different for every operation, if you only want the clearance to be set to a height above the stock and not including the retract then just set the clearance to from "Stock Top" 🙂 🙂 🙂

Hope that made some sort of sense for you, sample code below  🙂 🙂 🙂

 

(2D Contour1)
T6 M6 (flat end mill D=6. 6mm Flat Endmill)
(6mm Flat End Mill)
S3500 M3
G64
G54
G43 Z25. H6
G0 X-17.6 Y-10.2
Z5.
G1 Z1. F30
Z-2.4

Message 9 of 13

Anonymous
Not applicable

@engineguy 

 

Perfect! Looks very good in the simulation of nc-corrector (maybe you know that software, if not it's worth to check it out (free))! I will check it on the machine tomorrow (here it is 2:45 am).

 

Would you mind to tell me, which line of code in the PP you have changed from what to what?

 

Thanks a lot in advance.

 

Really appreciating your help so far! Seems to be the solution!

0 Likes
Message 10 of 13

engineguy
Mentor
Mentor

@Anonymous 

 

The line of code modified is shown in the images below, first image is as your original PP, the second image is my modification, look at your original PP and then at the one I uploaded for you and you will see the difference easily, it is the G43 line that controls the first Z height. Yes, and it is 2.00am here also 🙂 🙂 🙂

UCCNC PP G43 Pre MOD.jpg

 

UCCNC PP G43-MOD.jpg

 

0 Likes
Message 11 of 13

Anonymous
Not applicable

 

@engineguy 

 

Perfect, thanks for that! Do I see that right that it's just deleting the middle part of the code line? Aaah no..... adding the middle part of the code line..... even more WOW that you know that much to write it yourself.... big respect!!!

Already 4:00 am here... which wasn't meant that it's too late for me to test it, but too late for my parents, who are sleeping right in the room over the CNC-machine and I don't want to let them fall out of their bed eventually 😉

 

But thank you very much again in advance.... I'm pretty sure it should solve my "problem".

 

Wish you a very good night!

0 Likes
Message 12 of 13

Anonymous
Not applicable

@engineguy 

 

Worked pretty well, also on the machine!

 

So thanks again for your very useful help and the time you spent on it!

 

Greetings again

Sash

0 Likes
Message 13 of 13

engineguy
Mentor
Mentor

@Anonymous 

 

Glad it is working for you and thanks for posting back, it is always good for others on the Forum to know when things work 🙂 🙂 🙂

Good luck going forward 🙂