Mach3 Turn Post Help

Mach3 Turn Post Help

bensbenz
Advocate Advocate
3,617 Views
11 Replies
Message 1 of 12

Mach3 Turn Post Help

bensbenz
Advocate
Advocate
Let me preface that I don't have a huge amount of experience with post processors or running a cnc lathe. I do run my mill with Fusion360 and it works great. Until there is turning support, I have been bumming some computer time at a friends CNC shop to do the toolpaths for my little "tinker toy" as he calls it, but I have run into some trouble with the post processor.

I have searched the forums and found that I could use the Fanuc Generic turning post and with no modification I get strange arcs\circles where there should be angles. I was able to open the post file and change: allowedCircularPlanes = 0 and that solved that issue. The next issue I have is threading, when I run the machine it just cuts like its turning. I think this could be because of the limits\config of the machine, but I am able to thread using the built in wizards. So I guess the question is if anyone has a post or can help me modify my post to allow for G76 threading?

Here is the output of the threading wizard that works on my machine:


G0 G40 G18 G80 G50 G90
G00 G53 X1 Z0.3
T606M6
G00  X0.525
G00 Z0
G00 X0.5
M03 S776
M08
G76 X0.4625 Z-0.5 Q1 P0.05 J0.006 L30 H0.022 I29 C0.025 B0.0001 T0
M9
M5
M30


Here is the output I get from the Fanuc Generic post:


%
O0015
N10 G98 G18
N11 G20
N12 G50 S6000
N13 G28 U0.

(TURNING THREAD1)
N14 T0606
N15 G54
N16 G98
N17 G97 S776 M3
N18 G0 X1.15 Z0.2337
N19 G0 Z0.0337
N20 X0.95
N21 G1 X0.7293 F5.
N22 Z-0.487
N23 X0.801 Z-0.5229
N24 G0 X0.95
N25 Z0.0337
N26 G1 X0.7105 F5.
N27 Z-0.4776
N28 X0.801 Z-0.5229
N29 G0 X0.95
N30 Z0.0337
N31 G1 X0.6918 F5.
N32 Z-0.4682
N33 X0.801 Z-0.5229
N34 G0 X0.95
N35 Z0.0337
N36 G1 X0.673 F5.
N37 Z-0.4588
N38 X0.801 Z-0.5229
N39 G0 X0.95
N40 Z0.0337
N41 G1 X0.673 F5.
N42 Z-0.4588
N43 X0.801 Z-0.5229
N44 G0 X0.95
N45 X1.15
N46 Z0.2337

N47 G28 U0. W0.
N48 M30
%


I don't know enough about the code, but is this type of threading relying on IPR?
*Edit: I did find a post on here called: Fanuc Doosan in computer.cps that says it added the cycle threading but I get an error when I try to run the code that says: "Missing X (End X) on turn cycle.

Any help would be much appreciated.

Thanks
0 Likes
3,618 Views
11 Replies
Replies (11)
Message 2 of 12

hai.cao
Alumni
Alumni
Hi bensbenz,

Please check the "Use cycle" in the CAM software for your threading operation.  "Use cycle" is at the bottom of the passes tab.  Please see attached screenshot.

Please let us know the result.
0 Likes
Message 3 of 12

bensbenz
Advocate
Advocate
Hi Hai,

So I had tried that before, but just for kicks I did it again. Mach doesn't complain about the code, but it doesn't work. My tool path in the screen looks like the attached screen shot, on the machine it leads the tool in one time, then retracts and never actually cuts anything or make attempts at multiple passes ect.

The code from HSM is this:


%
O0999
N10 G98 G18
N11 G20
N12 G50 S776
N13 G28 U0.

(TURNING THREAD1)
N14 T0606
N15 G54
N16 G98
N17 G97 S776 M3
N18 G0 X1.15 Z0.2337
N19 G0 Z-0.0063
N20 X0.95
N21 G17
N22 G92 X0.7248 Z-0.2463 F0.03571
N24 X0.7016
N26 X0.6784
N28 X0.6552
N31 G0 X1.15 Z-0.0063
N32 Z0.2337

N33 G28 U0. W0.
N34 M30
%
0 Likes
Message 4 of 12

Laurens-3DTechDraw
Mentor
Mentor
We should use G32 thats easiesd to implemend.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


0 Likes
Message 5 of 12

bensbenz
Advocate
Advocate
I have been reading through a mach3 threading manual I found and it does state that either G76 or G32 can be used and that G32 gives more control. If G32 is something that can be implemented and its easy to do, that would be awesome.
0 Likes
Message 6 of 12

AchimN
Community Manager
Community Manager
Try this one and test it please. Don´t enable "useCycle" to get G32 output.


Achim.N
Principal Technology Consultant
0 Likes
Message 7 of 12

bensbenz
Advocate
Advocate
Achim,

I tried that out and my machine does a similar thing, where the z feed is wrong, too slow and it just plows through the material instead of threading. Is it possible I have something wrong in the Speed & Feed section?

Thanks,
Benjamin
0 Likes
Message 8 of 12

bensbenz
Advocate
Advocate
I found this page: http://okumacnc.blogspot.com/2011/06/how-to-make-thread-program-in-g32-fanuc.html

According to it the code should look something like this:


( OD THREAD )
N1 G28 U0.0 W0.0 ;        ( Home Position )
N2 G00 T0101 ;              ( Number One Tool Selection )
N3 G97 S500 M03;            ( Spindle Speed And Direction Selection )
N4 G00  X22.0 Z1.0 M08; ( safe position  & coolant on )
N5 G00 X18.50      ;        ( Thread cutting point X Axis )
N6 G32  Z-4.00 F1.5;      ( Thread cutting 4MM length )
N7 G00 X22.0;                ( Position Return )
N8 M09 M05 ;                  ( coolant off , spindle stop )
N9 G28 U0.0 W0.0;          ( Home Position Return )
M30;                                ( Program End )
%


But the code I am getting looks like this:


(TURNING THREAD1)
N14 T0606
N15 G54
N16 G99
N17 G97 S600 M3
N18 G0 X1.15 Z0.2337
N19 G0 Z-0.0063
N20 X0.95
N21 G1 X0.7248 F0.01497
N22 G32 Z-0.2463 F0.0014
N23 X0.8408 F0.0014
N24 G0 X0.95
N25 Z-0.0063
N26 G1 X0.7016 F0.01497
N27 G32 Z-0.2463 F0.0014
N28 X0.8408 F0.0014
N29 G0 X0.95
N30 Z-0.0063
N31 G1 X0.6784 F0.01497
N32 G32 Z-0.2463 F0.0014
N33 X0.8408 F0.0014
N34 G0 X0.95
N35 Z-0.0063
N36 G1 X0.6552 F0.01497
N37 G32 Z-0.2463 F0.0014
N38 X0.8408 F0.0014
N39 G0 X0.95
N40 X1.15
N41 Z0.2337

N42 G28 U0. W0.
N43 M30


I am not sure but are these lines screwed up?


N26 G1 X0.7016 F0.01497
N27 G32 Z-0.2463 F0.0014


I am trying to cut 28 TPI, or a pitch of 0.03571, which is what I have in the box. So shouldn't it post something more like this?:


N26 G1 X0.7016 F5.0
N27 G32 Z-0.2463 F0.03571


I hope I am helping not making this more confusing with too much google.

Thanks
0 Likes
Message 9 of 12

bensbenz
Advocate
Advocate
Did some more digging, found this line in the post:


var threadsPerInch = ((unit == MM) ? 1.0 : 25.4)/threadPitch; // per mm for metric


I switched it to:


var threadsPerInch = ((unit == MM) ? 25.4 : 1.0)/threadPitch; // per mm for metric


An now I get something that works:


N26 G1 X0.7248 F2.
N27 G32 Z-0.2457 F0.0357
N28 X0.7944 F0.0357


I am not sure if that screws up people that use metric, but if I input 1.5mm into the thread pitch box it just converts it to inches anyways. Perhaps that's because I'm using imperial units in the document? Either way that makes it work for me, maybe the experts can fix it correctly.
0 Likes
Message 10 of 12

Laurens-3DTechDraw
Mentor
Mentor
This is a setting in the post to force inches or mm.
So now you forced it to inches which is good for yo. 😉

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


0 Likes
Message 11 of 12

bensbenz
Advocate
Advocate
Makes me wonder if that wasn't my issue to begin with... I will have to try the original post tonight. They should have some sort of option box for this setting.
0 Likes
Message 12 of 12

AchimN
Community Manager
Community Manager
That was my fault sorry, catched an old piece of code by mistake.
This code should do it, I´ve also updated the post I uploaded before:
  if (isSpeedFeedSynchronizationActive()) {
    resetFeed = true;
    var threadPitch = getParameter("operation:threadPitch");
    var threadsPerInch = 1.0/threadPitch; // per mm for metric
    writeBlock(gMotionModal.format(32), xOutput.format(_x), yOutput.format(_y), zOutput.format(_z), pitchOutput.format(1/threadsPerInch));
    return;
  }


Achim.N
Principal Technology Consultant
0 Likes