Hello Guest it is April 16, 2024, 05:49:56 PM

Author Topic: Mach3, G31 probe on Z axis, and variable 2002  (Read 6787 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach3, G31 probe on Z axis, and variable 2002
« Reply #10 on: April 25, 2020, 05:53:39 PM »
The same reason why it says G73 retracts, the documentation is wrong.
Ugg, I'll watch for that!

Does Mach4 have either better documentation or stick better to ansi standards?
Any machine is a smoke machine if used wrong enough,
Re: Mach3, G31 probe on Z axis, and variable 2002
« Reply #11 on: April 25, 2020, 06:33:27 PM »
Hi,

Quote
Does Mach4 have either better documentation or stick better to ansi standards?

Mach4 documentation is much better than Mach3, having said that it tends to lag the latest developments. Probing
(there are four probe channels in Mach4) is of course very mature and so the documentation is pretty good. In particular
there is an excellent description of the sequence of signals between Mach4 and the motion controller with a g31 code.
And by the way if you read it you will discover that a g31 does not retract....contrary to your belief, the retract requires
a second gcode move.

Quote
Probing
Motion plugin probing procedure.
The probe moves are really just G01 moves in exeact stop mode with the addition of being marked as EX_PROBE in the execution_t struct from mcMotionCyclePlannerEx().

When executing a G31, the core considers the move as an exact stop move and therefore will request a motor stop report. It waits on one of two conditions:

A probe strike condition where the motion plugin calls mcMotionSetProbeComplete().
An end of move condition where the motion plugin reports the motors as being still.
Until either of these conditions are satisfied, the core will generate no more moves after the EX_PROBE marked moves. In other words, all you will get out of mcMotionCyclePlannerEx() will be EX_NONE type data. In the event of a probe strike, this makes it safe to clear the planner and be sure that future moves are not removed by accident.

A motion plugin should implement probing in the following way:

Upon seeing the first move marked as EX_PROBE, the plugin should arm position latches on the hardware.
Then consume the EX_PROBE marked moves as normal.
If the probe stikes, the plugin should:
Cancel any MSG_REPORT_MOTOR_STOP requests. (see g. VERY important!)
Report the latched positions via mcMotionSetProbePos() for each motor.
Clear the hardware of any additional moves.
Call mcMotionClearPlanner() to clear the Mach planner of any unretrieved EX_PROBE moves.
Update Mach with the hardware's current position via mcMotionSetPos().
Call mcMotionSetProbeComplete().
If a MSG_REPORT_MOTOR_STOP has been received, do not acknowledge it. mcMotionSetProbeComplete() does this for you and a position sync as well.
If no probe strike, then the move continues to it's end point as if it is a regular move.
The plugin should ack the MSG_REPORT_MOTOR_STOP messages with mcMotionSetStill().
The positions latches should be disarmed (if needed) when a MSG_PROBE_DONE is seen.
In the event that the probe move is aborted, the plugin should:
Call mcMotionClearPlanner() to clear the Mach planner of any unretrieved EX_PROBE moves.
Call mcMotorSetPos() for each controlled motor.
Call mcMotionSync.
Call mcMotionSetStill() for each controlled motor.
Probe Operation Overview.
Upon executing G31, the core will mark those moves as EX_PROBE in the data stream.
If the probe strikes before the end of the G31 move, the plugin aborts the rest of the probe moves as described above. If a probe data file has been opened via mcCntlProbeFileOpen(), then the positions recorded by the motion plugin are inserted into the probe data file in the specified format.
If the probe doesn't strike and the G31 move reaches its end point and a probe data file has been opened via mcCntlProbeFileOpen(), then the end point positions are inserted into the probe data file in the specified format.
Using the probe data file routines.
int mcCntlProbeFileOpen(MINSTANCE inst, const char *filename, const char *format);
The format argument is a printf style format with expanding macros for the axis values. AXIS_X, AXIS_Y, AXIS_Z, AXIS_A, AXIS_B, AXIS_C. It is used in the following manner:


mcCntlProbeFileOpen(inst, "myProbeFile.csv", "%.4AXIS_X, %.4AXIS_Y, %.4AXIS_Z");
This will produce a probe file in CSV format like so:



1.0000, 2.0000, -1.4356
1.0100, 2.0000, -1.4343
1.0200, 2.0000, -1.4324
...

A format of "X%.4AXIS_X, Y%.4AXIS_Y, Z%.4AXIS_Z" would yield:



X1.0000, Y2.0000, Z-1.4356
X1.0100, Y2.0000, Z-1.4343
X1.0200, Y2.0000, Z-1.4324
...

A format of "X%.4AXIS_X\tY%.4AXIS_Y\tZ%.4AXIS_Z" would yield a tab delimited file:



X1.0000 Y2.0000 Z-1.4356
X1.0100 Y2.0000 Z-1.4343
X1.0200 Y2.0000 Z-1.4324
...

int mcCntlProbeFileClose(MINSTANCE inst); Closes the probe data file.

Mach4 is generally ANSI compliant, but more importantly is made to be Fanuc 21B compliant, which is the template for ANSI.

I've been using Mach4 for five years and regularly probe parts and surfaces and have had no problems whatever.

Craig
« Last Edit: May 03, 2020, 05:44:46 AM by Tweakie.CNC »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach3, G31 probe on Z axis, and variable 2002
« Reply #12 on: April 27, 2020, 11:46:30 AM »
And by the way if you read it you will discover that a g31 does not retract....contrary to your belief, the retract requires
a second gcode move.

I was just quoting the documentation that came from Artsofty with Mach3, and it was just a side note!  Why does everyone focus on this one thing?  I never thought it would retract back up to original position or anything, it simply said it retracted a little, which it does not!
Any machine is a smoke machine if used wrong enough,
Re: Mach3, G31 probe on Z axis, and variable 2002
« Reply #13 on: April 27, 2020, 03:44:30 PM »
Hi,

Quote
Why does everyone focus on this one thing? 

Whatever.

Mach4 has a logging feature which offers a very granular diagnostic potential, for example the attached pic.
You wanted to know if Mach4 had better documentation, it does but more importantly it does have superb diagnostic
logging.

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