Hello Guest it is January 26, 2020, 11:10:49 PM

Author Topic: Newbie with Mach 4 Lathe - again - canned turning cycle bug ???  (Read 216 times)

0 Members and 1 Guest are viewing this topic.

Newbie with Mach 4 Lathe - again - canned turning cycle bug ???
« on: October 23, 2019, 06:25:52 PM »
I am learning g code. I was hopeful that the canned turning; and threading (not there yet) would work without having to tweak teh g code. If I use one of the canned turning cycles, during each pass (-Z), the tool keeps ending up further -Z. When done it does not return to Xi, Zi. My inspection of the gcode makes me think it should. And the DRO says it is at Xi, Zi. But the tool is not. I am about to run it line by line in MDI.

After I heavily modified the g code and run it, the tool returns to Xi, Zi. What am I missing? It would be nice not having to modify the canned cycle g code.

Both sets of g code below.

N0 (Machine type - MachMotion Lathe Canned Cycles)
N5 (Filename: C:\Mach4Hobby\GcodeFiles\turncycle21.tap)
N10 (Generated on 10/23/2019 at 6:22:03 PM)
N15 G00 G40 G54 G64 G80 G90.1 G99 G18 G20 (Safe Start Block)
N20 %


N25 %
N30 (Starting Gcode for Turning Cycle: TurnCycle-1)
N35 ([Xi, Zi] = [0.75, 0.0]; [Xf, Zf] = [0.625, -0.5]; Z- Direction; OD)
N40 G50 S2750 (Spindle Speed Cap)
N45 (Roughing)
N50 G00 G40 G54 G64 G80 G90.1 G99 G18 G20 (Safe Start Block)
N55 %


N60 %
N65 T0101 (Tool Change)
N70 G99 (Feed per Revolution)
N75 G96 S180 (Constant Surface Speed)
N80 M03 (Spindle Forward)
N85 M09
N90 G00 X0.9500 Z0.1000  (Rapid move to Clearance Height)
N95 G01 X0.7000 F0.0100  (Cut in on X-Axis)
N100 G01 Z-0.4950 F0.0100  (Cut in on Z-Axis)
N105 G01 X0.7500 Z-0.4950 F0.0100  (Spring Pass)
N110 G00 X0.9500 Z-0.3950  (Pull out to Retreat)
N115 G00 Z0.1000  (Pull out to Clearance)
N120 G00 X0.9000 Z0.1000  (Rapid move to Clearance Height)
N125 G01 X0.6500 F0.0100  (Cut in on X-Axis)
N130 G01 Z-0.4950 F0.0100  (Cut in on Z-Axis)
N135 G01 X0.7000 Z-0.4950 F0.0100  (Spring Pass)
N140 G00 X0.9000 Z-0.3950  (Pull out to Retreat)
N145 G00 Z0.1000  (Pull out to Clearance)
N150 G00 X0.8500 Z0.1000  (Rapid move to Clearance Height)
N155 G01 X0.6350 F0.0100  (Cut in on X-Axis)
N160 G01 Z-0.4950 F0.0100  (Cut in on Z-Axis)
N165 G01 X0.6500 Z-0.4950 F0.0100  (Spring Pass)
N170 G00 X0.8500 Z-0.3950  (Pull out to Retreat)
N175 G00 Z0.1000  (Pull out to Clearance)
N180 (Finishing)
N185 G00 G40 G54 G64 G80 G90.1 G99 G18 G20 (Safe Start Block)
N190 %


N195 %
N200 T0101 (Tool Change)
N205 G99 (Feed per Revolution)
N210 G96 S180 (Constant Surface Speed)
N215 M03 (Spindle Forward)
N220 M09
N225 G00 X0.825 Z0.1 (Rapid to start)
N230 G01 X0.625 Z0.0 (Feed to start)
N235 G01 X0.6250 Z0.0000 F0.0100 (Finish Line Move)
N240 G01 X0.6250 Z-0.5000 F0.0100 (Finish Adjust Move)
N245 G01 X0.7500 Z-0.5000 F0.0100 (Finish Line Move)
N250 G00 X0.9500 Z0.1000  (Return to clearance)
N255 (End Gcode for Turning Cycle: TurnCycle-1)

N260 %
N265 M09
N270 M05
N275 M30
N280 %
N285 (End Gcode file)
N290 %


N5 (Filename: C:\Mach4Hobby\GcodeFiles\turncycle2.1.tap)
N180 (Turning)
N181 G00 (Rapid Move) (Safe Start Block)
N182 G40 (Tool cutter compensation off [radius comp.])
N183 G54 (Work coordinate system [1st Workpiece])
N184 G64 (Best speed path)
N185 G80 (Cancel canned cycle)
N186 G90.1 (Absolute programming IJK [type B and C systems])
N187 G99 (Feedrate per Revolution)
N188 G18 (Select X-Z plane)
N189 G20 (Program coordinates are inches)
N190 %


N199 %
N200 T0101 (Tool Change)
N205 G99 (Feed per Revolution)
N210 G96 S180 (Constant Surface Speed)
N215 M03 (Spindle Forward)
N220 M09 (Coolant OFF)
N225 G01 X0.950 Z0.1 F0.0500 (Feed to clearance)
N229 G01 X0.800 F0.0100 (Feed to start)
N240 G01 X0.700
N241 Z-0.5000 F0.0100 (Turn)
N242 G01 X0.800 Z-0.5000 F0.0100 (feed +X along shoulder)
N243 G01 Z0.1 (To Z start)
N244 G01 X0.650
N245 Z-0.5000 F0.0100 (Turn)
N246 G01 X0.800 Z-0.5000 F0.0100 (feed +X along shoulder)
N247 G01 Z0.1 (To Z start)
N248 G01 X0.600
N249 Z-0.5000 F0.0100 (Turn)
N250 G01 X0.800 Z-0.5000 F0.0100 (feed +X along shoulder)
N251 G01 Z0.1 (To Z start)
N252 G01 X0.550
N253 Z-0.5000 F0.0100 (Turn)
N254 G01 X0.800 Z-0.5000 F0.0100 (feed +X along shoulder)
N255 G01 Z0.1 (To Z start)
N256 G01 X0.5000
N257 Z-0.5000 F0.0100 (Turn)
N258 G01 X0.800 Z-0.5000 F0.0100 (feed +X along shoulder)
N259 G01 Z0.1 (To Z start)
N260 G01 X0.475
N261 Z-0.5000 F0.0030 (Turn)
N262 G01 X0.800 Z-0.5000 F0.0100 (feed +X along shoulder)
N263 G01 X0.9500 Z0.1000 F0.0500 (Return to clearance)
N264 (End Gcode for Turning Cycle: TurnCycle-1)

N268 %
N269 M09 (Coolant OFF)
N270 M05 (Spindle Stop)
N275 M30 (End of Program, Rewind and Reset Modes)
N280 %
N285 (End Gcode file)
N290 %

Thanks,

Dale




Re: Newbie with Mach 4 Lathe - again - canned turning cycle bug ???
« Reply #1 on: October 25, 2019, 06:23:17 PM »
I finally got what I wanted. Gcode I wrote is below. Canned cycles are a bust to me. I tried a threading cycle and it just keeps moving the tool post to the chuck during each cycle. Just like the turning cycle. Almost crashed into the chuck. Threading cycle from mach motion is also included. I sure would like to figure out why my tool keeps stepping towards the chuck.

WORKS
N10 (Filename: C:\Mach4Hobby\GcodeFiles\turncycle3.0.tap)
N15 (Turning)
N20 G00 (Rapid Move) (Safe Start Block)
N25 G40 (Tool cutter compensation off [radius comp.])
N30 G54 (Work coordinate system [1st Workpiece])
N35 G64 (Best speed path)
N40 G80 (Cancel canned cycle)
N45 G90.1 (Absolute programming IJK [type B and C systems])
N50 G99 (Feedrate per Revolution)
N55 G18 (Select X-Z plane)
N60 G20 (Program coordinates are inches)
 
N70 T0101  (Tool Change)
N75 G99  (Feed per Revolution)
N80 G96 S180  (Constant Surface Speed)
N85 M03  (Spindle Forward)
N90 M09  (Coolant OFF)     

N100 G01 X 0.950 Z 0.100 F0.0500 (Feed to clearance)
N105 G01 X 0.800 Z -0.100 F0.0100 (Feed to start)
 
N110 G01 X 0.775   F0.0100 (travel in; -X)
N115 G01 Z -0.775   F0.0100 (Turn)
N120 G01 X 0.800   F0.0100 (feed +X along shoulder)
N125 G01 Z 0.100   F0.0500 (To Z start)
N130 G01 X 0.750   F0.0100 (travel in; -X)
N135 G01 Z -0.775   F0.0100 (Turn)
N140 G01 X 0.800   F0.0100 (feed +X along shoulder)
N145 G01 Z 0.100   F0.0500 (To Z start)
N150 G01 X 0.725   F0.0100 (travel in; -X)
N155 G01 Z -0.775   F0.0100 (Turn)
N160 G01 X 0.800   F0.0100 (feed +X along shoulder)
N165 G01 Z 0.100   F0.0500 (To Z start)
N170 G01 X 0.700   F0.0100 (travel in; -X)
N175 G01 Z -0.775   F0.0100 (Turn)
N180 G01 X 0.800   F0.0100 (feed +X along shoulder)
N185 G01 Z 0.100   F0.0500 (To Z start)
N190 G01 X 0.675   F0.0100 (travel in; -X)
N195 G01 Z -0.775   F0.0100 (Turn)
N200 G01 X 0.800   F0.0100 (feed +X along shoulder)
N205 G01 Z 0.100   F0.0500 (To Z start)
N210 G01 X 0.650   F0.0100 (travel in; -X)
N215 G01 Z -0.775   F0.0100 (Turn)
N220 G01 X 0.800   F0.0100 (feed +X along shoulder)
N225 G01 Z 0.100   F0.0500 (To Z start)
N230 G01 X 0.625   F0.0100 (travel in; -X)
N235 G01 Z -0.775   F0.0100 (Turn)
N240 G01 X 0.800   F0.0100 (feed +X along shoulder)
N245 G01 Z 0.100   F0.0500 (To Z start)
N250 G01 X 0.600   F0.0100 (travel in; -X)
N255 G01 Z -0.775   F0.0100 (Turn)
N260 G01 X 0.800   F0.0100 (feed +X along shoulder)
N265 G01 Z 0.100   F0.0500 (To Z start)
N270 G01 X 0.575   F0.0100 (travel in; -X)
N275 G01 Z -0.775   F0.0100 (Turn)
N280 G01 X 0.800   F0.0100 (feed +X along shoulder)
N285 G01 Z 0.100   F0.0500 (To Z start)
N290 G01 X 0.550   F0.0100 (travel in; -X)
N295 G01 Z -0.775   F0.0100 (Turn)
N300 G01 X 0.800   F0.0100 (feed +X along shoulder)
N305 G01 Z 0.100   F0.0500 (To Z start)
N310 G01 X 0.525   F0.0100 (travel in; -X)
N315 G01 Z -0.775   F0.0100 (Turn)
N320 G01 X 0.800   F0.0100 (feed +X along shoulder)
N325 G01 Z 0.100   F0.0500 (To Z start)
N330 G01 X 0.500   F0.0100 (travel in; -X)
N335 G01 Z -0.775   F0.0100 (Turn)
N340 G01 X 0.800   F0.0100 (feed +X along shoulder)
N345 G01 Z 0.100   F0.0500 (To Z start)
N350 G01 X 0.475   F0.0100 (travel in; -X)
N355 G01 Z -0.775   F0.0100 (Turn)
N360 G01 X 0.800   F0.0100 (feed +X along shoulder)
N365 G01 Z 0.100   F0.0500 (To Z start)
N370 G01 X 0.450   F0.0100 (travel in; -X)
N375 G01 Z -0.775   F0.0100 (Turn)
N380 G01 X 0.800   F0.0100 (feed +X along shoulder)
N385 G01 Z 0.100   F0.0500 (To Z start)
N390 G01 X 0.425   F0.0100 (travel in; -X)
N395 G01 Z -0.775   F0.0100 (Turn)
N400 G01 X 0.800   F0.0100 (feed +X along shoulder)
N405 G01 Z 0.100   F0.0500 (To Z start)
N410 G01 X 0.400   F0.0100 (travel in; -X)
N415 G01 Z -0.775   F0.0100 (Turn)
N420 G01 X 0.800   F0.0100 (feed +X along shoulder)
N425 G01 Z 0.100   F0.0500 (To Z start)
N430 G01 X 0.386   F0.0050 (travel in; -X)
N435 G01 Z -0.775   F0.0100 (Turn)
N440 G01 X 0.800   F0.0100 (feed +X along shoulder)
N445 G01 Z 0.100   F0.0500 (To Z start)
N450 G01 X 0.361   F0.0100 (travel in; -X)
N455 G01 Z -0.630   F0.0100 (Turn)
N460 G01 X 0.800   F0.0100 (feed +X along shoulder)
N465 G01 Z 0.100   F0.0500 (To Z start)
N470 G01 X 0.336   F0.0100 (travel in; -X)
N475 G01 Z -0.630   F0.0100 (Turn)
N480 G01 X 0.800   F0.0100 (feed +X along shoulder)
N485 G01 Z 0.100   F0.0500 (To Z start) 
N470 G01 X 0.311   F0.0100 (travel in; -X) 
N475 G01 Z -0.630   F0.0100 (Turn) 
N480 G01 X 0.800   F0.0100 (feed +X along shoulder) 
N485 G01 Z 0.100   F0.0500 (To Z start) 
N470 G01 X 0.286   F0.0100 (travel in; -X) 
N475 G01 Z -0.630   F0.0100 (Turn) 
N480 G01 X 0.800   F0.0100 (feed +X along shoulder) 
N485 G01 Z 0.100   F0.0500 (To Z start) 
N490 G01 X 0.276   F0.0050 (travel in; -X) 
N495 G01 Z -0.630   F0.0100 (Turn) 
N500 G01 X 0.800   F0.0100 (feed +X along shoulder) 
N505 G01 Z 0.100   F0.0500 (To Z start) 
 
N595 M09 (Coolant OFF)       
N600 M05 (Spindle Stop)       
N605 M30 (End of Program, Rewind and Reset Modes)       

N615 (End Gcode file)       


N0 (Machine type - MachMotion Lathe Canned Cycles)
N5 (Filename: C:\Mach4Hobby\GcodeFiles\threadcycle1.0.tap)
N10 (Generated on 10/25/2019 at 5:52:21 PM)
N15 G00 G40 G54 G64 G80 G90.1 G99 G18 G20 (Safe Start Block)
N20 %

STEPS THE TOOL TO THE CHUCK ALMOST RESULTING IN CRASH
N25 %
N30 (Starting Gcode for Threading Cycle: ThreadingCycle-0)
N35 G50 S2750 (Spindle Speed Cap)
N40 G00 G40 G54 G64 G80 G90.1 G99 G18 G20 (Safe Start Block)
N45 %


N50 %
N55 T0404 (Tool Change)
N60 G99 (Feed per Revolution)
N65 G97 S300 (Constant Speed)
N70 M03 (Spindle Forward)
N75 M09
N80 G00 X0.5860 Z0.1000  (Rapid move to Clearance Height)
N85 G76 P021055 Q0.002 R0.001 K1
N90 G76 X0.3402 Z-0.63 R0.0 P0.0229 Q0.003 F0.0357
N95 G80
N100 (End Gcode for Threading Cycle: ThreadingCycle-0)

N105 %
N110 M09
N115 M05
N120 M30
N125 %
N130 (End Gcode file)
N135 %
Re: Newbie with Mach 4 Lathe - again - canned turning cycle bug ???
« Reply #2 on: October 25, 2019, 06:24:58 PM »
And I guess another tidbit of info. When I change back to T0101, and jog teh tool to Z0, the DRO shows some bogus number off more than an inch. I would have expected it to come back to 0.