Hello Guest it is March 28, 2024, 03:05:19 PM

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

0 Members and 1 Guest are viewing this topic.

Offline PtD

*
  •  9 9
    • View Profile
G31 causes an endless loop
« on: October 30, 2014, 04:09:47 AM »
Hi all,

I am using Digitizing Wizard to extract a 3D model from an object, and I've encountered the following problem: when executing this G-Code sequence

N1 F100
N2 G0X0Y0Z1
N3 G31 Z-10
N4 G0 Z1
N5 G0X1Y0Z1
N6 G31 Z1
N7 G0 Z10
N8 G0X2Y0Z1
...

Mach3 starts looping between lines 2 and 3. It would position at (0,0,1) @ line 2 , then it would probe down to touch the object @ line 3, and then for some reason it returns to execute line 2 again, instead of moving forward to line 4.

I suspected it may have something to do with Safe Z, but it doesn't work with any setup of Safe Z I tried.

What can be the cause of this odd behavior?

(Sorry if this has been answered before).

Thanks in advance.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: G31 causes an endless loop
« Reply #1 on: October 30, 2014, 09:08:42 AM »
Line 4 is basically the same as line 2. Are you sure it's looping?
What is line 6 supposed to do?
THis is very strange code.
Gerry

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

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

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: G31 causes an endless loop
« Reply #2 on: October 30, 2014, 09:52:39 AM »
I think what we have here is a classic case of the code we see is not the code in question - the digitize wizard would not produce that code - but a bad memory and a quick hand might.

Offline PtD

*
  •  9 9
    • View Profile
Re: G31 causes an endless loop
« Reply #3 on: October 30, 2014, 01:59:19 PM »
You are correct that this is not the exact code from the Digitizing Wizard. It is a simplified version just to expose the loop. Here is the actual Digitizing Wizard code:

 (Digitize File)
M40
G92X0Y0Z0
F100
 G0X0Y0Z1
 G31 Z-10
 G0 Z1
 G0X1Y0Z1
 G31 Z-10
 G0 Z1
 G0X2Y0Z1
 G31 Z-10
 G0 Z1
 G0X3Y0Z1
 G31 Z-10
 G0 Z1
....

Here the loop happens on lines 5 and 6:
 G0X0Y0Z1
 G31 Z-10

In the "Current Line Number" DRO it goes 5, 6, 5, 6, 5, 6... ad infinitum. The strange thing is that once or twice, with other parameters for height and depth it worked, but I can't reproduce them.

Mach3 version is R3.043.066.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: G31 causes an endless loop
« Reply #4 on: October 30, 2014, 02:28:47 PM »
please post your xml file. That's the file in C:\Mach3 with the same name as your profile with a .xml extension. Make a copy and rename it to Ptd.xml and post it using the forum's full-reply Additional options link.

Offline PtD

*
  •  9 9
    • View Profile
Re: G31 causes an endless loop
« Reply #5 on: October 30, 2014, 02:51:14 PM »
Here it is, attached to the post.

Also can be read at https://www.dropbox.com/s/nijslczuy3apqsv/Mach3Mill.xml?dl=0

And here is a video of the loop sequence I shot: https://www.dropbox.com/s/844htm1iilp2wum/MOV_0761.mp4?dl=0

Thanks in advance for your support!

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: G31 causes an endless loop
« Reply #6 on: October 31, 2014, 06:27:08 AM »
Everything works fine here with your xml on my R3.042.020.

Best I can suggest is you try a re-install of Mach3 and maybe use a different/earlier version. I believe Hood is unhappy with 0.66 for all sorts of reasons - personally I've never used it so can't comment.

Offline PtD

*
  •  9 9
    • View Profile
Re: G31 causes an endless loop
« Reply #7 on: October 31, 2014, 07:24:46 AM »
I installed R3.042.020. Changed the default configuration just for input signals and motors. Ran the Digitize.tap. Same result - loops over and over between G31 and G0.  :o

Offline PtD

*
  •  9 9
    • View Profile
Re: G31 causes an endless loop
« Reply #8 on: October 31, 2014, 07:42:11 AM »
Installed R3.042.020 on another machine - that never had Mach3 before. Configured motors and inputs. Same endless loop.

Is there a debug mode I can turn on so that I can report more information for troubleshooting?

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: G31 causes an endless loop
« Reply #9 on: October 31, 2014, 11:39:15 AM »
Just for the hell of it can you remove your license file from the Mach3 folder, move it to the desktop or something - i.e. make sure you have a safe copy somewhere. Restart Mach and check the about box to make sure you're in demo mode and try your wiz code again.

Is there a debug mode I can turn on so that I can report more information for troubleshooting?

All dev and bug fixing has ceased on Mach3.