Hello Guest it is March 28, 2024, 07:22:31 AM

Author Topic: How do I disable fixture offset (after reference all axes)?  (Read 2455 times)

0 Members and 1 Guest are viewing this topic.

I'm a 15+ year long Mach3 user on 2 CNC mills and now bringing up a router with Mach4. This issue is driving me crazy and is behavior I have not seen on mach3. Let me describe my workflow, then the behavior followed by what I've done to diagnose/solve the issue.

I'm on Mach4 build 4612, using the WxRouter.set screen.

I have a simple 3 axes router with home switches and soft limits enabled.

The way I like to work is this:

Home (Reference All Axes (hom) the machine after I turn everything on to make some cuts.
Clamp my work piece to my bed. I typically make onsies or twosies
Jog to the datum on the work piece and touch off the tool old-school using rolling paper
Zero X, Zero Y, Zero Z

Now I load and run my gcode.

Observed Behavior:
(unless I zero out the G54 section of the View->Fixture Offsets... table)

When I do the Reference All Axes (home) the machine homes as it should, I see the DROs turn green and set to "0" but then the machine immediately moves to the position set in the G54 of the Fixture Offsets table. I do NOT want this behavior. Many times, after the first job, I jog the tool out of the way to move my work and setup for another job. This new job will likely be in a different location on my router's bed and may be a thicker workpiece. Once I have the new workpiece clamped, I do another Reference All Axes (home) and expect the tool to stay at 0,0,0 so I can then jog to the new datum Zero the axes, load the gcode and run. But, it goes to the fixture offset and that might cause a crash into the material or a clamp.

I've used the above workflow on my milling machine for 15+ years and have never had an issue. I've never used fixture offsets and don't really have a need. If I zero out the G54 row of the fixture offset before homing, I get the expected behavior.

What I've done to Diagnose:
I notice when I launch Mach4 that the status line shows a string of gcodes that includes G54. In my case that line is:

G0 G17 G90 G91.1 G94 G20 G40 G49 G80 G50 G67 G97 G54 G64 G69 G15 G40.1

So I thought the logical thing to do is remove the G54, but I can't find where this string is created! I've looked at the load screen script, the Ref All Axes button scripts, etc. I've also looked at the Mach Config dialog and don't see where G54 is added. I've also looked at the Probing and Offsets tabs on the screen and don't see anything that can help.

My ideal scenario would be to have the workflow that I've used for 15 years. But, if there is an alternative workflow that works with this automatic fixture offset I'd consider changing if there were advantages.

thanks!

Re: How do I disable fixture offset (after reference all axes)?
« Reply #1 on: May 09, 2022, 10:48:14 AM »
While exploring the Screen Editor I found where these gcodes are defined. I didn't realize that the line that shows these gcodes is dedicated to that task and the field on the screen is called Modal Gcodes. I then googled Modal Gcodes and learned that these are in the ModalWizard. I opened ModalWizard.mcs in an editor and sure enough, there they are:

Code: [Select]
local groupNames = {
"01: Feed mode",
"02: Plane selection",
"03: Absolute or incremental",
"04: Arc center mode",
"05: Feed rate mode",
"06: Units",
"07: Cutter compensation state",
"08: Height offset state",
"09: Active canned cycle",
"10: Retract Z level selection",
"11: Scale mode",
"12: Modal macro",
"13: Spindle mode",
"14: Active coordinate system",
"15: Cutting mode",
"16: Coordinate system rotation mode",
"17: Polar mode",
"18: Compensation mode"
}

This is the ordered list and item 14 is the one that inserts the G54. Is it safe to edit this macro? Is it as "easy as" removing row 14 and renumbering the other rows?
Re: How do I disable fixture offset (after reference all axes)?
« Reply #2 on: May 09, 2022, 11:00:32 AM »
Well, I guess the this is not what the Modal Gcodes wizard does. Apparently, it reads the modal gcodes already set in the system and displays them with more detail in a nice table. Removing a row from the wizard table does not change what the modal gcodes are. But at least now I know that these are called modal gcodes so I can continue searching for that.
Re: How do I disable fixture offset (after reference all axes)?
« Reply #3 on: May 09, 2022, 11:32:05 AM »
Ack, searching the entire mach directory did not get any other hits for modal or modal gcode. So back to square one.

Offline Bill_O

*
  •  562 562
    • View Profile
Re: How do I disable fixture offset (after reference all axes)?
« Reply #4 on: May 09, 2022, 12:53:59 PM »
Make a copy of your Mach4Hobby folder in case you mess something up before editing the screen.
If it is moving to the G54 position after a Reference All Home it is in the function RefAllHome() in the Screen Load Script.
You will need to edit the Screen Load Script
Go to Operator then Edit Screen
Under the Screen Tree Manager click the top listed wx4
Under properties select the middle icon (Events)
Next to Screen Load Script click on the words to the right then the button with 3 dots
Find RefAllHome and make your edits.
After your edits go to Screen then Save Screen.
Go to Operator then Edit Screen to exit screen edit mode.
Re: How do I disable fixture offset (after reference all axes)?
« Reply #5 on: May 09, 2022, 01:04:28 PM »
Bill_O thanks. I had looked at the load script RefAllHome and it is not calling G54. Here is the code:
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

I'm trying to track down mc.mcAxisHomeAll to see if there is something there but haven't found it yet.
Re: How do I disable fixture offset (after reference all axes)?
« Reply #6 on: May 09, 2022, 01:11:35 PM »
I'll verify this later but I am fairly certain that after I click Reference All Axes (Home) that it displays the message "Referencing is complete" before moving to the table offset location.

Offline Bill_O

*
  •  562 562
    • View Profile
Re: How do I disable fixture offset (after reference all axes)?
« Reply #7 on: May 09, 2022, 01:58:37 PM »
It would not call G54 it would have a move command.
I do not see it in the code.
Are you positive it is moving after a Reference All Home?
Re: How do I disable fixture offset (after reference all axes)?
« Reply #8 on: May 09, 2022, 02:03:16 PM »
Yes I am absolutely positive! I'll shoot a quick video of the behavior this evening.

And, if I clear the G54 row ( to 0s) in the fixture table before calling Reference All Axes, the move does not take place.

If I then jog to position on my workpiece and click the Zero axis buttons with the fixture table open, I see the G54's axis immediately updated with the offset. Then, doing another Reference All Axes will home and now move to that "fixture" location.

Offline Bill_O

*
  •  562 562
    • View Profile
Re: How do I disable fixture offset (after reference all axes)?
« Reply #9 on: May 09, 2022, 02:14:33 PM »
While in Screen Edit Mode click on the Reference all Axes button.
Under Properties on the left click the middle icon.
What is in the Left Up Script?