Setting a tool change position in Fusion

Setting a tool change position in Fusion

jeremyah6364
Enthusiast Enthusiast
8,259 Views
22 Replies
Message 1 of 23

Setting a tool change position in Fusion

jeremyah6364
Enthusiast
Enthusiast

Hi, I have a very large part to do one my Fadal 4020 with 28" Z travel. It will be mounted on my A axis fixture. The only problem that I will run into is that my tool change position is too low for part clearance. I need the z to come up to (G28 G91 Z4), then the A axis to go to A0, then go to (G53 X-19 Y9) Before executing a tool change. After a tool change, I need the Z to come back up to (G28 G91 Z4) again before going back into the cut. How would I edit the post processor to do this? Thanks!

0 Likes
8,260 Views
22 Replies
Replies (22)
Message 2 of 23

LibertyMachine
Mentor
Mentor

Could you post a short snippet of code to show exactly what you want on each line? doesn't need to be anything more that the toolchange call, the first position move and height offset call, as well as the end of the tool at the optional stop section. 

 

Stock Fadal post? You mentioned "A" axis, so you possibly have a modified post. Could you attach it here so we are both looking at the same information


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
0 Likes
Message 3 of 23

jeremyah6364
Enthusiast
Enthusiast

Yes, stock post.

 

 


N20 G28 G91 Z0. //I want this to be Z4, Then go to X-19 and Y9 before calling T9

(DRILL9)
N25 M9
N30 T9 M6

//after a tool change, I want the Z to go back up to Z4 before going back to the part. This is needed for part clearance.
N35 S1500 M3
N40 G4 P120
N45 E1
N50 M8
N60 G90 G0 X-7. Y3.6825
N65 G43 Z-2.4 H9
N75 Z-2.8

 

 

 

 

0 Likes
Message 4 of 23

LibertyMachine
Mentor
Mentor

I've made the edits to the post, which is attached. You can download the post and use it, or review the following info and make the changes yourself. Either way, make sure you aren't modifying and saving the generic to the Generic Post folder. Next update it will be wiped out and replaced with the stock generic post. You will want to perform a "Save As" and save it into a folder independent of Fusion, or save it to the cloud when you are happy with the changes

 

Search for this line:

 // retract to safe plane
    retracted = true;
    if (properties.format == 1) {
      writeBlock(gAbsIncModal.format(90), gMotionModal.format(0), hFormat.format(0), "Z" + xyzFormat.format(0)); // retract
    } else {
      writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(0)); // retract
      // writeBlock(gFormat.format(28)); // retract
    }
    zOutput.reset();

And insert a line to make it now read this:  (inserted line is in red)

 // retract to safe plane
    retracted = true;
    if (properties.format == 1) {
      writeBlock(gAbsIncModal.format(90), gMotionModal.format(0), hFormat.format(0), "Z" + xyzFormat.format(0)); // retract
    } else {
      writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(4.)); // retract
	  writeBlock(gMotionModal.format(0), gAbsIncModal.format(90), "X" + xyzFormat.format(-19.),"Y" + xyzFormat.format(9.));
      // writeBlock(gFormat.format(28)); // retract
    }
    zOutput.reset();
  }

Next we want to find the tool change section:

writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6));
    if (tool.comment) {
      writeComment(tool.comment);
    }
    var showToolZMin = false;
    if (showToolZMin) {
      if (is3D()) {
        var numberOfSections = getNumberOfSections();
        var zRange = currentSection.getGlobalZRange();
        var number = tool.number;
        for (var i = currentSection.getId() + 1; i < numberOfSections; ++i) {
          var section = getSection(i);
          if (section.getTool().number != number) {
            break;
          }
          zRange.expandToRange(section.getGlobalZRange());
        }
        writeComment(localize("ZMIN") + "=" + zRange.getMinimum());
      }
    }

And tack on this snippet of code after all of it, so it looks like this (again, added line is in red

writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6));
    if (tool.comment) {
      writeComment(tool.comment);
    }
    var showToolZMin = false;
    if (showToolZMin) {
      if (is3D()) {
        var numberOfSections = getNumberOfSections();
        var zRange = currentSection.getGlobalZRange();
        var number = tool.number;
        for (var i = currentSection.getId() + 1; i < numberOfSections; ++i) {
          var section = getSection(i);
          if (section.getTool().number != number) {
            break;
          }
          zRange.expandToRange(section.getGlobalZRange());
        }
        writeComment(localize("ZMIN") + "=" + zRange.getMinimum());
      }
    }

	 writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(4.)); // retract

I'd prefer to set this up as a user property that you can toggle between the two methods. I'll mess around with that as time allows during the weekend.


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
0 Likes
Message 5 of 23

LibertyMachine
Mentor
Mentor

And here is the post with the user variable in it. When you get to the post dialog, you can toggle a box to either post out your regular lines of code for G28, or you can set it to "yes" and it will put out the new code.

 

Test CAREFULLY!!!!!!

screenshot_38.png


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
0 Likes
Message 6 of 23

jeremyah6364
Enthusiast
Enthusiast

That worked to an extent.

The Z goes up to 4 every time it is told to. But it immidiately goes back to Z0.

 

N10 G90 G94 G17
N15 G20
N20 G28 G91 Z4. //Z goes up to 4
N25 G0 G90 X-19. Y9. //Z goes right back down to 0

(2D CONTOUR14)
N30 M9
N35 T5 M6
N40 G28 G91 Z4. //Z goes up to 4
N45 T3
N50 S8000 M3
N55 G4 P23
N60 E3
N65 A0.
N70 M8
N80 G90 G0 G43 X3.195 Y-3.95 Z0.6 H5 //I need X and Y to go to their positions first, then have Z go down. Right now, they all move together after a tool change.

 

I attached the post that I am using. It is a generic post, but I just turned on multiaxis.

 

 

0 Likes
Message 7 of 23

LibertyMachine
Mentor
Mentor

I'm not a Fadal guy at all, so I'm trying to follow. You're saying that the line:

G90 X-19. Y9. also is making the Z axis move? I don't understand how, as that axis is not being called out.


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
0 Likes
Message 8 of 23

jeremyah6364
Enthusiast
Enthusiast

Yes, It is making a Z move in that line as well. That didn't make any sense to me either.

0 Likes
Message 9 of 23

LibertyMachine
Mentor
Mentor

In an effort to test things out without getting into the post processor, could you manually insert an H0 into the G28 G91 Z4. code and see if it continues to move on the G90 X-19. line. I'm wondering if it's picking up the tool offset in it's move. The H0 "should" clear that out

 

How are you setting up your work offsets and tool offsets?


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
0 Likes
Message 10 of 23

jeremyah6364
Enthusiast
Enthusiast

Turns out I was wrong about when it was going back down. I ran the program in single block and noticed it. When it calls G28 G91 Z4, It does two things. First, it goes up to Z4. Then, it immediately goes back to Z0. All on the same line. I tried this with the H0 in it as well, and it made no difference.

0 Likes
Message 11 of 23

Steinwerks
Mentor
Mentor

Try inputting an E0 on that G28 G91 Z4. line.

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 12 of 23

jeremyah6364
Enthusiast
Enthusiast

That crashed it due to a Z axis overtravel. It ignored the soft limit and went to high.

0 Likes
Message 13 of 23

Steinwerks
Mentor
Mentor

Ugh I was afraid of that. How are you setting your work offsets? Can you take a photo of your tool and work offset screens and share it here?

 

I program (and sometimes run) a Fadal but we use Format 1 so there are no Z offsets for the work offsets, it's all derived from the tool offsets (large negative numbers) that we touch off the workpiece or fixture. Since G28 is non-modal I wonder if it's re-initializing your offsets directly after the G28 line, even though there's no Z move programmed.

 

Here's a chunk of code before a toolchange that we use in Format 1:

 

Z0.875 <-- clearance height
M5
M9
H0 Z0. <-- rapids to machine zero since the tool offset has been "unloaded"

(#18 CARBIDE DRILL)
M1 
T3 M6 

 

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 14 of 23

Steinwerks
Mentor
Mentor

Coincidentally which control are you using? CNC88, 88HS or the MP32? If either of the latter, what happens when you use G53 instead of G28 G91? Our VMC2216 uses the 88HS control and G53 works just fine.

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 15 of 23

jeremyah6364
Enthusiast
Enthusiast

If I replace

G28 G91 Z4

with:

G0 G17 G40 G70 G80 G90 H0 Z4.

it works

 

Now, I have to figure out how to make it Move to the specified X and Y position after a tool change before moving the Z down. 

I am running a 32MP

0 Likes
Message 16 of 23

Steinwerks
Mentor
Mentor

What about just G0 H0 Z4.?

 

The rest of it should be inconsequential since there's nothing in that line aside from the H value that should affect Z whatsoever. The rest looks like a safety line. FWIW the MP32 should run the exact same code as the 88HS. The 88 is a little quirky, or so I've heard anyway.

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 17 of 23

jeremyah6364
Enthusiast
Enthusiast

I didn't mess with that line because it worked. So, I ran a program. I'll post the summary of it here, but I'll attach the entire file if you want to look at it.

 

 

Here's how it started. Everything worked flawlessly.

%
O1001
(T1 D=4. CR=0. - FACE MILL)
N10 G90 G94 G17
N15 G20
N20 G0 G17 G40 G70 G80 G90 H0 Z3.
N25 G0 G90 X-19. Y9.

(FACE2)
N30 M9
N35 T1 M6
N40 G0 G17 G40 G70 G80 G90 H0 Z3.
N45 S5000 M3
N50 G4 P36
N55 E1
N60 A-278.
N65 M8
N75 G90 G0 G43 X5.6 Y-6.1971 Z10.0835 H1
N80 Z9.8537
N85 G18 G3 X5.2 Z9.4537 I-0.4 F100.

 

Then, it got to the end ot the first op and went to A0 to set up for the second op:

 

N875 G1 X-5. F60.
N880 G18 G3 X-5.4 Z8.8687 K0.4 F100.
N885 G0 Z10.0835
N890 G17
N895 G0 G17 G40 G70 G80 G90 H0 Z3. //Here's where things went wrong. This line acted like it was never called. It never went to Z3. Instead, it skipped right to N925. It never went to A0. Luckily, I had my hand on the slide hold ready for something to go wrong. 
N900 G0 G90 X-19. Y9.

(FACE1)
N905 A0.
N910 M8
N920 G0 G43 X5.6 Y-7.7923 Z6.475 H1
N925 Z6.2397
N930 G18 G3 X5.2 Z5.8397 I-0.4 F60.
N935 G1 X5.
N940 X-5.
N945 G17 G2 Y-4.8706 J1.4608

 

Anybody have any insights as to what happened?

0 Likes
Message 18 of 23

Steinwerks
Mentor
Mentor

I see that you posted that on Practical Machinist, which is probably a better place to ask than here. Lots of Fadal guys on the forum over there. I wish I could help with the behavior but I can't see why it would do that.

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 19 of 23

jeremyah6364
Enthusiast
Enthusiast

Update: It's the G0 G17 G40 G70 G80 G90 H0 Z3. line. Which is weird because that exact line is recommended by Fadal. Anyway, that line changes the home offset to equal the offset of E1(G54) and comes down to the fixture offset Z3.

0 Likes
Message 20 of 23

LibertyMachine
Mentor
Mentor

SO, what exactly do you need to see in the code, a line by line would be helpful


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
0 Likes