Hello Guest it is June 23, 2025, 06:18:27 AM

Author Topic: How do I set Work Coords to equal machine coords when homing?  (Read 7553 times)

0 Members and 1 Guest are viewing this topic.

Like the title states I would like my work coordinates to be equal to my machine coordinates when I home the machine.

This morning I powered up my machine, homed it and started a job. But I noticed that it went to the wrong position. Fortunately i hit e-stop before it started cutting, or it would have ruined a bit, possibly a fixture.

I homed the machine again and changed the work coordinates by typing them in the window to match the machine coordinates.

I've never had an issue like this in the past. When homing It always gets the coordinates correct, for machine and work. When powering down I always save the fixture settings, so I'm not sure if this was what was saving the homing coordinates.

I did some maintenance on my machine yesterday, and manually moved the axis so I could grease the rails etc. And that may account for why it was off. But I don't think so. I've had a few crashes in the past, and homing the machine corrected the position.

If there is a setting to automatically set the values of the work coordinates when homing, why would this have changed after several months of use? It worked yesterday, but not today. The only thing I did that I don't normally do is move the axis by hand.
Re: How do I set Work Coords to equal machine coords when homing?
« Reply #1 on: April 28, 2019, 03:04:06 PM »
Hi,
you can write a script that would set your current work offsets to whatever you require but I'm thinking you
don't really understand what work offsets are.

Look on the Offsets Tab.

Note the buttons g54, g55, g56 etc. It is common that when you start Mach the default offset g54 is in operation.
If you have an alternative offset that suits a particular job or a particular material placement you could have
that offset stored in one of the other offsets, g55 for instance.

Note that if you hit the <Fixture Offset> button  then a table comes up as shown and you can view the over one hundred
sets of offsets. You can edit each one manually if desired.

In any given offset, g54 for example, if you hit the <Zero X> it causes the x axis offset to change, thus it is common for an
offset to change over the course of a Mach session. One of the most common changes is when you mount a piece of
material in the vice then jog to the start point, if you hit <Zero X>, <Zero Y>, <Zero Z> in succession the current
offset set in operation will now reflect the machine coordinate point of that location. Provided you do not alter one or
more of those entries Mach will retain that location for months/years.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline reuelt

*
  •  520 520
Re: How do I set Work Coords to equal machine coords when homing?
« Reply #2 on: April 28, 2019, 03:32:09 PM »
Like the title states I would like my work coordinates to be equal to my machine coordinates when I home the machine.

Put the following in the beginning of your G Code file assuming [REF. ALL ZERO] homing sets Machine cordinates to X0 Y0 Z0.

G28
G90 G10 L2 P1 X0 Y0 Z0

explaination
G28 sends tool to machine zero already DONE [ref all zero] before
G90 make sure G10 is in absolute units
G10 L2 P1 sets values in WORK COORDINATE #1 (nominally G54)
you already know what X0 Y0 and Z0 means

« Last Edit: April 28, 2019, 03:46:24 PM by reuelt »
"the gift of God is eternal life through Jesus Christ our Lord"

Offline reuelt

*
  •  520 520
Re: How do I set Work Coords to equal machine coords when homing?
« Reply #3 on: April 28, 2019, 04:07:19 PM »
 If you use a G10, you will need to close it out with a G11 in Mach4 (although it was not required in Mach3). 
"the gift of God is eternal life through Jesus Christ our Lord"
Re: How do I set Work Coords to equal machine coords when homing?
« Reply #4 on: April 29, 2019, 02:58:37 AM »
Hi,
sorry, forgot to attach the pic that goes with my previous post.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline smurph

*
  • *
  •  1,574 1,574
  • "That there... that's an RV."
Re: How do I set Work Coords to equal machine coords when homing?
« Reply #5 on: April 30, 2019, 10:29:31 PM »
G10 only needs G11 if it is a multi-line or modal G10 operation.  Most G10 calls are on shots. 

Steve
Re: How do I set Work Coords to equal machine coords when homing?
« Reply #6 on: December 02, 2024, 09:35:35 PM »
Can one of you clarify this for me.  I am currently working on a probing script for Mach4 and as one solution that I was considering for writing the probed z-position of the top of a part was to use something like this "mc.mcCntlGcodeExecuteWait(inst, "G10 P"..wcsVariable.."Z"..zMachinePositionVariableAtTimeOfTrigger)

For simplicity's sake, let's say that wcsVariable = 1 and zMachinePositionVariableAtTimeOfTrigger = -4.685, then this willl obviously become the gcode "G10 P1 Z-4.685" and thus set the the z-zero position of G54 at G53 Z-4.685.

Of course, these variables would be set either by user entry on a GUI screen and/or via the probe trigger action and some preceding script in the code. 

My question is regarding the use of the G10 code in particular.  Am I correct in thinking that G10, in a situation like my example above, will write the position you give it to whichever axis you tell it to(excluding those you do not specify), and that axis in that work coordinate system is set to that number (in machine coordinates) until it is otherwise changed (as in it would function the same as manually zeroing that same axis in that same work coordinate system in that same position in machine coordinates? 

Sorry for being so verbose.  To state that more simply, would the above code "G10 P1 Z-4.685" be an equivalent to jogging the machine to G53 Z-4.685 and zeroing the z-axis at that point? 

I would prefer to use #variables much in the same way you would on a Haas, or system variables as you would on a Siemens-controller-based machine, but Mach4 does not clearly publish this data.  It is findable, but it seems to be that people doubt whether or not these #variables will stay consistent in their application by Mach4 with updates.  Also, I could not find a clear way to use lua script to write the machine coordinates to a specific work coordinate axis.  So, if you happen to know of a good way to do it this way, I would appreciate any input there as well.  Thanks for any input you can give.