Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: vypham2 on June 25, 2012, 03:02:19 PM
-
Hi,
Does anyone know if there's a subroutine to program the machine to move in a continuous way, but then moving the machine down the z axis as it continues in the same general x, y axis locations?
Is there a way to manipulate the subroutine function where I can do this without copying and pasting the gcodes 123908123x ?
If you're confused this is what i have down as my gcodes:
g28
g0 x51 z50
g0 x51 y-2 z50
g0 x0 y-2 z50
g0 x0 y-4 z50
.... etc ...
g0 x0 y0 z50 m47 (this starts it back to the first line)
now I want to move down my z axis a little bit and repeat the same thing..
anyone?
V
-
#1=3 (Set For #of Steps Down)
#2=-.50 (Zstep)
#3=0 (ZDepth)
#3=#2
G0 G21 G90 G17 G50 G80 F1
G0 Z1
G28
G0 X0Y0
M98 P1 L#1
G0 Z 1
M30
o1
G1 Z#3 F50
G1 x51 F200
G1 X51 y-2
G1 x0 y-2
G1 x0 y0
#3= [#3+ #2]
M99
%
-
Okay got it to work thanks!
A bit confused with the gcodes though because I'm still really new at this. So my machine right now is moving up in the z axis, if I want it to move downwards in the negative direction would I change #1?
V
-
If I want it to start from z=+20 in its axis and then move down #2=.5 how do i do that?
I've been playing with it and changed g0 z1---> g0 z20 but it doesn't move down and just repeats the same line without moving downwards in the z negative direction
-
Hello,
I would usually do it like this (just a thought)
G0 G21 G90 G17 G50 G80 F100
G0 Z100
G0 X0 Y0
G0 Z50 (Z point to start from)
M98 P1 L10 (Set L For No. of Steps)
M30
G0 Z100
M99
%
O1
G91 G1 Z-0.5 F50 (incremental Z step)
G90 (back to absolute)
G1 x51 F200
G1 X51 y-2
G1 x0 y-2
G1 x0 y0
M99
%
be careful using G91.
this should work too.
#1=10 (#1 = No. of Steps Down)
#2=-0.50 (Z step)
#3=20 (Z position to start from)
G0 G21 G90 G17 G50 G80 F1000
G28
G0 X0 Y0
G0 Z50
M98 P1 L#1
G0 Z 1
M30
o1
G1 Z#3 F50
G1 x51 F200
G1 X51 y-2
G1 x0 y-2
G1 x0 y0
#3= [#3+ #2]
M99
%
Alex
-
Sorry, little mistake!
this should be correct.
G0 G21 G90 G17 G50 G80 F100
G0 Z100 ( save Z )
G0 X0 Y0
G0 Z50 (Z point to start from)
M98 P1 L10 (Set L For No. of Steps)
G0 Z100 ( save Z )
M30
%
O1
G91 G1 Z-0.5 F50 (incremental Z step)
G90 (back to absolute)
G1 x51 F200
G1 X51 y-2
G1 x0 y-2
G1 x0 y0
M99
%
-
Thanks Alex this worked too!
Is there a way you can rewind the machine to make it go backwards starting from g1 x0 y-2 while changing the zaxis to -.5 increments instead of having it start over from g0 x0 y0?
V
-
Hi,
I think you mean this
G0 G21 G90 G17 G50 G80 F100
G0 Z100 ( save Z )
G0 X0 Y0
G0 Z50 (Z point to start from)
M98 P1 L10 (Set L For No. of Steps)
G0 Z100 ( save Z )
M30
%
O1
G91 G1 Z-0.5 F50 (incremental Z step)
G90 (back to absolute)
G1 X51 F200
G1 y-2
G1 X0
G91 G1 Z-0.5 F50 (incremental Z step)
G90 (back to absolute)
G1 X51 F200
G1 Y0
G1 X0
M99
%
Alex
-
Thanks Alex! This helped so much :)
Regards,
V
-
No problem, happy to be done. ;D
Alex