Hello Guest it is June 19, 2025, 07:10:18 AM

Author Topic: Cannot Get Mach4 to Run Properly  (Read 4209 times)

0 Members and 1 Guest are viewing this topic.

Cannot Get Mach4 to Run Properly
« on: November 15, 2024, 12:09:04 PM »
I cannot get Mach4 with PMDC-SmartBob to run correctly. Last Year!, I gave up on this because the Z Axis would not behave correctly. For example - I Zero the  X-Y-Z axis, and then jog away.  I hit goto Work Zero, the X moves to Zero, the Y moves to Zero and the Z Stays Put.

The touchoff UI has NEVER worked, despite having the probe make contact. Sometimes it retracts, sometimes it doesn't. Sometimes it says Unexpected Probe Touch.

Once again, I am at my wits end. I knows this isn't Mach3, but everything worked in Mach3.

Any insight as to how to start over or simply give up again and sell this machine.

Re: Cannot Get Mach4 to Run Properly
« Reply #1 on: November 15, 2024, 01:48:19 PM »
The Go To Work Zero does not move the Z axis by default.
You need to go into the screen editor and edit the GoToWorkZero function in the screen load script.  You will see it has the Z move in the code, it is just commented out.

I never use the probe routines that come with Mach4.  I made my own, so I can't speak to these issues.
Even though you need to have Mach4 industrial to utilize Macro B Programming, you can still just use the G31 to use the probe in mach4 hobby.  Just be very very very very careful on how you move your probe around and that you are running the correct probing cycle for what you are doing. 
There are system variables (#VARS) that hold the position for each axis when the skip signal (probe) is hit. 
Check this thread out.
https://www.machsupport.com/forum/index.php?topic=44774.0
I will also try and attach some other probing files.

I haven't looked at some of these .mcs macros in a while.  But I think what I added was for a buzzer to beep like a haas machine.  So ignore those and get rid of those lines in the .tap files.
Chad Byrd
Re: Cannot Get Mach4 to Run Properly
« Reply #2 on: November 15, 2024, 02:18:42 PM »
Thank you Chad. I will give this a try. Much appreciated.
Re: Cannot Get Mach4 to Run Properly
« Reply #3 on: November 15, 2024, 02:39:20 PM »
Thank you Chad. I found the code in the ScriptScreen.lua, but it says Unable to save Access denied.
Re: Cannot Get Mach4 to Run Properly
« Reply #4 on: November 15, 2024, 02:40:26 PM »
Go into the screen editor and edit the screen script there.

https://www.vitalsystem.com/support/support.php


This is how you can get into the screen load script.
Find the part where it talks about programming physical buttons.
« Last Edit: November 15, 2024, 02:42:14 PM by Cbyrdtopper »
Chad Byrd
Re: Cannot Get Mach4 to Run Properly
« Reply #5 on: November 15, 2024, 04:03:50 PM »
Not working for me. And now I'm in even more confused. I saw that code once and was able to uncomment out one the line. Didn't fix the issue, so I went back to try again and now all it does - following those instructions, which did work once - is load leF926.mds in the main ZeroBrane editor which only contains one line of text
1 GoToWorkZero()

Did I delete something?

Thanks for your help, but this is killing me. If I knew I would have to be a programer to get this machine running I would have never gone to Mach4.
Re: Cannot Get Mach4 to Run Properly
« Reply #6 on: November 15, 2024, 04:37:41 PM »
Just re-install Mach 4. It will reload everything back to stock. 

When you do it again, make a copy of the screen set you are using before hand so you can go back to it before you start messing with the code.

The name of the file is always weird when messing with the scripts in the editor.  I have learned to just make sure you’re not going to anything else while in the screen editor and editing a screen script of some kind.
Make your changes, save them, get out of zero brain before anything else.  I have lost chunks of code before as well   I usually do testing in macros before going to the screen scripts, I use to navigate tabs to the macro I was using and copy code from there.  It didn’t like that. At all. So now I copy and paste it into notepad before I make changes.

Also, as an aside. Mach4 runs great right out of the box.  It is the ability to be flexible with mach4 that is great and terrible.  Everyone has their own ideas of what a machine tool should do as a default; but with Mach4… you can make it do what you want if you’re willing to take the time to do it.    With other machine tools, you’re at the mercy of slow development or just their thought of what is good or bad.
As far as probing goes. 
It is the quirks between motion controllers with probing that I have found to be the most annoying, so you’re not alone there, and that’s why I wrote my own code to do probing.  Some motion controllers work well with probing some don’t. I’m not sure why.

As far as needing to program in LUA, most of the stuff that people want changed are ready to but commented out like the go to work zero. (Although you’re having issues with that). Normally it is pretty straightforward and I’m confident you’ll get it going.
« Last Edit: November 15, 2024, 04:40:57 PM by Cbyrdtopper »
Chad Byrd
Re: Cannot Get Mach4 to Run Properly
« Reply #7 on: November 20, 2024, 06:55:36 PM »
Hi,

Quote
I found the code in the ScriptScreen.lua, but it says Unable to save Access denied.

As a clarification, all Lua chunks, and there are dozens and dozens of them are throughout, in fact make up the ScreenLoad Script. When Mach is ready to run ALL
those chunks get compiled into one big chunk that you've already seen, ScriptScreen.lua. This is the code that runs, if you like, but you cannot edit it. To change it you
must go to the chunk of Lua code in the ScreenLoad script (or Unload script or PLC script or whatever) and edit that. When Mach next compiles that change will have been
propagated into ScriptScreen.lua

I use probing routines to make PCB's (using an ESS as motion control). In any given day I may probe many hundreds of times. I do not use (by-in-large) the built in probing routines
that come with Mach, but write my own as Chad does. If there is a stuff-up (heaven forbid.....I made a mistake once and swore NEVER again!) it is my own.

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