Mach4 ?

Discuss all things

Moderator: Country_Bubba

Post Reply
m0ng00se
Posts: 1
Joined: Mon Aug 29, 2016 1:03 am

Mach4 ?

Post by m0ng00se » Mon Aug 29, 2016 1:05 am

Hi Guys .. anyone tested or knows if this work with Mach4 ?

Thanks.

User avatar
Country_Bubba
Posts: 114
Joined: Wed Oct 02, 2013 3:07 pm
Location: LaGrange, GA USA

Re: Mach4 ?

Post by Country_Bubba » Tue Aug 30, 2016 12:29 pm

Hi,
As no one has responded to your post, I will take a shot at it. First off, I am NOT a Mach user so in reality am taking a basic guess at the answer.
I would suggest that it should work as AE only modifies Z axis moves in existing Gcode files. It is not modifying the syntax of the code so it therefore should work properly.
The easiest way would be to give it a try and cut air the first time.

Art
Country Bubba
Art
Country Bubba

daedelus
Site Admin
Posts: 363
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: Mach4 ?

Post by daedelus » Fri Sep 02, 2016 1:15 pm

Previously, I have assumed (without owning Mach 4 myself) that what works on Mach 3 will more than likely work on Mach 4. However I have just checked the Mach 4 manual and now I am not sure.
In the Mach 4 GCode the G31 word (for probing) is the same as in Mach 3, however, Autoleveller takes the Mach 3 variable for the current Z position (#2002) and assigns it to another variable (#50X) for later calculations. The problem is that the Mach 4 variable for the current Z position is different (#5063) according to the Mach 4 manual here: http://www.machsupport.com/wp-content/u ... Manual.pdf
G31/G31.X – Probe function: Also known as skip function, G31 allows the use of part and tool probes.
Multiple probes can be used, G31 for probe 1, G31.1 probe 2, G31.2 probe 3 and G31.3 probe 4. Motion
is defined along linear axes, in a similar format to G01, with a feedrate.
Format: G31 X__ Y__ Z__ F__
The machine will move toward the specified end point, at the same time it is looking for the probe input
to be activated. When the probe input is activated the current position is recorded to # variables
according to the table below and motion is stopped. The recorded position can then be used to
calculate tool offsets, work offsets, measure parts, etc.

Axis G31 # Variables G31.1 # Variables G31.2 G31.3
X 5061 5071
Y 5062 5072
Z 5063 5073
A 5064 5074
B 5065 5075
C 5066 5076
In the currently supported software of both AL and AE, the member version allows writing the probe values to an external file which AL/AE refers to as the RPF. This file allows you to separate the probing and etching processes which, among other benefits, means you do not need to use the variables at all.

In Mach 3 an M40 and M41 word would open and close the RPF so that probe values could written. However in Mach 4, there is no built in open/close file M codes at all, so I am not sure you can even use this RPF technique at all.

As Art said though, give it a try as it might work as the manual or I might be missing some facts.

If it doesnt work I will look at some other options for supporting Mach 4 when I can.
http://www.autoleveller.co.uk/. Software to probe and adjust a GCode file for PCB's or any probe-able surface.

http://www.autoleveller.co.uk/cnc-probe-guide/. A short guide to setting up the probe.

-James

joeaverage
Posts: 26
Joined: Tue Aug 09, 2016 8:55 am

Re: Mach4 ?

Post by joeaverage » Fri Oct 14, 2016 6:00 am

Hi,
I've just started using Mach4 after upgrading from Mach3.

As it stands Mach4 will not run Autoleveller Gcode. As explained above Mach4 does not have M40/M41
functionality ie you cant generate a probe file.

If you look in the Mach4 directory in the LuaExamples folder there is a ProbeToFile example which
includes two scripts M400 and M401 corresponding to file close and file open respectively.
They could of course be renamed to M40 and M41 and put in the Macros folder of your
active profile. I haven't tried it yet, I suspect I would need to modify the format statements
for Autoleveller to use the probe file to generate levelled code. My experience is that any good
Gcode will run with Mach4 provided it does not use any macro calls that are Mach3 specific.

Over time successive releases will include more and more macros to match or exceed Mach3
functionality.

Craig

daedelus
Site Admin
Posts: 363
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: Mach4 ?

Post by daedelus » Fri Oct 14, 2016 3:42 pm

Thanks for this, very useful information. Please let us know if you try the scripts, I would be very interested to know the results.

Regarding valid probe file formats. As of AE0.7.8 it now reads each line of a raw probe file (RPF) where the first 3 self-contained numbers will be evaluated as X, Y and Z values (other than this there is no requirement on the RPF format) and used in the rest of the autolevelling process. Most importantly any future RPF formats should be equally supported as long as they use a similar format.

For example 3 lines from 3 different RPF files, might be...

Code: Select all

7.00000,7.66602,0.14766

X7.00000Y7.66602Z0.14766A0.00000

7.00000  7.66602  0.14766 
In all 3 cases AE would evaluate XY and Z as: X=7, Y=7.66602 and Z=0.14766.

The point is that you should not need to modify anything to suit AE.
http://www.autoleveller.co.uk/. Software to probe and adjust a GCode file for PCB's or any probe-able surface.

http://www.autoleveller.co.uk/cnc-probe-guide/. A short guide to setting up the probe.

-James

joeaverage
Posts: 26
Joined: Tue Aug 09, 2016 8:55 am

Re: Mach4 ?

Post by joeaverage » Fri Oct 14, 2016 8:23 pm

Hi,
have tried the scripts and they appear to work. Please note however that I don't have Mach4 running on
my machine at the moment, I'm upgrading to an external motion controller which means quite extensive
setup changes. I'm loath to change from Mach3 which works to Mach4 until I've fiddled/simulated
sufficiently. To populate a probe file requires a working probe which in turn requires a debugged
external motion controller.

The M401 script as supplied generates lines of the format:

"X%.3AXIS_X Y%.3AXIS_Y Z%.3AXIS_Z A%.3AXIS_A\r\n"

ie

X.nnn Y.nnn Z.nnn A.nnn\r\n

Your post suggests Autoleveller is flexible with regard to format, would it accommodate a line
of four entries? If so the script M401 could be renamed M40 and used as is. Otherwise I could
presumably modify the script just to write the XYZ entries and disregard the A entry.

Craig

daedelus
Site Admin
Posts: 363
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: Mach4 ?

Post by daedelus » Sat Oct 15, 2016 10:12 am

AE v.0.7.8 should have no problem reading that format. It will just disregard the A value.

As you say, you should just be able to just rename the scripts to M40 and M41. That should be all you need to do.
http://www.autoleveller.co.uk/. Software to probe and adjust a GCode file for PCB's or any probe-able surface.

http://www.autoleveller.co.uk/cnc-probe-guide/. A short guide to setting up the probe.

-James

Dodger
Posts: 1
Joined: Sat Oct 29, 2016 6:34 pm

Re: Mach4 ?

Post by Dodger » Sat Oct 29, 2016 6:49 pm

Hi so got on here to find out the answer to the same question as the OP and thanks to your info of what you found in the manual autleveller is working great. Using Mach4's G-code editor and the "find and replace" function made replacing the 2002 callouts to 5063 quick and painless.

it's a quick and simple manual work around and doesn't actually "fix" anything, but it makes the auto level script work which is good enough for me.

daedelus
Site Admin
Posts: 363
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: Mach4 ?

Post by daedelus » Mon Oct 31, 2016 10:49 am

Excellent. Good workaround. Thanks for sharing.

To log probe positions to a raw probe file and get all the benefits and abilities that brings, you still need the scripts which joeavereage mentions. If you dont need/want this then the "find and replace" workaround should be quick and painless as you say.
http://www.autoleveller.co.uk/. Software to probe and adjust a GCode file for PCB's or any probe-able surface.

http://www.autoleveller.co.uk/cnc-probe-guide/. A short guide to setting up the probe.

-James

joeaverage
Posts: 26
Joined: Tue Aug 09, 2016 8:55 am

Re: Mach4 ?

Post by joeaverage » Mon Dec 05, 2016 12:48 pm

Hi,
I can confirm that the scripts that ship with Mach4 can be renamed and slightly edited to
achieve Mach3 functionality of M40 and M41. That being said I have yet to achieve useful
output from AE, see my new thread...

Craig

Post Reply