Hello Guest it is March 28, 2024, 07:37:08 AM

Author Topic: Subroutine configuration, Z axis help  (Read 4106 times)

0 Members and 1 Guest are viewing this topic.

Subroutine configuration, Z axis help
« 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

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Subroutine configuration, Z axis help
« Reply #1 on: June 25, 2012, 09:52:47 PM »
#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
%
Re: Subroutine configuration, Z axis help
« Reply #2 on: June 26, 2012, 11:06:20 AM »
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
« Last Edit: June 26, 2012, 11:14:56 AM by vypham2 »
Re: Subroutine configuration, Z axis help
« Reply #3 on: June 26, 2012, 11:53:33 AM »
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
Re: Subroutine configuration, Z axis help
« Reply #4 on: June 26, 2012, 01:01:00 PM »
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
Re: Subroutine configuration, Z axis help
« Reply #5 on: June 26, 2012, 01:10:45 PM »
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
%
Re: Subroutine configuration, Z axis help
« Reply #6 on: June 26, 2012, 02:36:19 PM »
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
Re: Subroutine configuration, Z axis help
« Reply #7 on: June 26, 2012, 04:50:29 PM »
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
Re: Subroutine configuration, Z axis help
« Reply #8 on: June 26, 2012, 05:05:34 PM »
Thanks Alex! This helped so much :)

Regards,
V
Re: Subroutine configuration, Z axis help
« Reply #9 on: June 26, 2012, 05:26:27 PM »
No problem, happy to be done.  ;D

Alex