Cncjs locks up running gcode

I received excellent suggestions to switch from a laptop/Windows running Universal Gcode Sender to Raspberry Pi/Linux running cncjs. For the most part this was a good move. But I have two issues that persist. I am generally engraving wood but the problems are not unique to engraving.

  1. gcode program (XXXXXX.nc generated by Fusion 360) runs perfectly, Z5 lifts the cutter away from the wood and program stops but does not end. I can Pause but the Stop and Delete (X) buttons are greyed out so cncjs is locked up. I can only open and close the connection to the Arduino to release cncjs, then I must re-home the device. Reset and Unlock buttons send the proper commands but do not unlock cncjs.

I can run the same program again and then, when I hit Pause, the Stop and Delete buttons are active and I can end the program, get CNCjs control and continue on without Homing. Outcome is a crapshoot.

  1. gcode program runs perfectly to within twenty or so instructions from the end of the program and then just stops. Typically, during engraving, this is just before the V cutter performs the final cuts that would square the corners of the last letter in the text being engraved. Run the program again and it stops in exactly the same place.

As in 1) above, the CNCjs is typically locked up and I must Open/Close the connection and re-home.

I believe it has something to do with false soft limit alarms as that is the error message but the machine is within limits and Reset/Unlock should clear this condition but does not.

I have been limping along like this for some time but the artifact in the letters is forcing me to solve the problem. I am not an expert in cncjs or Linux but I built my router from scratch so I understand all the pieces of the puzzle fairly well.

Any suggestions?

I guess that either my post didn’t make sense to anyone or no one had any suggestions. In any case, I set soft alarms Off ($20=0) and my problems went away. The program ends properly and the router goes back to home:
G28 G91 Z0
G90
G28 G91 X0 Y0
G90
M30

These commands never seemed to execute before disabling soft alarm limits. Since the alarm extents ($130-132) were set up properly, I don’t understand why $20=0 or 1 makes any difference.

That said, I have not tried to Engrave yet to see if the machine completes the last letter in a string of text properly. This error is still a mystery as well… how does the program know with prescience that it is on the last feature of the last letter? There is nothing out of the ordinary in the gcode that I can see.

I will continue to reply to myself as I learn more. Still looking for any suggestions out there though.

Interesting.

Yeah. I didn’t really understand the issue and the stuff I got didn’t give me any ideas. I am glad you got it and reported the fix.

I am going to try to re-explain my problem because it isn’t fixed. Since disabling Soft Alarms, my gcode programs seem to run to the end now. Z retracts to the Safe position, then to the Z home position and X/Y home as well. This never happened before disabling Soft Alarms.

However, after these sequences, the program acts like it is still running. I can’t stop or end the program because the two buttons (the square and the X) are greyed out. The Reset and Unlock buttons work and appear to send code, but there is no change to the machine status. I can manually issue an M30 end of program command but this does not do anything either. The only thing I can do is Open and Close the connection to the Arduino. Then I can close the program but now must re-Home the device.

I never had these problems with Universal Gcode Sender, running on my laptop, but never tried it with the Strawberry Pi.

Is there something I am doing wrong with CNCjs? Why did disabling Soft Alarms fix the problem of premature stopping of my gcode program sequence? Why is CNCjs locked up after my gcode program has run to completion?

I cannot unsee this :slight_smile: . It is really rewriting pathways in my brain.

Can you jog or anything? That seems weird. But I honestly haven’t tried running two jobs in a row on cncjs.

Are you using Marlin or grbl? You mentioned UGS, but I haven’t ever tried that with Marlin.

I’ve run at least ten jobs in a row without issue.

1 Like

@kcny, do you use marlin or grbl?

Marlin

Running the dual LR firmware on an skr 1.2 and using v1pi.

1 Like

I’m running grbl.

1 Like

Hmmm. My impression was that grbl worked pretty well with cncjs. The version in v1pi is pretty old now (sorry, I haven’t gotten back to this project in a while). You vould try updating it. Or, take a close look at the console log. Maybe one of the grbl users around here will pop in with some info on what it is thinking.