Post Process Custom Drill Cycle?

Post Process Custom Drill Cycle?

alexwbakker
Enthusiast Enthusiast
3,002 Views
9 Replies
Message 1 of 10

Post Process Custom Drill Cycle?

alexwbakker
Enthusiast
Enthusiast

I have a CNC controlled knee mill, running Mach 3, that has the CNC control of the knee z axis, rather than the spindle. As a result, it does great cnc milling, but doesn't mess with my ability to use the machine as a manual drill press/hand tap, etc. 

 

What I'd like to do though is create a custom PP for this machine that can "take over" a drill cycle, and just locate the hole while I manual drill with the quill. Given that my feed rates on the knee are not very high, I think this will be much more convenient than trying to get drilling to work with the knee, and also will allow me to tap, since my spindle is controlled manually, not with Mach 4. 

 

So, is there a way to essentially take the drill cycle and replace it with a Gcode output that moves to the center of the first hole, waits for cycle start, and then moves to the next hole? Then i could start the G code, machine moves the table, I drill the hole, hit cycle start, machine moves the hole, etc. I could repeat for tapping or pre-drilling, etc. 

 

Thanks for any help you can offer!

0 Likes
3,003 Views
9 Replies
Replies (9)
Message 2 of 10

HughesTooling
Consultant
Consultant

I've done that on my Anilam machine. I use a dwell 0.0 to make the machine pause and wait for the start button, is there something similar in Mach4? Are you going to always manually drill, or do you want the post to do manual and automatic? Could just have 2 posts though.

 

Mark

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes
Message 3 of 10

alexwbakker
Enthusiast
Enthusiast

That would work - I'd probably never use the standard drill cycle. (My max feed rate on the knee is about 6 IPM, so I avoid anything that might involve rapid retracts). Any pointers on how to modify the PP so that I can strip out the all the Z axis moves and insert the dwell codes?

 

Thanks!

0 Likes
Message 4 of 10

HughesTooling
Consultant
Consultant

Are you using a PC or mac? Easier if you're using a PC as there's an option on the post dialog to open the post processor. Just select open config and the post should open in your editor, save to a place on your hard drive not back to the generic folder.

Then look for something like this.

Capture4.PNG

Change the 81 to 00 for a rapid move and below after the comma add "G04 0.0" including the quotes or thinking about it "M0" might be a better idea.

 

Mark.

 

Test the post carefully and I'd better add this 

The accompanying advice and or non-standard post processor is provided as-is and without warranty of any kind, and usage is at the user’s own risk.

Do not put custom posts in the generic posts folder. Use the personal folder. or another location.

Fusion 360 CAM Personal Posts Folder Locations

_______________________________________________________________________________

Microsoft Windows:
%appdata%\Autodesk\Fusion 360 CAM\Posts

Mac / Apple / OSX:
/Users/<user id>/Autodesk/Fusion 360 CAM/Posts

 

 

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes
Message 5 of 10

alexwbakker
Enthusiast
Enthusiast

Well, I gave that a try, here's what the block looks like now inside the Mach3 PP, modified per your suggestions. 

 

function onCyclePoint(x, y, z) {
  if (!isSameDirection(getRotation().forward, new Vector(0, 0, 1))) {
    expandCyclePoint(x, y, z);
    return;
  }
  if (isFirstCyclePoint()) {
    repositionToCycleClearance(cycle, x, y, z);
    
    // return to initial Z which is clearance plane and set absolute mode

    var F = cycle.feedrate;
    var P = !cycle.dwell ? 0 : cycle.dwell; // in seconds

    switch (cycleType) {
    case "drilling":
      writeBlock(
        gRetractModal.format(98), gCycleModal.format(00),
        getCommonCycle(x, y, "M0"),
        feedOutput.format(F)
      );
      break;

but, I just get ".failed" appended to my post processors. unfortunately, the PP file says "view the log file" but does not indicate which one, and fusion writes a *lot* of log files. It does not appear to be in any of the normal fusion diagnostics log...huh. 

 

I've attached the latest .failed file just so you can see. It does write an initializing block, but doesn't get any further. 

 

Thank you for the help, Mark!

0 Likes
Message 6 of 10

johnswetz1982
Advisor
Advisor

I think you were supposed to do this,
switch (cycleType) {
    case "drilling":
      writeBlock(
        gRetractModal.format(98), gCycleModal.format(0),
        getCommonCycle(x, y, "M0"),feedOutput.format(F), "M00"
      );
      break;

 Adding the "M0" where you had it was probably what was giving you your error.

 

Message 7 of 10

alexwbakker
Enthusiast
Enthusiast

So, I made your suggested changes, and I can now get the code to post, but, the code is odd. It will move to the first hole and issue and M00, but, then it just lists all the other coordinates in one giant string of rapids. Do I need to do something to the later blocks to issue the M00 between each hole?  I think we’re close here. 

 

 

0 Likes
Message 8 of 10

johnswetz1982
Advisor
Advisor

That was just a clarification of what Huges was trying to get across. Perhaps @HughesTooling would know?

Message 9 of 10

daniel_lyall
Mentor
Mentor

Try  01 it is Optional program stop  


Win10 pro | 16 GB ram | 4 GB graphics Quadro K2200 | Intel(R) 8Xeon(R) CPU E5-1620 v3 @ 3.50GHz 3.50 GHz

Daniel Lyall
The Big Boss
Mach3 User
My Websight, Daniels Wheelchair Customisations.
Facebook | Twitter | LinkedIn

0 Likes
Message 10 of 10

HughesTooling
Consultant
Consultant

Sorry should have looked closer, the drill cycle is setup on the first call then all other calls are passed to the end of the function.

I haven't had time to test this but I think it should work. Added a check for the cycle type and output m01 if drilling. Codes also below for copy paste.

Clipboard02.png

 

  // 2nd through nth cycle point
  } else {
    if (cycleExpanded) {
      expandCyclePoint(x, y, z);
    } else {
      if (!xyzFormat.areDifferent(x, xOutput.getCurrent()) &&
          !xyzFormat.areDifferent(y, yOutput.getCurrent()) &&
          !xyzFormat.areDifferent(z, zOutput.getCurrent())) {
        switch (gPlaneModal.getCurrent()) {
        case 17: // XY
          xOutput.reset(); // at least one axis is required
          break;
        case 18: // ZX
          zOutput.reset(); // at least one axis is required
          break;
        case 19: // YZ
          yOutput.reset(); // at least one axis is required
          break;
        }
      }
      if (incrementalMode) { // set current position to retract height
        setCyclePosition(cycle.retract);
      }
		if(cycleType == "drilling") {
			writeBlock(xOutput.format(x), yOutput.format(y), "M0");
		}else {
			writeBlock(xOutput.format(x), yOutput.format(y));
		}
      if (incrementalMode) { // set current position to clearance height
        setCyclePosition(cycle.clearance);
      }
    }
  }
}

Mark

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes