Hello Guest it is April 25, 2024, 08:04:38 PM

Author Topic: Use Home Offset to square the machine?  (Read 1145 times)

0 Members and 1 Guest are viewing this topic.

Use Home Offset to square the machine?
« on: March 23, 2023, 03:14:16 PM »
I quite don't get the "Home Offset" explanation in the manual for Mach4 or in the manual for the AVID CNC that I use. What I want to do is to square my router to best possible squareness. I have gotten quit close by just adjusting the position of one of the Y axis home switches. To get to a better result, can the Home Offset setting be used for this?
Re: Use Home Offset to square the machine?
« Reply #1 on: March 23, 2023, 07:32:43 PM »
Hi,
you are misunderstanding what Home Offset is.

When Mach Homes an axis advances towards its Home switch. When the switch operates the machine stops and backs up until the switch deactivates. Then Mach zeros
the machine coordinates for that axis....unless you have programmed a Home Offset for that axis. If there is a Home Offset Mach does not zero the machine coordinates
but sets the machine coordinates to the Home Offset. It does not move the axis at all, it just sets the machine coordinates to other than zero.

This would be useful if lets say you could not mount a Home switch exactly where you want, but could mount it 60mm 'inside' where you'd really rather put the switch.
When you use a Home Offset of 60 for that axis the machine will be Homed, but Mach understands that the actual home location is another 60mm away.

Note that Mach3 and Mach4 have always operated this way.

Where you are getting confused is that some motion controllers have the ability to back off some programmed distance from the switch. Its not that Mach does it,
but rather the motion controller. Not all motion controllers do it....but over a period of time most of them do so. PoKeys have done so for years and the ESS for about two years now.
You'll have to look in the motion control plugin to find the setting.....OR code it yourself....its only a simple G0 move after all. This is in effect exactly
what the motion controllers do.....its just that they do it automatically.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Use Home Offset to square the machine?
« Reply #2 on: March 23, 2023, 07:39:22 PM »
Hi,
I think the Avid machines use the ESS as motion control, and the ESS can auto-square a gantry. It requires two switches, one at each end of the gantry,
and presumably set such that the gantry would be square if it were Homed to both switches.

I don't have a gantry machine, so I'm not familiar with how the settings are made to achieve this result, but I'm sure if you posted on the Warp9TD forum there'd be plenty
whom do know.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Use Home Offset to square the machine?
« Reply #3 on: March 24, 2023, 05:21:09 AM »
Hi,
you are misunderstanding what Home Offset is.

When Mach Homes an axis advances towards its Home switch. When the switch operates the machine stops and backs up until the switch deactivates. Then Mach zeros
the machine coordinates for that axis....unless you have programmed a Home Offset for that axis. If there is a Home Offset Mach does not zero the machine coordinates
but sets the machine coordinates to the Home Offset. It does not move the axis at all, it just sets the machine coordinates to other than zero.

This would be useful if lets say you could not mount a Home switch exactly where you want, but could mount it 60mm 'inside' where you'd really rather put the switch.
When you use a Home Offset of 60 for that axis the machine will be Homed, but Mach understands that the actual home location is another 60mm away.

Note that Mach3 and Mach4 have always operated this way.

Where you are getting confused is that some motion controllers have the ability to back off some programmed distance from the switch. Its not that Mach does it,
but rather the motion controller. Not all motion controllers do it....but over a period of time most of them do so. PoKeys have done so for years and the ESS for about two years now.
You'll have to look in the motion control plugin to find the setting.....OR code it yourself....its only a simple G0 move after all. This is in effect exactly
what the motion controllers do.....its just that they do it automatically.

Craig

I see that the setting is in the EES and I want to change it only for one Y axis. In my mind that will adjust the squareness of the gantry. I will try to find more information in the EES forum.
Re: Use Home Offset to square the machine?
« Reply #4 on: March 24, 2023, 05:25:04 AM »
Hi,
I think the Avid machines use the ESS as motion control, and the ESS can auto-square a gantry. It requires two switches, one at each end of the gantry,
and presumably set such that the gantry would be square if it were Homed to both switches.

I don't have a gantry machine, so I'm not familiar with how the settings are made to achieve this result, but I'm sure if you posted on the Warp9TD forum there'd be plenty
whom do know.

Craig

Yes, it is an EES controller and I have two switches (one for each Y axis), but that just squares the machine to the accuracy of the switches positions, and it is very difficult to adjust one switch position just 0.1 mm to get the gantry more square.
Re: Use Home Offset to square the machine?
« Reply #5 on: March 24, 2023, 06:05:08 PM »
Hi,
I'll repeat my previous comment....I don't have a gantry machine so I can at best tell you how I understand the ESS to work.

Firstly note that Homing is a realtime operation and must perforce be done by the ESS, and it does so autonomously.

If you have a gantry with two motors, say motor1 and motor2, one will be the Master and one will be the Slave. This is done on the
Configure/Control/AxisMapping tab.

When you Home an axis with dual motors you use Configure/Control/HomingSoftLimits tab. You would ascribe equal priority to the two motors.
For instance you might ascribe the X axis (motor0) as priority 1, the two Y axis motors (motor1 and motor2) ascribe them priority 2, and the Z axis (motor3) as priority 3.

You will need a Home switch for each Y axis motor. Most take this to mean that you require two switches, and that is the normal intent, but need not be the case.
Each motor will have a Home signal, motor1Home and motor2Home....but both of those signals could be populated or driven by just one switch. Why you would
do so is a good question, but the important point is to understand that each motor requires its own Home signal......but need not have an individual switch, or another
way of saying it the one switch could 'drive' more than one signal.

So now when the Y axis is being Homed both motor1 and motor2 are unlinked, that is to say that the Master/Slave relationship is temporarily broken. Both motors are simultaneously
driven towards the home location, and must obviously be driven at the same speed or the gantry would be hopelessly skewed. Both motors will drive until each one
activates its own home switch as indicated by its Home signal whereon that motor will stop. Then both motors will back up until its Home switch deactivates. Note that this would mean
that each end of the gantry would be homed to its switch. If the switches are out of square then the gantry will also be out of square.

This is where you ask can one or other of the motors be backed off some additional distance to accommodate that the switches are not square? I don't know, that is a question you should ask
Andy on the Warp9 forum. It may be possible and then it would just be a case of making the right settings and the problem is solved.

There is another way that this could be done, and if the ESS cannot do it autonomously then this method will certainly work but requires you code it in Lua.

In the Mach API (Mach4Hobby/Docs/Mach4CoreAPI) there are these functions:

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

Description:
Unmap the motor from the axis.

and:

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

Description:
Map a motor to an axis.

So these APIs allow you to programmatically link and unlink Master and Slave motors. Just as a matter of interest this is impossible in Mach3. What this means now is you
can 'jiggle' each motor independently back and forth a wee bit until you are happy that the gantry is perfectly square. Then you link the together again, that is to say you restore the Master/Slave
relationship. As a added bonus you can use:

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

Description:
Set the axis' Home In Place flag.

You can use this to allow the two motors, now perfectly square, to be Homed, ie the machine coordinates of both motors being set to zero and then set the HomeInPlace flag
back to normal. Note that if you choose not to do this then the machine coordinates of the two motors will not be the same. Lets say for instance the the Master is Homed
and therefore its machine coordinate at its Home switch will be 0, ie normal. But you Slave motor has been 'jiggled' 0.1mm to square the gantry and so its machine coordinates
will be -0.1mm.

If you used a g53 move say:
g53 g0 y342 for example both Y axis motors would drive to machine coordinate 342mm, and the 0.1mm skew that you had carefully corrected out of it would now be forced back into the
gantry....rather counter productive.

All in all the APIs that allow you to link and unlink motors and the HomeInPlace feature can be used to code some very sophisticated squaring routines, well beyond what any motion
control  like an ESS might be expected to do. This is where you might get a taste of the true power of Mach4....you can code it to do things which have been hithertofore considered impossible.

Craig
« Last Edit: March 24, 2023, 06:20:10 PM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'