Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Steelbarz on December 07, 2022, 09:53:24 AM

Title: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Steelbarz on December 07, 2022, 09:53:24 AM
The problem  I am having is that the stock Mach4 post processor for milling is outputting the following code at the beginning, moving from the XYZ zero position to the first part of the operation without moving to a safe height 1st.  Here are the 1st few lines of output G-code:

(1001)
(T8 D=6.35 CR=0. - ZMIN=-7. - FLAT END MILL)
G90 G94 G91.1 G40 G49 G17
G21
(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.)
G28 G91 Z0.
G90

(2D CONTOUR1)
M5
T8 M6
S2000 M3
G54
M8
G0 X38.032 Y157.831
G43 Z15. H8
G1 Z5. F50.
Z-6.365 F17.



I think the highlighted line shout be written before the line above it.  What is happening is it moves the tool to the G0 X38.032 Y157.831 1st dragging the tool across the surface, often hitting things I don't want it to.  If it moved to G43 Z15. H8  1st, this wouldn't happen.  



I know I can edit the gcode after the fact, but that seems like a thing that could easily be fixed in the post-processor.  Unfortunately, I don't know what to change to make that happen.



Like this:

G28 G91 Z0.
G90

(2D CONTOUR1)
M5
T8 M6
S2000 M3
G54
M8
G43 Z15. H8

G0 X38.032 Y157.831

G1 Z5. F50.
Z-6.365 F17.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: exadas on December 07, 2022, 12:26:40 PM
The code is correct i tried it.
Above your line (2D contour)
 G28 G91 Z0
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Steelbarz on December 07, 2022, 01:24:52 PM
Then How do I get it to go to, say z15 before moving the tool, not after? As I understand G28 is basically "start at zero" which is what I want but I don't want the tool to move until it has moved the z-axis up to clear any work holding etc.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Cbyrdtopper on December 07, 2022, 01:38:20 PM
G91 G28 Z0. will move to what the machine thinks is 0.00.  Again... what the MACHINE Z 0.00 position is. 
If you don't have home switches to reference your machine, then you need to select the "No" option on safe retracts in the post properties.

The G43 Z15. H8 applies the tool offset to tool 8 and then moves to the Work Coordinate Position Z 15.00.  So whatever work offset you are in, it will move to Z 15.00 with the tool height offset applied. 
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Steelbarz on December 07, 2022, 01:47:13 PM
I don't have the homing switches set up (I'm making brackets for them now and where the problem became evident) so maybe I'll 3d print them and it will work.  BUT the option you recommend does not exist in the post-processor and I've tried all 3.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Cbyrdtopper on December 07, 2022, 01:51:27 PM
That'd be awesome, 3D print some brackets!
Also, that is the Mach3 Post Processor.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Steelbarz on December 07, 2022, 01:55:35 PM
It says its the Mach 3 post-processor in the script BUT it is the Mach4 one that I downloaded I think the person ho posted it forgot to change the text I've double-checked.  Also, Mach 3 has the same issue with my router, but that's another topic.  Why won't the z move to a safe position before moving across the parts I can't 3d print everything that's why I built a CNC mill.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Cbyrdtopper on December 07, 2022, 01:59:25 PM
I would be certain that you have the correct post processor.  I have never had mine say mach3 since I've been using the mach4 post processor.

I'll attach one that I've modified pretty heavily.  Use at your own risk, but it is current.

Also, to answer your question from an earlier post, the Z move after the X and Y move is there because it assumes that the machine is at a safe plane.  I'm not sure why your machine isn't at a safe position since you have the "Clearance Plane" option selected.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Steelbarz on December 07, 2022, 03:04:45 PM
I downloaded a new copy of the Mach4 post-processor.  and here is what I found.  It still does it.  Moves the X&Y before the Z goes up to the clearance height.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Cbyrdtopper on December 07, 2022, 03:13:40 PM
You'll need to get some home switches on your machine.  At least the Z to operate safely. 
However, you can get it to work without dragging across your parts if you set your Safe Retracts to "NO" and make sure that, when you start, the tool is above the part. 
The code posted Safe Retracts set to NO will move to X and Y and then apply the Tool Length Offset with the G43 line. 
At this point it is on the operator (you) to make sure it is starting safely above the part.  Without any reference, the machine doesn't know where it's "safe position" is.  So it is on you to define that for the machine with some preparatory moves manually. 
Alternatively, you could home the machine in place at a safe Z position way above the part.  You would have to make sure your Z Work Offset is updated after each "homing".
Try posting the code with no retracts and make sure your tool is above the part.
If you have subsequent tools that are longer, you will probably have to jog the Z up to change the tool; in which case you are ensuring that it is high enough to start as well.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Steelbarz on December 07, 2022, 03:21:46 PM
Sorry but this is all before it even gets into Mach 4.... so homing has nothing to do with it.  I've tried all the options in the pulldown for safe retracts and it always writes code to move X and Y before the Z

it always outputs:
(2D CONTOUR1)
M5
T8 M6
S2000 M3
G54.1 P48
M8
G0 X38.032 Y157.831
G43 Z15. H8

Mach4 hasn't seen it yet so it has nothing to do with homing (Yes I have the z limits installed and the x and y are being put on now, but still not the problem)
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Stuart on December 07, 2022, 03:46:41 PM
you need to edit the actual post file in fusion 360. look at the pic you posted see the little pencil icon at the end of the mach4mill line click that and make the changes there

best go to the fusion 360 forums and ask there what to alter and where
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Steelbarz on December 07, 2022, 03:51:03 PM
I can't be the only one having this issue.  I am asking where to edit the post here because this is where the post (artsoft) came from.  And yes my original question was in fact where to edit the post-processor.  Oddly enough on one post it actually came out right but I have been unable to recreate that senario
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Cbyrdtopper on December 07, 2022, 03:52:43 PM
That is correct.  That is the code it should be putting out.  It is the safest code it can put out; it assumes that it is at a safe Z position. 

At the start of the code it moves to the safe z (G28, G30, or NO (you move it manually to safe z)).
If you don't have a referenced Z Axis then you cannot use G28 or G30; otherwise the machine will go to whatever the machine thinks is Machine Coordinate Z 0.0; which could be 6 inches above the part or 2 inches into the part if it hasn't been referenced.  Without a Z Reference, it is operating blind for a safe move.  Once you set a work offset, it knows where the work offset Z should be; but it has no idea where a "Safe Position" is. 

So, like I mentioned in my last post, the Safe Z completely up to you, the operator. 
If you Select NO Safe retracts and move the Z up to a safe point before you start your program, it will work like you want it to. 
It will be at a safe Z to begin with and THEN it will move X Y and then apply the Z Offset. 


Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Cbyrdtopper on December 07, 2022, 03:56:26 PM
Although it isn't the safe way to run G Code, here is the post processor you are looking for.
DISCLAIMER!  You need to be sure the Z is safe before moving X and Y. 

Like Stuart mentioned, you can edit it with the little pencil Icon. 
I make notes when I change things as well, so you can look and see where I moved the line in question.  CB are my initials, and I usually put a date with it as well.
Title: Re: Mach4 Post Processor Fusion360 Editing to move Z to safe 1st
Post by: Steelbarz on December 07, 2022, 04:29:50 PM
Although it isn't the safe way to run G Code, here is the post processor you are looking for.
DISCLAIMER!  You need to be sure the Z is safe before moving X and Y. 

Like Stuart mentioned, you can edit it with the little pencil Icon. 
I make notes when I change things as well, so you can look and see where I moved the line in question.  CB are my initials, and I usually put a date with it as well.


THANK YOU!!!!!

(2D CONTOUR1)
M5
T8 M6
S2000 M3
G59 P54
M8
G0 G43 Z15. H8
X38.032 Y157.831