Questions about CNCjs operation

I have been using CNCjs as my gcode sender. So far, I am pleased with the results. However, one thing really lacking is clear directions as to how to use various functions. Below are several areas I could use help with:

  1. Machine zero and work zero - I home my machine and then attempt to set the machine zero using the zero button for each axis in the machine position area. They do not set to zero. They remain at whatever setting it has. When I move the spindle to setup my work zero, I can set the the work zero without issue. Looking at machine position, the values have changed from what they were when homed. So far, this has not been an issue in my work, but I would like to know where I am relative to home. What am I doing wrong in attempting to set machine zero after homing?

  2. Soft Limits - How do you set up soft limits with CNCjs? I have found information on what settings are used, but I would like to know the steps taken to make soft limits work.

I dont use CNCjs.

Homing = Machine zero

Performing a Homing cycle = machine “zero”. This syncronize machine coordinates with work coordinates. The machine position may be negative or postive but dont really matter.

Setting each axis to zero as you mention apply only to work zero, which is stored as an offset to machine zero.


  • Home the machine
  • Jog to your intended work zero position and zero all axes there
  • Carve

Soft limits:
When soft limits are enabled, GRBL value $130-132 define the distance from machine zero the safe limit is.
Any carve/jog command touching outside this range will prompt an alarm state.

As @HaldorLonningdal said, machine zero is defined by your homing switches. Depending on how your version of grbl is configured, that zero might be back right or front left or somewhere else.

$20 = 1


Thanks for response. About soft limits, I understand that with soft limits you set $130-132 with the xyz dimensions in mm for the machine area and $20=1 to enable soft limits. I assume what you said about machine zero for home that it will add these dimensions to the machine zero to establish the soft limits. Correct?

Once the soft limit has been set off, how do you clear the alarm to proceed?

Yes, once the machine have done a homing cycle the values defined in $130-132 specify the allowed distance from machine position/reference.

To clear alarm you simply re-home $H. (or issue a $X command that clear the alarm, then re-home)

after you home the machine shut down cncjs and restart it. The machine will now read 0,0,0 very simple.I can not figure out why the buttons for that do not work. Then go to your work zero and set those. I have recently ran into a real nice program to rezero your tool height after a tool change. I will post more about it when I get a chance.

They send commands not intended for GRBL-based machines.

I use the X-carve and cncjs. Arduino with G-shield. Whenever I home the machine I get a reading like -740mm -740mm for X and Y and something else like 1.01 for Z. If I shut down cncjs (the program only) and restart it, the machine position now reads 0,0,0, Then move your tool where you want the work zero to be, how ever you do that, If using a touch block it will calculate where the zero is and on the top set of 3 dots on the work side of the axis block one choice will be to move to work zero, if you do it manually then once you are at where you want the work 0,0,0 look on the right side where the x, y, z, work coordinates are there are 3 vertical dots by each axis, click the dots and you will get 3 choices. Choose to set X,Y,Z, axis to Zero. Each one individually. The only buttons I have trouble with are the ones that set the machine numbers to Zero as you pointed out. All other buttons work for me. Check which version of cncjs you have. Hope this helps out some. Do you use homing switches, I do. I have nothing set up in the soft limits that I know of. It can be so frustrating getting the simple things worked out. Oh yeah. My homing position is left front (closest to me) however that should not make any difference.

Hey Gary,
Machine zero, by default, is back right. If you’re homing front left, it makes sense to have those negative machine values.
You cannot reset machine zero on grbl based machines.
That step of reading your controller to reset machine zero is unnecessary. Referencing back right to get your offsets is normal. You just set your work zero and go. You need to be careful if you use G53 or G28/G30 as those also reference your machine zero. Although probably not an issue in most cases, you might lose position when you power down and reset.
Like I said above, the reason the “zero machine” buttons don’t work in CNCjs is because that feature is for controllers that use tinyG, not GRBL.

I agree 100%. On the X-carve the homing switches are for the front left. Your original post was for problems getting Machine to read 0,0,0 so I was just trying to give you a work around not knowing exactly where you home your machine. That was all. Thanks.

@GaryWolfe I was just trying to help too. I think you got me mixed up with the original poster.

What’s this one about? I’m a big fan of making tool changes easier. I have a pretty good workflow now, but I’d love to see what you do.


There is no need to have the machine coordinates read 0,0,0 - it is not a requisite, nor related to work/material zero
Its arbitrary without a reference point (switches).

As long as the machine have done a homing cycle, it is now syncronized to the model enviroment the controller is defined to reach. So wether it home far right or front left, with machine coords reading 0 or negatives, it does not matter :slight_smile:

1 Like

I am so sorry, you are right. I really screwed that up.I was wondering if somehow I had the wrong person. I will post more later but I found the tool change on github cncjs I think and it has the code for changing a tool and getting the right height as long as you use a touch off block or piece of metal. It allows you to get the right height if you mill away the area that you would normally set a touch off block or the top surface.

Yes numbers do not matter but some people prefer to work in positive numbers as we all learned on school using graph paper and dividing it into 4 quadrants… rather trying to figure out positive to negative quadrants.Depending on your industry and meterial you are working with everything is different.

@GaryWolfe Haha…I bet you’re talking about the macros I wrote.

When I get some time, I’ll post some info about the macros.

I did not see who wrote them. I did not pay that much attention to that part. If you did write them you are so DAMN good and I am a fool, LOL. It is excellent and makes things so much better. Thank you for your hard work. I know it is not easy and took me a while to figure it out since I am such a idiot. Gotta like dumb A**es like me. Thank you again.

1 Like

Looks like the one I used was by Vincent Coffey. I will have to check yours out and see what the difference is. Either way thanks for your hard work. Everything I said still stands. Yup I am a Dub A**.

That was my old version. I went away from the G43.1 tool length offset to using a simple and persistent G10L20. The nice thing about the newest versions linked above is that you only probe once with each tool. Let me know if you try it out have questions.