Hello Guest it is December 15, 2019, 12:42:09 PM

Author Topic: G31 Probe problem  (Read 38202 times)

0 Members and 1 Guest are viewing this topic.

Re: G31 Probe problem
« Reply #10 on: July 30, 2011, 03:56:52 PM »
Hi Guys,
I have seen this "mach urban legend" expounded that probing does not work reliably in macros (scripts) several times.
This time, on this morning, I choose to offer an alternate viewpoint...   :D

Let me start with, I am absolutely, NOT, I repeat not, trying to start a flame war of any type.
I speak up now only because dis-information (even when made from the best of intentions), particularly from community members who I respect, concerns me a tad.  For context, I've had some conversations where confused,  non-expert mach users have asked me about this urban legend.

IMHO, telling people that probing can not be reliable when done from a script is a disservice to the readers of the posts. The (incorrectly IMHO) repetition of this assertion does not help users - it just makes them think that a rather significant part of mach (the entire macro scripting facility) is unreliable. 

Why do I have this differing opinion?

To date, I have direct experience with a pretty good size user base that does probing operations, with mach, via scripts, day in and day out, and they have been doing this for between 1 and 2 years now.

Since I developed and market mach enhancement software, the experience has given me some reasonably broad experience from which to form my opinion.  I don't have a way to know how many probing operations each user does; So I have no idea how many individual probing operations that all adds up to - but I am pretty sure that it is not a trivially small number.

During the 2 year experience since I started the software project, not one single time have I been able to identify a  problem that could even remotely be attributed to the way a G31 command was submitted to mach - be it either via Code("G31") from within a script, or as a G31 block in a G-code file.

Yes, my probing software has had some (usually minor) bugs in it during the last two years, and they were always script logic bugs.  At no time, has there ever been an issue, where there was as G31 command that did not work just because it was "from inside" a script.

In fact, (as I'm pretty sure you guys know) in a script, the way that a G31 operation is invoked is by issuing a G31 command - as g-code - via the Code() call. Internal to mach, the script Code() calls and the Gcode interperter both get the G31 command inserted in the code queue. The processing is identical (or so Brian tells me ) from that point on.

The reality is that a script author can write good scripts, and they can write bad scripts. Script quality is not an inherent "a script was used" issue - it's a script author skill level issue.

Are really good scripts easy/trivial to write? Not really, the difficulty level will depend on the programming skills of the author and also on their knowledge of how mach and the target machine operate.

I've looked at a lot of mach scripts in the last 2 years - and the code quality, and the reliability of the script actions varies a lot (!).  Again, that's not evidence that scripts are inherently unreliable (it is evidence that the programming skill level of script authors varies).

I know you guys are both pretty good at understanding mach itself. I take at face value that you may have had problems with scripts you have written. And the details of G31 actions can be tricky.

Where I differ is with the implication that probing is not, and can not never be, reliable when used from a script.

Perhaps it would be more accurate to say that "writing complex, professional quality scripts for Mach can be difficult".

OK, I hereby turn off this mini-rant.
(sorry, it was not meant to be a rant, but I fear it could read that way)  ;)

Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: G31 Probe problem
« Reply #11 on: July 30, 2011, 04:55:34 PM »

To date, I have direct experience with a pretty good size user base that does probing operations, with mach, via scripts, day in and day out, and they have been doing this for between 1 and 2 years now.


I agree...I've been probing inside macros for years.  I don't find that it stops any faster if the same code is placed in GCode.  I probe at 30IPM and typically see about 1/8" of over travel.  Also running fairly high acceleration on the Z, so maybe that's why.
Re: G31 Probe problem
« Reply #12 on: July 30, 2011, 08:04:25 PM »
rrc1962 and DaveCVI, could you post your probe script?
« Last Edit: July 30, 2011, 08:05:58 PM by Dave3891 »

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: G31 Probe problem
« Reply #13 on: July 30, 2011, 08:22:55 PM »
HIYA DAVE,So when I do a Code"G31 X10" and the probe never stops when it hits the switch(led comes on) it is the programmer fault(;-). When I do a Code"G31 X10" and it does not make the move untill 3 OTHER commands have processed and THEN the G31 show up and is processed, THAT is the programmers fault?

I almost forgot my personal favorite. I a probe cycle with the proper wait states so the entire Cycle will work on this computer. Run it on the computer next to it and it fails by  jumping over sections of code. The wait state timing was off.

Yea I know semaphores. Dang Dave this is 2011 the Control program has to do something on its own like keeping track of its threads. (;-)

(;-)

I have 5 years worth of error and crash data that says otherwise. I have probably over a million (literally) probe cycles in gcode without failure.Can't say the same thing about the macro side.

BUT I am allways open to learn a new trick and I would be MORE than happy for you to show us the PROPER way to do the macro Probing so it NEVER fails.

NOW I will leave my soapbox,

 (;-)TP
« Last Edit: July 30, 2011, 08:31:16 PM by BR549 »
Re: G31 Probe problem
« Reply #14 on: July 30, 2011, 10:47:11 PM »
rrc1962 and DaveCVI, could you post your probe script?



code "F30"
code "G31 Z-1"
While ismoving
Wend
code "G92 Z-" & offset
While ismoving
Wend
code "G00 Z" & pierceHeight
While ismoving
Wend

One thing I've noticed is that G31 does not use the acceleration setting for the Z axis.  It uses either the X or Y acceleration settings, even if you are probing the Z.  If you have a very low acceleration setting on the X and Y and something higher on the Z, don't be surprised to see actual acceleration on Z probe not match your Z acceleration settings.

Offline ger21

*
  • *
  •  6,291 6,291
    • View Profile
    • The CNC Woodworker
Re: G31 Probe problem
« Reply #15 on: July 31, 2011, 08:02:44 AM »
I have a few hundred people using my screenset with auto zero macros using G31, and a probing wizard that uses G31's, and have not had a single reported incident with probing. All are called from macro's.

Three are a huge number of router guys using G31 in autozero macro's, and I don't see any mention of failures there, which would most certainly result in broken tools and pissed off users.

Terry, are your errors repeatable at all, or totally random? If it happens as often as it sounds like, how about sharing some code that fails for you?
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: G31 Probe problem
« Reply #16 on: July 31, 2011, 10:08:16 AM »
Gerry all that testing has come and gone and all the results was shared. Also I have talked to several BIG OEMs and they share the same sentiment about using the macros for motion control code. I have looked at MANY examples of everyones macro probing code and it  is about all the same as to function  Even Dave's(;-) There are only so many ways it can be done.

Not to mention that even Brian and Art have stated there are timig issues with VB and Mach3 and the way CB works with threading(;-)

So take what I had to say and use it for what it is worth(;-).

(;-) TP

« Last Edit: July 31, 2011, 10:12:50 AM by BR549 »

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: G31 Probe problem
« Reply #17 on: July 31, 2011, 10:45:11 AM »
OK lets expand this a bit to investigate it a little further(;-)

Do you find anywhere a 3d probing function that works all the time and does not run in Gcode?  Not even Arts plugin will do that.

When Stirling developed his Crawler surface/profile routine could he do it in macro CB and have it work dependably ?

WhenI worked with the probing arrays I first tried the MACRO version, Nope it could not be done reliably in CB. I had to move to using Gcode Subroutines and stay in Gcode. AND without conditonal support that had to be done the LONG/HARD way. Now the arrays can run for millions of probe cycles without fail or error. The macro versions could not run 60 secs without getting lost.

NOW IF you work with macros and CAN load them up with wait states and while do loops and semaphores to help control the threads THEN it can be reliable BUT the motion will be as slow as a SNAIL on a winter day. GO stop wait

It is one thing to do a simple find the center of a circle or edge of material or tool offset. no big deal if that takes 1 minute to run reliably. but you cannot have motion code that pokes along at a snails pace or runs Run Stop Wait.  you will never get anything done.

For an example of how it is suppose to work take a look at CUBLOCS PLC control. It integrates ladder logic with Basic language in a way that they stay in perfect time and thread sync. THAT is how we need Mach3 to work MACRO wise.

Just a thought, (;-) TP
« Last Edit: July 31, 2011, 10:50:49 AM by BR549 »

Offline ger21

*
  • *
  •  6,291 6,291
    • View Profile
    • The CNC Woodworker
Re: G31 Probe problem
« Reply #18 on: July 31, 2011, 10:49:57 AM »
Then we're talking about different things.

You're creating a point cloud, and I'm probing single points (maybe up to 4).
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: G31 Probe problem
« Reply #19 on: July 31, 2011, 10:53:14 AM »
Gerry I am talking repeating a motion command from a MACRO repeatedly and reliably.  Point clouds have nothing to do with the problem.

(;-)TP