Hello Guest it is March 29, 2024, 07:34:58 AM

Author Topic: G31 causes an endless loop  (Read 7027 times)

0 Members and 1 Guest are viewing this topic.

Offline PtD

*
  •  9 9
    • View Profile
Re: G31 causes an endless loop
« Reply #10 on: October 31, 2014, 04:44:18 PM »
I confirm the same behavior both in licensed and demo mode.

I would suspect some quirks with the controller, but I can't see how the controller can cause a step back in the execution order in Mach3...

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: G31 causes an endless loop
« Reply #11 on: October 31, 2014, 05:48:17 PM »
If you're not using the parallel port, many external motion controllers have G31 bugs in their plugins.
Whenever you're using a motion controller, make sure you specify that up front when asking questions, as it can save days of frustration.
Gerry

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

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

Offline PtD

*
  •  9 9
    • View Profile
Re: G31 causes an endless loop
« Reply #12 on: November 01, 2014, 12:42:17 PM »
Right. The controller is YooCNC USB motion card (the one from X6-1500GT). What I see is that G31 is correctly executed - it touches probe and then program moves to another step. What could be the reason that G31 command (executed with whatever controller) is making Mach3 go back a line?

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: G31 causes an endless loop
« Reply #13 on: November 01, 2014, 01:46:28 PM »
As I said, it's probably a bug in the plugin for your motion controller.

Report the issue to the developer of the device, and see if they can fix it.
Gerry

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

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

Offline PtD

*
  •  9 9
    • View Profile
Re: G31 causes an endless loop
« Reply #14 on: November 02, 2014, 06:25:27 PM »
Follow up: This VB code works fine:

Code: [Select]
For y = 0 To 10
For x = 0 To 10
Code "G0 Z1"
Code "G0 X" & x & "Y" & y
While IsMoving()
Sleep(10)
Wend

Code "G31 Z-10"
While IsMoving()
Sleep(10)
Wend
Sleep(10)
zProbe = GetDRO(2)

Message "x " & x & ", y " & y & ", z " & zProbe
Next
Next

It seems that the problem is related to timing issues. If I omit the sleep(10) before the GetDRO(2) call, I get spurious values for Z.

Based on this VB script, I developed a wizard that does the whole digitizing in VB. I will keep trying to resolve the issue in G-Code.

Thanks for your support.