Hello Guest it is July 19, 2025, 07:32:38 PM

Author Topic: How does Mach 4 Store Offsets?  (Read 14253 times)

0 Members and 1 Guest are viewing this topic.

How does Mach 4 Store Offsets?
« on: August 09, 2024, 03:24:35 AM »
Trying to get to the bottom of how I ruined a couple hundy dollars of alloy today. One of my motors faulted and E Stopped my machine. Its a large router with a 4th axis. I restarted and rehomed the machine, but then discovered the hard way my Z had dropped about 1mm so destroyed the part. X and Y were fine. It was a 2hr operation. So hurts a little.

Do I need to restart Mach 4 to retain offsets? Not keen on this happening again I was a little surprised. I thought, if the machine is homed, it will return to the offset as good as the homing switches are. Am i wrong? Have been before
Re: How does Mach 4 Store Offsets?
« Reply #1 on: August 09, 2024, 08:28:19 AM »
In my experience, you don't lose your offsets unless Mach4 crashes.  I added a bit of code to some probing routines to save the profile after it sets a tool offset or I use my probe.
However, if Mach4 didn't crash, you should've just been able to home your axis and be good to go again.  I've done this countless times.  Make sure your physical switch didn't move on your Z axis.  Or make sure it is repeating.... you can look at your offsets in the "View" --> "Fixture Offsets".  You can sit there and home the axis several times to see if there is a significant change in position.  I'd use a dial indicator to do this.
Chad Byrd
Re: How does Mach 4 Store Offsets?
« Reply #2 on: August 09, 2024, 03:58:41 PM »
Huh, is that right? Thats what I thought. So yesterday the Z dropped about 1mm, with a 4th axis op that took 2mm off my part. I didn't notice just due to the time it happened until I got the part off and it was exactly ok everywhere except for approx 2mm thinner. Good for a paperweight.

I have siemens homing switches and will check my mountings, I was not sure I followed your instruction to check my offset return although I will probably work that out when in front of my machine. I did make a new part yesterday and it was fine after reprobing my Z on the 4th.

So when I get an E Stop signal out of my drivers, the only fix is to depower and repower my control circuit. Restart Mach 4. Rehome.

The challenge presented is if I have a part in my 4th axis vice and lose either X or Z of the WCS I am screwed. Its in the Y direction so the back plate of the vice is that reference. I was wondering what to do now to avoid this again. I could setup a referance block somewhere and reset with the known offset.

But in all reality I will try to find out the problem instead of a fix over the top. Or perhaps this was a one off..... Thanks for the words
Re: How does Mach 4 Store Offsets?
« Reply #3 on: August 09, 2024, 04:06:26 PM »
--Store Fixture and Tool Offsets
function m900()
local inst = mc.mcGetInstance()
mc.mcProfileSave(inst)
mc.mcToolSaveFile(inst)
mc.mcFixtureSaveFile(inst)
end --m900()

if (mc.mcInEditor() == 1) then
   m900()
end


I made this m900 Macro and run it when I make any changes. 
You can also just put the code in a button on the screen and press the button whenever you make any changes.
If you have home switches on your machine, you should be able to restart mach4, home the machine, and start machining again.
But again, like I mentioned earlier, if Mach4 crashes.... it loses any data that has not been saved.  Running this bit of code will ensure you don't lose any tool offsets or work offsets.
Chad Byrd
Re: How does Mach 4 Store Offsets?
« Reply #4 on: August 09, 2024, 04:32:53 PM »
Far out. Thanks a bunch for this. I have been burnt, I am going to install this and use it. Regards
Re: How does Mach 4 Store Offsets?
« Reply #5 on: August 11, 2024, 11:37:44 AM »
WOW I was coming to post the same exact thing. I am not smart enough to install this code though.

In my case if I hit e-stop or abort the program before it is finished, I get into all kinds of trouble. I actually lose homing switches, auto probing and who knows what else. This has been going on for a long time with me but fortunately it's not happened on a valuable part, and I just thought it was a part of MACH.
Yesterday a part slipped from the clampdowns so I stopped the program quickly and before I stopped, I heard it skip, no problem I will rehome. Go to rehome and the Z+ switch is not noticeable HOWEVER the LED light comes on in diagnostics. Now I have to reboot all including MACH. I rehome and then go back to my work zero and both my X and Y are off and I am not sure if it grabbed the homing process, I did several days ago or what, but X was off a mile. It is very confusing to me. I keep thinking my control board is puking but after I saw this post I seem to be wrong. 
Todd
Re: How does Mach 4 Store Offsets?
« Reply #6 on: August 12, 2024, 02:46:36 AM »
Mr Rufustoad.

Thanks. Ok. I reckon its a bug and a totally unacceptable one now I think about it. I had the issue with using the stop button making my machine jerk and lose position. Which is really to be honest totally unacceptable for a CNC machine of size. I did post something about this previously somewhere, someone was kind enough to give a workaround using the feedhold button.

A few weeks ago I entered my stock on a HUGE cut, large enough to start to slow my 6kw spindle down. Whilst I was messing around looking for the feedhold button (a stupid habit) it snapped a 10mm endmill.

My experience with equipment is E Stop should remove all control power, and a stop should be just a stop. Not a backwash of surges and faults somewhere. I can understand if say if my Y gantry at full rapid move might pose a problem stopping urgently. But in a normal op at normal speed, we should be able to use these functions without losing positions and offsets.

Ok. Rant over. How shall we proceed with a fix? I am using Mach 4 with the ESS. I do rememember a machine I worked on, we needed to remove an earth off a PSU in the machine that was causing the PLC to lose its programming. Made in Italy they are on a different grid power suppply, I think ours in NZ is teratera or something its about the earthing system. Anyway, we sorted it and the fault was very similar. Perhaps it can be sorted with software. What I do know, is I need a functionional E Stop and stop button I can use without bombing my machines settings and offsets. Are we on the right forum?
Re: How does Mach 4 Store Offsets?
« Reply #7 on: August 12, 2024, 09:15:36 AM »
Just to cut in; in my experience with several Machine Tools, I've never seen a "Stop" button, it is always "Feedhold".  Haas, Doosan, Mazak, other Fanuc controlled machines all have feedholds.  It is Feedhold then reset.   Feedhold is a controlled stop of (as far as I can tell) the motion planner.  The ESS has (or did have) a "Controlled Stop" option in the setup.  If you want to check that box, it will make the stop button a controlled stop. 
Your feedhold is what you need to press when you need to stop the machine for minor issues, E Stop is the last resort for major issues due to the abruptness of the stop is should cause.

In regards to the E Stop; we wire our estop's into an e stop relay that in turn cuts power to the contactors controlling our servo or stepper drives, our spindle, and our coolant (just in case); the relay also has a NC circuit that we wire back to the motion controller so we can use the e stop signal inside Mach4 to let it do it's thing on the software side. 

In the past we have had serious issues with, as you call it, a backwash of surges and faults due to bad wiring on our part.
Rufustoad, I think you have some more underlying issues going on if you hit estop and you lose your inputs.  Also, if you part slipped, you need to re-establish your part's work zero before you can just rehome and continue machining.   If you shut down Mach4 properly you do not lose any of your offsets that you have made, you only lose offsets when Mach4 crashes unexpectedly. 
Chad Byrd
Re: How does Mach 4 Store Offsets?
« Reply #8 on: August 12, 2024, 03:10:59 PM »
All cutting in is invited and welcome. Actually you made me go back an reread that last post from Mr Rufus. Agree actually, there is something going on with your machine I would be inclined to look at earthing paths myself.

Interesting you have wired a separate relay for your e stop is that a more robust way to cut power? Assuming its fail safe closed. The Mach e stop most certainly works, just its the end of anything I need to fully rehome the machine both stop and e stop.

I guess and hate to say it, Mach 3 was fine in this instance none of these problems occurred for me anyway. Both router and lathe. Putting it to more thought, I have a screen controller with a mouse. Perhaps I need to put a physical, amber color feed hold physical button adjacent to the e stop. Its not very often I need to use it, the irony is if I have hit the stop button and forgotten to check my lost offsets, that's normally when something goes very wrong.
Re: How does Mach 4 Store Offsets?
« Reply #9 on: August 12, 2024, 07:09:01 PM »
It’s an actual e stop circuit relay. It’s a module we get from automation direct. It is controlled from the e stop switch; the relay has 3 normally open and 1 normally closed circuit.  We wire our servos from terminal blocks that are fed from a contactor. The contactor circuit is ran through the e stop relay.  The normally closed circuit we feed back into our motion controller so mach4 can have the e stop signal.

That is an odd thing to run into if you switched from mach3 to mach4.
I use the HiCON now instead of the ESS, but I swapped a mill with an e stop an external buttons from mach3 to mach4 and didn’t have these issues.
Chad Byrd