Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: TTalma on March 21, 2019, 06:36:24 PM

Title: Is there a Gcode command to reference all axis home?
Post by: TTalma on March 21, 2019, 06:36:24 PM
When I am hogging material off for a rough clean up some times I lose a couple of steps. For the roughing it doesn't really matter, but it does on the following steps.

Is there a Gcode command that will reference all axis home?

I know about the G28 command but this only returns the axis to the home position, it doesn't appear to reference it from the switch if it's off a few steps.
Title: Re: Is there a Gcode command to reference all axis home?
Post by: joeaverage on March 21, 2019, 10:29:48 PM
Hi,
no, there is no Gcode that does that.

There is however a Mach function that does it:

Quote
LUA Syntax:
rc = mc.mcAxisHomeAll(
   number mInst)

Description:
Used to start an axis homing.

Parameters: Parameter Description
mInst The controller instance.


Returns: Return Code Description
MERROR_NOERROR No Error.
MERROR_INVALID_INSTANCE The mInst parameter was out of range.
MERROR_NOT_NOW The operation could not be completed at this time.

Thus you could use the API in a macro.

Or you could call the RefAllHome() function (in the screen load script)

Code: [Select]
-- Ref All Home() function.
---------------------------------------------------------------
function RefAllHome()
    mc.mcAxisDerefAll(inst)  --Just to turn off all ref leds
    mc.mcAxisHomeAll(inst)
    coroutine.yield() --yield coroutine so we can do the following after motion stops
    ----See ref all home button and plc script for coroutine.create and coroutine.resume
    wx.wxMessageBox('Referencing is complete')
end

Craig
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Cbyrdtopper on March 22, 2019, 08:47:45 AM
There is a G Command that will home an axis.
G28.1   It is on page 37 of the mill programming manual. 
I just tested it here at work on a mill with the ESS and it works.
I found that it needs to be programmed like G28, with a G91
So, do the following.

G91 G28.1 Z 0.00
G91 G28.1 X 0.00 Y 0.00
G90

Be sure to set your machine back in absolute mode with the G90.
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Overloaded on March 22, 2019, 09:23:52 AM
Hi Chad.
Are you referring to the doc in the M4 download ? Mine is different.
Or are you in M3 ?
Thanks,
Russ
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Bill_O on March 22, 2019, 09:33:17 AM
I am using the
G91 G28.1 X 0.00 Y 0.00
G90
in M4 and it works great.

Bill
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Overloaded on March 22, 2019, 09:53:26 AM
Hi Bill.
I don't doubt that it works in M4, as it worked well in M3 but I don't see it in the M4 manual. Mine goes from 28 to 30.  Do you have it in a M4 manual ?
Thanks
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Cbyrdtopper on March 22, 2019, 10:06:01 AM
It's in the Mach4 manual.  Page 37.
Title: Re: Is there a Gcode command to reference all axis home?
Post by: bryannab on March 22, 2019, 10:07:12 AM
Hello,

G28.1 is included in the Mill G Code Programming document in the Mach4 Docs folder. The one I'm looking at is version 1.1, build 3775 and is included in 4.2.3804 and onwards.

-Bryanna

Title: Re: Is there a Gcode command to reference all axis home?
Post by: Overloaded on March 22, 2019, 10:19:53 AM
Thanks bryannab,
I have 1.0 .
A day late and a dollar short again.
Cheers,
Russ
Oh, I got it here   
https://www.machsupport.com/help-learning/product-manuals/
You might want to update that.
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Overloaded on March 22, 2019, 10:27:34 AM
It's in the Mach4 manual.  Page 37.

Thanks Chad.
The current manual has not replaced the old one yet on the website under Mach4 Manuals.
Thanks,
Russ
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Cbyrdtopper on March 22, 2019, 10:38:23 AM
Russ,
Yeah, I have the newest profile from the FTP site on my computer at work, so my manual is updated, didn't even think about it not being in the older manuals.
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Bill_O on March 22, 2019, 03:30:45 PM
My only problem with the G28.1 is the speed is very slow.
I can not find how to change the speed.
Title: Re: Is there a Gcode command to reference all axis home?
Post by: MN300 on March 22, 2019, 03:44:02 PM
You have said the error is small. You could do a high speed move to a location near home before the G28.1 command to speed things up.
Title: Re: Is there a Gcode command to reference all axis home?
Post by: Cbyrdtopper on March 22, 2019, 03:45:50 PM
That'w what I was going to suggest. 
It homes as if you clicked the Reference button; command a G53 move close to Axis Zero.
Title: Re: Is there a Gcode command to reference all axis home?
Post by: smurph on March 24, 2019, 01:54:53 PM
The home speed is configured in Homing/Softlimits tab as a percentage of the axis' maximum velocity.  The axis maximum velocity is derived from the slowest of the motors that run the axis (Motors tab).

Steve