Hello Guest it is December 13, 2024, 07:27:18 PM

Author Topic: command to home one axis only  (Read 3258 times)

0 Members and 1 Guest are viewing this topic.

command to home one axis only
« on: September 26, 2019, 06:37:13 AM »
Hello All - please help=
i have a setup on my mach 3 lathe which gives it 3 axis
I would like to home each axis by itself .
g28 homes all 3 axises
Is there acommand to home an individual axis
like saying " home the x axis" (dont do anything to the others)
Help is much appreciated
regards
Fred Evans
think of the trees-- use both sides of the computer paper

Offline RICH

*
  • *
  •  7,427 7,427
Re: command to home one axis only
« Reply #1 on: September 27, 2019, 05:44:17 AM »
g28 homes all 3 axises Is there acommand to home an individual axis like saying " home the x axis" (dont do anything to the others)


Fred,

G28 by itself in Mach3 provides for  movement  without axis definitions resulting in a transverse move to machine zero. As noted in Mach definitions, the intermediate point is the current point and only one movement is made when no axis words are given.  One must be careful in it's use since G90, G91, and additionally Fixture Offsets can affect the resulting machine movements when G28 is commanded.

To home an individual axis, say X axis, add axis definition to the G28 command for example:

G28 X0.0 - if a G54 / work offset exists and you are away from the exact offset value then you will have two movements. IE; it will first go to the intermediate value ( the work offset value ) and then go to X axis machine zero.

G28 X0.0 – if G54 exists and you are at the exact offset value then you will have one movement ie; since your at the intermediate value there is no need to move to it so one move only to the X axis machine zero.

G28 X0.0 – if no offset exists there is no intermediate movement and the axis just goes to X axis machine zero.

G91 G28 X0.0 – there is no movement since mode is changed to incremental and the request is for zero movement

G28 – only one movement back to machine zero irrelevant if there is a work offset

Take some time and try the G28 along with axis definitions and see note the movements that occur.
Try G28 X1.0 for example and see what happens!


RICH
Re: command to home one axis only
« Reply #2 on: September 27, 2019, 08:09:01 AM »
Thanks Rich for the information.
Please help me debug the piece of code herewith
% --SETUP STRING (INITIALIZATION)------
M5   ( stop spindle rotation)
g18    (select xz plane)
g21   (set feed units to mm)
%G20   
g61   ( switch on exact stop mode)
g40   (cancel radius compensation)
g80   (cancel motion modes and any canned cycles)
g90   (absolute distance mode)
g95   (use feed per rev)
f 0.2   (feed .2 mm per rev for plastic)
s 1000   (1500 for plastic -different for steel)
g91 g28  X0
g91 g28  Z0  (machine home itself rapid BEFORE spindle start)
G01
M3   (REMEMBER TO START SPINDLE AFTER HOME)
%   (------ initialization complete)
#1=58           (starting dia of stock x axis)
#2=25           (finishing dia of stock)
#3=-25          (length of cut on stock z end)
#4=2       (depth of cut taken on diameter)
#5=[#1-#2]  (Material to removed --diameter)      (#5=30)
#6=[#5/#4]  ( number of cuts to take on diameter)   (#6=15)

g91 g28  X0
g91 g28  Z0  (machine home itself rapid BEFORE spindle start)


%%% (start of block- machine the diameter---)
g0 z1
g0 x[#1+5]   (fast park to z start)      (X=80)
m98 p1 l#6    (goto subroutine 1 and repeat #6 times)
g01 z[[#3]-.5]


I am using
>g91 g28  X0
>g91 g28  Z0  (machine home itself rapid BEFORE spindle start)
>G01
to retract the tool ---first retract the x axis then retract the z axis

(I am doing this twice for safety sake)

the command following the second time is
g0 z1
on this command i get a limit switch hit [/b][/u] ??

( I dont know if it is nessessary to "cancel " the " g91 g28" command so
I put a g01 command in the hope that it would cancel g91 )

Please have a look at the code and make any comments about what I am doing wrong

many many thanks
Fred From South Africa
think of the trees-- use both sides of the computer paper
Re: command to home one axis only
« Reply #3 on: September 30, 2019, 04:00:56 AM »
Hello Rich-
the problem is solved!!
I changed the g01  to g90 and now it is working
thanks

fred
think of the trees-- use both sides of the computer paper