Hello Guest it is December 07, 2024, 12:41:13 PM

Author Topic: Move Z Axis without reWritting the whole code again  (Read 2155 times)

0 Members and 1 Guest are viewing this topic.

Move Z Axis without reWritting the whole code again
« on: February 17, 2015, 05:02:09 PM »
Ok, before we start.... i seem to be having a brain fart.(been away from the machine working for 18Months).
The below code has to have the z axis increment as I machine through a piece of Aluminium
I have chased through my notes from over 8 years and for love nor money i cant remember how to add to the Z axis after each complete cycle.

Also if any one could advise, i am losing a couple of steps in random places while doing the radius cuts, any thoughts?

G0 G49 G40  G17 G80 G50 G90
(Drill 12mm Holes x 3)
G1 X0 Y0 F500
G1 X-59 Y-3.67
M06
G1 X-59 Y81.2
M06
G1 X4.2 Y58.9
M06
(I need to Loop from Here to increment the z axis for multiple cuts)
g41 p2
G1 X0 Y0 F250
G1 X-49.8 Y0
G1 X-49.8 Y-8
G2 X-68.45 Y-7.3732 I-11 J5.1681 F250
(The X center point is -9.0858 Y center point is 5.1681 )
G3 X-66.2352 Y-2.6517 I-4.7874 J4.7264
(The X center point is -4.7874 Y center point is 4.7264 )
G1 X-66.2352 Y-2.6517 F250
G1 X-66.2352 Y71.4879
G3 X-71.4879 Y79.33 I-6 J1.4 F250
(The X center point is -6.4323 Y center point is 1.4812 )
G2 X-48.5 Y86.2677 I12.1951 J1.5675
(The X center point is 12.1951 Y center point is 1.5675 )
G1 X-48.5 Y86.2677 F250
G1 X-48.5 Y73.5993
G1 X-4.3 Y58.9443
G1 X-4.3 Y63.6
(G2 X8.932 Y47.8448 I8.9608 J-4.885)
G2 X8.932 Y49.5 I8.9608 J-4.885 F250
(The X center point is 8.9608 Y center point is -4.885 )
G1 X8.932 Y49.5 F250
G1 X-0 Y49.5
G1 X-0 Y-0
g40
G0X0Y0
M30 ( Stop and Reset)

Any Help would be greatly appreciated as wife reckons im losing it ;D
Re: Move Z Axis without reWritting the whole code again
« Reply #1 on: February 17, 2015, 05:55:07 PM »
http://www.machsupport.com/forum/index.php/topic,28272.0.html
Ok used this code (and Thank you to the owner)
what do you all think?

G0 G49 G40  G17 G80 G50 G90
(Drill 12mm Holes x 3)
G1 X0 Y0 F500
G1 X-59 Y-3.67
M06
G1 X-59 Y81.2
M06
G1 X4.2 Y58.9
M06

g41 p3

#10=[0]           (Parameter #10 starting value; will be used for stepping the Z axis in .2 increments)


M98 p1000 L30     (GoTo subroutine with label 1000, repeat routine L? times :-Divid Increments into total Move; The letter p precedes the 1000)

g40
G0X0Y0
M30 ( Stop and Reset)                        (Program end)       

(subroutine for Z Axis)

o1000           (Label 1000, indicated with a letter o, not number 0)
         
#10=[#10+.2]    (Increment parameter #10 by .2)
G1 Z#10 F50     (Z is now incremented by .2 because #10 has been increased after cutting action)
     

G1 X0 Y0 F500
G1 X-49.8 Y0
G1 X-49.8 Y-8
G2 X-68.45 Y-7.3732 I-11 J5.1681 F250
(The X center point is -9.0858 Y center point is 5.1681 )
G3 X-66.2352 Y-2.6517 I-4.7874 J4.7264
(The X center point is -4.7874 Y center point is 4.7264 )
G1 X-66.2352 Y-2.6517 F500
G1 X-66.2352 Y71.4879
G3 X-71.4879 Y79.33 I-6 J1.4 F250
(The X center point is -6.4323 Y center point is 1.4812 )
G2 X-48.5 Y86.2677 I12.1951 J1.5675
(The X center point is 12.1951 Y center point is 1.5675 )
G1 X-48.5 Y86.2677 F500
G1 X-48.5 Y73.5993
G1 X-4.3 Y58.9443
G1 X-4.3 Y63.6
(G2 X8.932 Y47.8448 I8.9608 J-4.885)
G2 X8.932 Y49.5 I8.9608 J-4.885 F250
(The X center point is 8.9608 Y center point is -4.885 )
G1 X8.932 Y49.5 F500
G1 X-0 Y49.5
G1 X-0 Y-0
M99