Hello Guest it is March 29, 2024, 12:59:28 AM

Author Topic: Mach 4 Goto Work Zero  (Read 2802 times)

0 Members and 1 Guest are viewing this topic.

Mach 4 Goto Work Zero
« on: October 18, 2018, 06:03:31 PM »
I have Mach 4 Hobby with the PDMX plugin on a Joe's EVO 4X4 that built.  I am doing simple test runs without a router bit to make sure things are working.  I'm using my X&Y Negative end limit switches and Z Positive (top) limit switch as the home switches.  I enabled soft limits and set the Min & Max Values in the appropriate table.  I have successfully homed using Ref All Axes.  Then I moved X&Y 10 inches in the postive direction and the Z-axis down 4 inches and zeroed each axis.  Next I loaded one of the sample G-codes and ran it ("Arc Test" I think), and hit Regen Tool Path.  First of all, the g-code program won't run when I have the Soft Limit button turned ON (green light).  When I turned it off, I could run the program.  I don't understand that.

I let the pattern run, then I stopped it after a couple of complete loops (this pattern will run in a never ending continuous loop for some reason, but other patterns I've tried don't).  Next I hit "GoTo Work Zero" assuming it would go back to the starting coordinates.  But the machine does nothing.  The only way I could get it to go back to my starting point is to type G1Y0X0Z0 in the MDI screen and run that.  I have checked the G54 coordinates in the offset tab and it shows coordinates 10,10,-4 as I believe they should be.

This is my first experience with this.  I would prefer to not to start copying and pasting code to change the screens until I get more proficient at Mach 4.  Does anyone have a solution that don't involve customizing screens at this point?  This is based on my assumption that GoTo Work Zero is supposed to do what I think it should do.  Maybe I don't understand its intended function after all.

Also, what is the purpose of De Ref All Axes?

Thanks
Re: Mach 4 Goto Work Zero
« Reply #1 on: October 19, 2018, 09:32:56 PM »
Hi,
just below the DRO block there is a set of buttons, one in particular <Go To Work Zero>. Does it work?
If not tell us what the message is in the status bar.

The button has code attached which does exactly the same as your 'G1Y0X0Z0' command. Mach when it ships has code to
rewind the A axis to zero as well. If you don't have an A axis it will fail with a message something like:
'Axis 3 commanded while Disabled'.

<De-Ref All Axes> means break the homing, ie you have to <Ref ALL> before you can continue.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach 4 Goto Work Zero
« Reply #2 on: October 19, 2018, 09:50:43 PM »
Craig,
That is the button I’ve been trying to use.  I won’t be able to check the status bar until Sunday.  When I do, I’ll write back.  I appreciate your help.
Bruce
Re: Mach 4 Goto Work Zero
« Reply #3 on: October 21, 2018, 04:41:48 PM »
Craig,
I re-homed my machine, then moved X,Y,Z and zeroed each individually for work zero.  Then I moved each axis away from the work zero coordinate.  Next I triec “Go To Work Zero” button.  It didn’t move, and the status bar reads “Axis 3 commanded while Disabled' just as you suspected.

Ok what do I need to do? I was hoping not to do any edits, but I guess I’ll have to do that.

Thanks,
Bruce
Re: Mach 4 Goto Work Zero
« Reply #4 on: October 21, 2018, 05:10:28 PM »
Hi,
Mach4's greatest strength is its ability to customized.....its greatest weakness, or rather source of complaints, is that it NEEDS to be
customized to work.

Behind the <Go To Work Zero> button is a function  GoToWorkZero(). The function itself is defined in the screenload script.

Are you familiar with the Screen Edit functions? Can you navigate to the Screen Load script?

This is the code in my build of the screenload script around line 225:
Code: [Select]
---------------------------------------------------------------
-- Go To Work Zero() function.
---------------------------------------------------------------
function GoToWorkZero()
    --mc.mcCntlMdiExecute(inst, "G00 X0 Y0 A0")--Without Z moves
    mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z0")--With Z moves
end

---------------------------------------------------------------
Note there are two lines of code, the one in use and the other is 'commented out' but is left intact that you may see its differences.
In particular note how the code explicitly calls a move to A0. If your machine does not have an A axis then the error you have described
results.

Simply Edit the line to remove the reference to the undefined axis:
Quote
---------------------------------------------------------------
-- Go To Work Zero() function.
---------------------------------------------------------------
function GoToWorkZero()
    --mc.mcCntlMdiExecute(inst, "G00 X0 Y0 A0")--Without Z moves
    mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 \nG00 Z0")--With Z moves
end

---------------------------------------------------------------

Or you may chose to leave the original line but comment it out and add a new line to suit your needs. It will retain the option
to revert to the standard issue code should you wish by simply uncommenting it:
Code: [Select]
---------------------------------------------------------------
-- Go To Work Zero() function.
---------------------------------------------------------------
function GoToWorkZero()
    --mc.mcCntlMdiExecute(inst, "G00 X0 Y0 A0")--Without Z moves
   -- mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z0")--With Z moves
       mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 \nG00 Z0")--With Z moves
end

---------------------------------------------------------------

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach 4 Goto Work Zero
« Reply #5 on: October 22, 2018, 04:49:05 PM »
Craig,

Thank you for your help.  I edited a copy of the screen set.  Long story, but it didn't work at first, but I finally figured out why and fixed it.  Also, my machine wouldn't move on G00 Y0 X0 Z0 in the MDI screen either.  I discovered when I used the G00 and G01 commands, the machine was moving incrementally rather than moving to absolute positions.  After much frustration, watching some Mach 4 videos and reading a few things about G-codes, I tried using G90 in MDI.  Then the "Go To Work Zero" button worked.

I had previously run one off the test patterns- Arc Test- and it went into a never ending loop.  So I stopped it manually.  Apparently I stopped it after a G91 command and so I was stuck in G91 mode the whole time.

Anyway, it's working now after running G90 in MDI.

Thanks,
Bruce

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Mach 4 Goto Work Zero
« Reply #6 on: October 22, 2018, 05:05:02 PM »
This isn't so much about customization as it is trying to get a stock (out of the box) system.  The stock Mill profiles are either 4 or 6 axes.  So on the 4 axis profile, we expect all for axes to be enabled.  Simply enabling the 4th axis is all that is required even if it will not be used. 

Maybe we should have a 3 axis only screen set.  But we could do (and have to maintain) screen sets until the cows come home and not cover all possible scenarios.  So we compromised on two Mill profiles. 

Steve
Re: Mach 4 Goto Work Zero
« Reply #7 on: October 22, 2018, 07:22:38 PM »
Bruce,
It is a good habit (in my opinion) to be sure to know if it is in absolute or incremental mode.
When I type something in MDI I make sure my first line has G90 or G91 in it.

Steve,
I agree with you, just enable the 4th axis even if you're not going to use it.  That's what I do on the mills that I don't have a 4th axis on. 
I wouldn't want to keep up with all the screen sets.  It's hard enough to keep up with the custom ones I've got throughout the shop.
Chad Byrd