Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Fred_evans on March 10, 2012, 10:19:07 AM

Title: home sequence
Post by: Fred_evans on March 10, 2012, 10:19:07 AM
Hello All

Mack turn on a lathe

When I do g28 for the machine to "go to home"
the first movement is on the z axis and this causes a crash into the rear tool holder
How can i code for a home (g28) to home the z axis first
it need to go z home before x home

regards

fred evans
Title: Re: home sequence
Post by: RICH on March 11, 2012, 05:53:58 AM
Have a read of the Lathe manual page 10-13.
G28 Zx.x
G28 Zx.x Xx.x
G28 .1 searches for the home switches.

RICH
Title: Re: home sequence
Post by: Fred_evans on March 11, 2012, 07:51:14 AM
Thanks rich - will do
Title: Re: home sequence
Post by: Fred_evans on March 11, 2012, 09:14:52 AM
Hello Rich

When You say "the lathe manual " do you mean
"Using Mach3 Turn" If so mine finishes on section 10.12

regards

fred

Title: Re: home sequence
Post by: RICH on March 11, 2012, 10:07:24 AM
Yes. Download it again since  since it goes goes beyond 10-12 to section 15.
RICH
Title: Re: home sequence
Post by: Overloaded on March 11, 2012, 10:23:18 AM
Hi Guys,
 It's actually Chapter 10.7.8  & 10.7.9 in the index. Page is 10-13.
G28 doesnt work as described for me. I don't think it ever did.
Russ
Title: Re: home sequence
Post by: RICH on March 11, 2012, 10:32:35 AM
Russ,
G28 and it should go home?
G28 X0.0 and it will home the x
G28 Z0.0 and it will home the z
G28 X0.0 Z0.0 and it will home both in a combination move
G28 X?.? Z?.? and it will home via the intermittant point defined

How's it suppose to work?
RICh
Title: Re: home sequence
Post by: RICH on March 11, 2012, 10:40:38 AM
Russ,
let me re-phase.....how was it described to you?
RICH
Title: Re: home sequence
Post by: Overloaded on March 11, 2012, 10:42:59 AM
Hi RICH,
 My assumption according to attached:

If my HOME pos is Z0,X0 and I am currently at X2,Z-2 and want the tool to go to Z-1 before going home, program G28 Z-1 and there should be 2 moves.
Z will go to -1 THEN both axis will (should) go to HOME. I only get the first move.

G28.1 will (should) actually run the HOMING sequence for the specified axis.

Russ
Title: Re: home sequence
Post by: RICH on March 11, 2012, 10:53:12 AM
Ahh...ok now i know what you mean. One can read to the exact letter though and as it's stated you would need both an
X & Z location. Not sure how other controllers work and will do a quick look at the Smid book to see what he say's even though it may not be relavant.
Don't remember if it works the same in mill.....

RICH
Title: Re: home sequence
Post by: RICH on March 11, 2012, 10:59:02 AM
hmm.... 5 pages on G28 in the book, :) have a cup of coffee if you intend on waiting :D
RICH
Title: Re: home sequence
Post by: Overloaded on March 11, 2012, 11:02:34 AM
OK,
BOTH axis words are required and it works as intended althought it says "All axis words are optional".
Title: Re: home sequence
Post by: Overloaded on March 11, 2012, 11:14:34 AM
  If my HOME pos is Z0,X0 and I am currently at X2,Z-2 and want the tool to go to Z-1 before going home, program G28 Z-1 and there should be 2 moves.
Z will go to -1 THEN both axis will (should) go to HOME. I only get the first move.

Program  G28 Z-1 X2 and it does as described in the manual. An axis with NO move should not be required, imo and interpretation of the manual.

Used longer moves to clearly see in sim.
Z-30 X-2  =  Current pos.
G28 Z-2 X-2

Attached is from MILL GCodes.
Title: Re: home sequence
Post by: Overloaded on March 11, 2012, 11:35:29 AM
Russ,
G28 and it should go home?
G28 X0.0 and it will home the x
G28 Z0.0 and it will home the z
G28 X0.0 Z0.0 and it will home both in a combination move
G28 X?.? Z?.? and it will home via the intermittant point defined

How's it suppose to work?
RICh

G28 and it should go home?                         Agreed, to the pre-programmed HOME position
G28 X0.0 and it will home the x    Disagree, X should go to the pre-programmed X0 position, followed by Z going to the pre-programmed Z0 position, no actual HOMING will take place.

G28 Z0.0 and it will home the z    Disagree,  (reverse of above)

G28 X0.0 Z0.0 and it will home both in a combination move   Disagree, G28 does not HOME (Ref) an axis, just sends to the pre-programmed HOME pos via X0,Z0 in this case. (X0,Z0 may or may not be the actual HOME pos.)

G28 X?.? Z?.? and it will home via the intermittant point defined  AGREED
Title: Re: home sequence
Post by: RICH on March 11, 2012, 11:59:25 AM
Still reading Russ,
G90 & G91 come into play and also if you have a part offset it makes a difference.
Maybe you will want to have breakfast also....... and yes what you have posted is true since its all about an intermediate step.
My bad on the description....  ;)
RICH


Title: Re: home sequence
Post by: RICH on March 11, 2012, 12:37:52 PM
Maybe you better eat dinner....... ;D
RICH
Title: Re: home sequence
Post by: Overloaded on March 11, 2012, 06:02:57 PM
 :D
Goin' out to supper now, be back later tonight.
 ;D

Thanks,
Russ
 :)
Title: Re: home sequence
Post by: RICH on March 11, 2012, 09:49:22 PM
A few comments on wording which is important.
A machine has extreme travel limits. A point within the limits must be defined to the controller ( Mach3) so that all other movements can be associated. That point is machine zero and as such is known, fixed and defined. Home is just a point within the limits and it can be anywhere, but, home is usually machine zero. So home is used interchangeably with machine zero many times. Referencing is used to describe the condition where one has moved to some point and done something to tell the controller that the current position is machine zero or home. Homing can be done automatically, using the MDI, or manually and used to describe the motion of returning to machine zero. Fixture offsets are defined locations away from the home position. Fixture offsets are not to be confused with tool offsets. So an offset is just some distance from a point and needs to be always clarified. So much for the play on words!   

G30 - behaves the same as G28 and is unique as compared to G28. G28 is associated with the primary machine zero. G30 allows for machine movements to additional machine zero's and requires use of other parameters along with the G30 command like P or whatever. Mach's G30 use is not defined in the manuals other than "or just use G30".  So there is more to G30 and it's dialect of use may vary from manufacturer to manufacturer and can even be proprietary.

G28 intended use was to provide movement to an intermediate point before continuing on it's way to machine zero. It provided for eliminating some coding in a program and best example of use is to avoid an interference in the tools path to machine zero. G28 by itself is an incomplete command to some controllers but Mach ( and some other controllers ) provide 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, where as in Smid’s definition, one would need to add the current point / axis words as part of the G28 definition.  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. So it’s always interesting to see how different controllers use the commands but in the end the important definition is the one for the controller that is being used. 

Smid reference says:
G28 X0.0  “will only send the X axis to the X axis zero reference position”.
But as Smid points out the axis values associated with the G28 should always indicate an intermediate point and at least one axis must be specified.

In MACH Lathe:
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
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

All of the above is with tool zero / master tool but it’s worth going through the above with a call for a different tool. May as well try them with additional offsets.

RICH
Title: Re: home sequence
Post by: BR549 on March 11, 2012, 10:24:03 PM
Rich you have the G28/G30 wrong for MACH3 it is NOT like Fanuc.

G28 takes you to the defined HOME value as set in config. An offset from the home switches
G30 takes you to the Machine Home as defined by the switches or you setting it manually

Just a thought, (;-) TP
Title: Re: home sequence
Post by: BR549 on March 11, 2012, 10:40:13 PM
Also the command structure between the G28 and G30 is different.

(;-) TP
Title: Re: home sequence
Post by: Overloaded on March 11, 2012, 11:25:43 PM
Nice work guys !
The intermediate programmed point is in Program coords, then shifts to the absolute for the G28 home pos., gotcha.
Another wrong assumption on my part, after a single axis int. move I expected BOTH axis to go HOME.  gotcha.
Much better now, thanks.
Russ

I agree with you, Rich on the word play. One can get confused.
This is the grip I have on it. 
 
I've come to know Referencing an axis and Homing and axis as one in the same.
The Referenced position and Home position can however be different positions in the same Machine coord system.
Go to Home (G28) should not be confused with the act of Homing. (other than it traverses to the Home pos.)
Go to Machine Home (G30) should not be confused with Referencing. (other than that it traverses to the Ref pos.)
Title: Re: home sequence
Post by: RICH on March 11, 2012, 11:36:39 PM
Terry,
Never used the G30 so just added some info on it from what I could find.
I would think that the majority of folks will never have need for it.
Have any other insight into Mach's definition and use?

So what's the best descriptive words if one dosen't use switches or soft limits?

RICH  
Title: Re: home sequence
Post by: Overloaded on March 11, 2012, 11:45:02 PM


So what's the best descriptive words if one dosen't use switches or soft limits?

RICH  


Here I go assuming again  ;D
I would jog the axis's to there extremes, just shy of crashing and mark the slides as mentioned in the manual. Set this as the REF pos.
Then set the SL accordingly anyway (just to protect the mach) and the G28 pos where ever you wish.
You have to of course locate the fixture/part as usual.
Just sumin',  ;) Thanks,
Russ :)

Title: Re: home sequence
Post by: RICH on March 11, 2012, 11:45:47 PM
Hey Russ,
The word play is a killer for sure and Smid dosen't even talk about homing but rather always refers to machine zero.
Then things get a little more complicated when you consider the implications of not having switches or whatever.
And just think, all we wanted to do is go home and have a nap! :D

RICH
Title: Re: home sequence
Post by: RICH on March 11, 2012, 11:55:56 PM
Russ,
No wonder I make machine=part=program and the code is all based on the end and center of the lathe stock equal
to zero also.
Of course that only works for  simple operations.  ;)
RICH
Title: Re: home sequence
Post by: Overloaded on March 12, 2012, 07:22:42 AM
Thanks for the assistance Rich, I guess G28 is fine and I was reading something into the somewhat vague description that wasn't really there.
I set the motor tuning way slow on a sim pc to clearly see the effects and have a pretty good grip on it now.

.... and there's the Home Off values (if used), yet another position.

G28 would be good to use as a TCP or Matl. load pos. Very quick and easy to add a button to the screen too.

Dear Fred, THANKS for the post ... and, sorry for the ramble.

Thanks Rich,
Russ
Title: Re: home sequence
Post by: BR549 on March 12, 2012, 11:54:26 AM
Do you want the short or long story(;-) ???

(;-) TP
Title: Re: home sequence
Post by: RICH on March 12, 2012, 12:03:57 PM
Do you want the short or long story
Whatever one you pick Terry would be fine with me, but the long story sounds more interesting.....  :D
RICH
Title: Re: home sequence
Post by: BR549 on March 12, 2012, 01:04:37 PM
OK with Mach3 ,

Machine Home (zero)
 Can be set by switches,
OR REhome Button if you have no switches,
OR is set by mach when you OPEN it to the current position
OR can be zeroed to a postion via CB
OR rumored to be settable via #vars 5161-5166 (untested as yet)

Moves to get to machine home,

G53 X0 Y0 Z0 ------- Makes a straight traverse run to Machine Zero

With G30 ALL axis go home
G30 --------------------- Makes a straight traverse move to machine zero
G30 Z0 ------------------Makes a single Z move to Zero THEN all AXIS make a straight traverse move to Machine zero
G30 Z0 X0--------------Makes a Straight traverse move to Z0 X0 then all axis makes a straight traverse move to machine zero
ETC,ETC

Local Home(G28), Is an offset from Machine ZERO.  With G28 without defined axis all axis goes home in the order of Z then all the rest. USED with a defined axis ONLY the defined axis goes home via the intermediate point.

It can be the same as Machine zero or different as defined

Moves to get to Local Home

G28 ----------------- Raises Z first then makes straight traverse moves in XY to Local Home(LH)
G28 Z-1 ------------ Single axis move to intermediate point(-1.000) and then goes to Z0. Z axis ONLY goes to LH
G28 Z0 X0 --------  ONLY the defined AXIS will go to LH UNDEFINED axis remain as is . Makes a straight traverse move in ZX to 0 then ZXmoves in a   straight traverse move to LH.
ETC,ETC

Part HOME ( Part Origin, X0Y0 Z0)

G0 Z0 X0Y0 ----------------- Makes a straight traverse RAPID move to Z0 X0Y0
G1 Z0 X0 Y0 ---------------- Makes a straight traverse FEERATE move to Z0 X0 Y0

Fixture Home  

G55 G0 Z0 X0 Y0  -------- Swithes the Fixture offset then goes to X0 Y0 Z0 as straight traverse move at rapid speed
G56 G1 Z0 X0 Y0 F100 --------- Swithes the fixture offset then goes to X0 Y0 Z0 as straight traverse move at feedrate speed



*************************************************

You will note that the G28/30 in MACH3 is backwards to FANUC . In the fanuc world the G30 local Homes can be set in the parameters AND there can be MANY etc;  G30 G30.1 G30.2 G30.3 etc,etc

Also the Axis calls in G28/30 are different from each other. In g28 you can call a single axis to home, in G30 ALL axis go home reguardless

Just a thought, (;-)TP
Title: Re: home sequence
Post by: RICH on March 12, 2012, 06:53:47 PM
Thanks Terry as the post is additive.
RICH
Title: Re: home sequence
Post by: Overloaded on March 13, 2012, 12:57:00 PM
Very good post TP ! Thanks also !

Hey Fred, I hope you got this sorted. Can you clarify your first post ?
Something just doesn't look right. ::) ???
Do you want "X" to go first ? If so, G28 X(Part coord that is = X Machine Zero) Z(current part coord pos) should do it.
Russ :)

Hello All

Mack turn on a lathe

When I do g28 for the machine to "go to home"
the first movement is on the z axis and this causes a crash into the rear tool holder
How can i code for a home (g28) to home the z axis first
it need to go z home before x home

regards

fred evans

Title: Re: home sequence
Post by: BR549 on March 13, 2012, 01:44:57 PM
IF you use a G28 X0 Y0 call then you get a straight traverse move (combined) to home. the X will NOT move first both move at the same time.

To get what you need (IF the G28 and G30 positions are the same) I would use

G30 X0

That will Home X first THEN home Z. That way you have Safe clearnance for all axis to travel.

Other wise you would need to do

G28 X0  (home X)
G28 Z0  (home Z)

Just a thought, (;-) TP
Title: Re: home sequence
Post by: Overloaded on March 13, 2012, 02:14:53 PM

G30 X0

That will Home X first THEN home Z. That way you have Safe clearnance for all axis to travel.


Hi TP,
 Using G30 X0 here first sends X to part 0, then X&Z simultaneously to home. Is that what you meant ?
Like your previous .... "G30 Z0 ------------------Makes a single Z move to Zero THEN all AXIS make a straight traverse move to Machine zero"


Also,
 G28 X0  (home X)
 G28 Z0  (home Z)   ...... does just as I posted earlier, the G30 is better though, much better.

Thanks,
Russ
Title: Re: home sequence
Post by: BR549 on March 13, 2012, 02:52:06 PM
HIYA RUSS you have it correct. (;-)

Now don't forget to note how  it reacts IF you are in G91 mode when you call it ???



(;-) TP
Title: Re: home sequence
Post by: Overloaded on March 13, 2012, 02:58:17 PM
ARGGGGHH.  :P
  I've learned enough for one day. ;)
Might have a play with it later ... out of curiousity ..
Thanks for the lesson TP.
 :)
Title: Re: home sequence
Post by: BR549 on March 13, 2012, 04:12:12 PM
ARRGH  You just test a section then write it all down. Then do a little more the next day and before 2-3 years pass you will have tested it all.

Then Mach4 comes out and you get to start over again (;-)

(;-) TP
Title: Re: home sequence
Post by: Overloaded on March 13, 2012, 04:50:05 PM
Double aarrrghhh,

Then Mach4 comes out and you get to start over again (;-)

I'll just wait. I hear 4 will be out real soon. ;D
Russ
Title: Re: home sequence
Post by: Fred_evans on March 14, 2012, 02:08:04 AM
Yes this has been rather amusing---  I never dreamt that my original question would
rattle the hornets nest--
I have been watching everyones observations with interest-- and  decided that
i would wait until it cooled down a bit and then carefully go through the whole topic-
absorbing it all word for word

Thank you all for your input and i hope the above explains my silence.

Your question-- Yes i am hoping to be able to get X home before Z moves
( just get the tool away from danger)

Best regards

fred
Title: Re: home sequence
Post by: Overloaded on March 14, 2012, 01:29:19 PM
---  I never dreamt that my original question would
rattle the hornets nest--
 
:D
Hi Fred, not really a hornets nest, more like you just invigorated the worker bees.  ;D
Thanks,
Russ
 :)
Title: Re: home sequence
Post by: BR549 on March 14, 2012, 05:40:13 PM
HIYA Fred, Not a problem . We just get very enthusiastic when we get to test a function and we normally try to test it every way known to mankind. That way everything we find out about it is right here for anyone that is willing to do a simple search.

Heck someone MIGHT even update the manual you never know.

DO you have another funtion you want beat up on??? You done went and got us ALL wound up now with nothing left to do (:-).

(;-) TP
Title: Re: home sequence
Post by: Fred_evans on March 15, 2012, 03:46:15 AM
Thanks TP----

Hehehehe---- Not beating up-just ignorance asking ignorant questions!!

This whole gcode and cnc thing is fascinating,thought provoking and food for divorce
as in " can we go out to supper tonight or are you playing on your computer again"

Fotuneatly South African sun is very hot and this promotes the development of a very thick skin.

We also have a culture here that requires the woman to do all the unimportant things like cooking and
cleaning the house - leaving the men free  to do more important things like gcode etc
and doing internet.

So I am pleased to contribute by my ignorance

best regards
fred