Adding Pauses to G Code Files for duty cycle (Solved Slowed down rapids instead of adding pauses)

The code is designed to analyze your source file and look for ‘G0 Z1’ which is at the end of every cut loop. It counts the number of instances of ‘G0 Z1’ and returns that as the number of cuts in your source file.

Then it creates a new file and adds the additional commands to each cut loop based on the options you select.

However if your file does not have ‘G0 Z1’ in the loops then it will not work. All of the files I have generated have G0 Z1 in each cut loop so I’m not sure why it’s not working for you.

FYI below is a snippet of the code that analyses your source file:

Dim stringReader As String
cutcount = 0
While fileReader.EndOfStream = False
stringReader = fileReader.ReadLine()
If stringReader.Contains(“G0 Z1”) Then
cutcount += 1
End If
End While

        Label5.Text = "The Total Number of Cuts in the Source File is " & cutcount
1 Like

With fire control closed, open the serial port with putty at 115200. Type $$ to see all the settings.

The Grbl setting that controls the maximum rapid speed (G0) is $110 for the X-axis, $111 for the Y-axis, and $112 for the Z-axis, which define the maximum rate in mm/min for each respective axis.

These settings determine the upper limit for rapid movements, which are executed using the G0 command.

Change $110 and $111 to slow x and y rapids.

Syntax $110=1000.0 where 1000.0 is the speed you want. Don’t make any mistakes, backspace is not supported.

If successful, you’ll see OK, otherwise some error code. Then change y $111. You can always change these back. Changes are stored in EEPROM and stay in machine.

Save all the controller settings somewhere in case you need to restore.

Are you using Fusion360 to create your G-Code?

Here’s a snippet of the G-Code, I manually added the G4 P.2 after the M5.

(2D Profile1)
G0 X25.071 Y111.033
M3
G4 P1.2
G1 X23.566 Y108.987 F2032.
G3 X29.266 Y111.485 I2.85 J1.249 F2032.
G3 X23.566 Y108.987 I-2.85 J-1.249
G1 X26.091 Y108.707
M5
G4 P.2
G0 Z25.4

G0 X64.015 Y111.943
M3
G4 P1.2
G1 X62.08 Y110.298 F2032.
G3 X66.952 Y111.19 I2.436 J0.446
G3 X62.08 Y110.298 I-2.436 J-0.446
G1 X64.473 Y109.445
M5
G4 P.2
G0 Z25.4

Ah. So it looks like you don’t use IHS (Initial Heigh Sense) in your Fusion360 Post setup.

I’m using a CrossFire Pro with IHS. At the end of each cut, my machine retracts to 1 inch above the work piece (Z=1) and then touches the piece on the subsequent cut to reset the cut height for each cut. This is an upgrade over the original Crossfire as I understand it and produces better results if the material to be cut is warped etc.

I exploited the ‘G0Z1’ at the end of each cut to write all the code for my program.

If you are not using IHS with a retract height of 1 inch, then my program won’t work for you.

Here’s a screenshot of my Post settings in Fusion360:

Also here’s a few lines of one of my G-Code files from Fusion360. They are different from yours because it looks like you aren’t using IHS.

(v1.6-af)
G90 G94
G17
G20
H0

(2D Profile2)
G0 X0.04 Y1.8455
G92 Z0.
G38.2 Z-5. F100.
G38.4 Z0.5 F20.
G92 Z0.
G0 Z0.04 (IHS Springback + Backlash)
G92 Z0.
G0 Z0.15 (Pierce Height)
M3
G4 P1.
G0 Z0.063 (Cut Height)
H1
G3 X0.116 Y1.8078 I0.0569 J0.0191 F10.
G3 X-0.116 Y2.4975 I-0.116 J0.3448 F10.
G3 X0.116 Y1.8078 I0.116 J-0.3448
H0
M5
G0 Z1.