Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: GGLLGGLL on March 31, 2022, 05:15:53 PM

Title: Mach4 + ESS Gcode for performing a homing cycle?
Post by: GGLLGGLL on March 31, 2022, 05:15:53 PM
I have a fully custom CNC machine with a rotary axis.  I expect that over several thousand cycles my error will compound in the rotary to necessitate a homing cycle.

Is this possible to do in Gcode directly?  That would be the preferred method for my application.

I'll have a loop that completes 1 or 2 thousand times, and then exit the loop to home, and then renter the loop for the next thousand or so.

Advice?
Title: Re: Mach4 + ESS Gcode for performing a homing cycle?
Post by: joeaverage on April 01, 2022, 05:52:41 PM
Hi,
this post should be on the Mach4 General Discussion board, no doubt Tweakie will shift it there in due course.

Quote
Is this possible to do in Gcode directly?  That would be the preferred method for my application.


You might try g28 x...y...z...a... That will move the axes to the specified location, although I'm less certain that it zeros the machine coordinates.

You could do it with a macro. Your macro could be called m250 say. In the macro would be an APIs like:

Code: [Select]
LUA Syntax:
rc = mc.mcAxisHome(
number mInst,
number axisId)

Description:
Used to start an axis homing.

Thus every time you want the A axis to home just include a m250 in your Gcode.

Craig
Title: Re: Mach4 + ESS Gcode for performing a homing cycle?
Post by: joeaverage on April 01, 2022, 05:59:53 PM
Hi,
just reading the MillGcode manual and g28 will cause the machine to move to the machine zero but it won't zero the machine coordinates.
g28.1 will however.

Craig