Author Topic: Mach3 sometimes doesn’t get Data from a G31 probe.  (Read 3181 times)

0 Members and 1 Guest are viewing this topic.

Offline Samrai

  • Active Member
  • Posts: 13
    • View Profile
Mach3 sometimes doesn’t get Data from a G31 probe.
« on: July 21, 2016, 10:26:56 PM »
I understand G31 action of Mach3 as follows:

http://www.machsupport.com/Mach3Wiki/index.php?title=How_to_get_Data_from_a_Probe

And I know I can see the values at the menu of “Operator > GCode Var Monitor”.
But recently I noticed that Mach3 sometimes fails to get the values.
This is a big problem, isn’t it?
Don’t you know some solution?

Offline Samrai

  • Active Member
  • Posts: 13
    • View Profile
Re: Mach3 sometimes doesn’t get Data from a G31 probe.
« Reply #1 on: September 08, 2016, 08:20:10 PM »
Still Mach3 sometimes fails to get the value e.g. #2000 for X-axis.
So as an alternative idea, I tried the following program.

Dim XCoor As Double
Code("G31 X300")
Do
    If GetOEMLed(825) Then  'When probe led on
        XCoor = GetABSPostion(0) '0 for X-axis
        SetVar(1000, XCoor) 'Alernative variable #1000
        Exit Do
    End If
Loop
While IsMoving()
End While


Everything is OK so far.

Offline Highspeed1964

  • Active Member
  • Posts: 128
    • View Profile
Re: Mach3 sometimes doesn’t get Data from a G31 probe.
« Reply #2 on: September 08, 2016, 09:17:24 PM »
My guess is that the previous routine you had was not probing far enough.  In your code above, it is probing 300 units (I'm assuming you're running in metric so 300mm).  When the probe touches the plate or part it stops and then the values are read from that location.  However, if you were previously probing say 10mm that may not have been enough to actually touch the surface so the position is not set when the movement is complete.  G31 stops at either the sensed touch or when the probe depth has been reached even if the plate/surface is not touched.

Also, in the code above the While/End While loop is redundant.  The Do/Loop checks if the probe move is complete (If GetOEMLed(825) would be true) and if it is it sets the coordinate of the stopping point.  If movement is not complete (i.e. GetOEMLed(825) is false) it will loop while the movement continues.  Once this loop is complete there is no reason to wait if IsMoving() is true since it will never be true at that point in the script.  Also, you have the potential for an endless loop if the probe never touches since GetOEMLed(825) would never be true.  Here is how I would code this:

Dim XCoor As Double
Code("G31 X300")
While IsMoving()
    Sleep(10)
Wend
If GetOEMLed(825) Then  'When probe led on
    XCoor = GetABSPostion(0) '0 for X-axis
    SetVar(1000, XCoor) 'Alernative variable #1000
Else
    ...G31 did not reach the surface, add error handling routine here
End If

Hope this helps,

Stephen "Highspeed" Kruse
« Last Edit: September 08, 2016, 09:26:08 PM by Highspeed1964 »

Offline Samrai

  • Active Member
  • Posts: 13
    • View Profile
Re: Mach3 sometimes doesn’t get Data from a G31 probe.
« Reply #3 on: September 12, 2016, 12:35:53 AM »
Highspeed, thank you for your help.

>If movement is not complete (i.e. GetOEMLed(825) is false)
>it will loop while the movement continues.
Yeah, you are right.
I've changed my program as you'd pointed out.
However, e.g., the touched X-axis coordinate should be stored at #2000.
But Mach3 often fail it.
This problem isn't still solved.
Now I'm thinking I will try it by using another breakout board.
Now I'm using "WiXHC Mach3 Motion Card MKX-IV" made in China.
If you knew a better one, please let me know.

Offline ger21

  • Global Moderator
  • *
  • Posts: 6,143
    • View Profile
    • The CNC Woodworker
Re: Mach3 sometimes doesn’t get Data from a G31 probe.
« Reply #4 on: September 12, 2016, 07:10:18 AM »
Many chinese motion controllers do not write the probing values to the #2000-#2002 variables.
A workaround is to just read the values from the axis DRO's after the probe move.

Most non chinese motion controllers do support probing properly, but you should check with the manufacturer's before purchasing.
Gerry

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

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

Offline Highspeed1964

  • Active Member
  • Posts: 128
    • View Profile
Re: Mach3 sometimes doesn’t get Data from a G31 probe.
« Reply #5 on: September 12, 2016, 11:54:03 AM »
Highspeed, thank you for your help.

>If movement is not complete (i.e. GetOEMLed(825) is false)
>it will loop while the movement continues.
Yeah, you are right.
I've changed my program as you'd pointed out.
However, e.g., the touched X-axis coordinate should be stored at #2000.
But Mach3 often fail it.

When you say "often" do you mean that it sometimes DOES work?

Also, that motion card is a combination motion controller and breakout board.  The difference between a breakout board and a motion controller are many but the basics are that a breakout board simply splits the signals out from a 25-pin connector to individual circuits - usually with isolation circuits helping protect your computer from erroneous voltage from feeding back through the parallel port.  A motion controller does so much more including off-loading of the CPU intensive translation of the Mach3 commands to the actual signals sent out on the 25-pin input port and can have a couple of different types of input connectors - the most common being USB and Ethernet.

As Gerry said, motion controllers vary greatly in implementation of the actual functions.  Although many recommend against the Chinese types, I have a UC100 motion controller that plugs into a standard breakout board via a 25-pin connector and it works quite well.  The challenge is that I'm not sure if there is a Mach4 plugin available for that controller so if I ever decide to upgrade to Mach4 I may not be able to use the UC100.  So I'd be starting from square one on the design.

I bring this information to the discussion so that you do not end up buying a breakout board that does not have a motion controller to replace one that is a combo unit like the WiXHC one you have.  You'd then probably need to buy a motion controller as well if you do not have a parallel port setup on your computer.  MCs are the way to go at this point anyway as parallel ports are becoming a scarce technology.

Let us know how things progress for you.

Highspeed

Offline Samrai

  • Active Member
  • Posts: 13
    • View Profile
Re: Mach3 sometimes doesn’t get Data from a G31 probe.
« Reply #6 on: February 23, 2017, 09:33:25 PM »
Hi folks,
Now everything goes well.
Now I'm using CSMiO/iP-S, Ethenet Motion Controller made in Poland.
It's great but a bit expensive.
And they supply their originally made macro M31 instead of G31.
It's also great and high speed.
Any way, Thank you for all your kind advices.