Is there a way to set up a software limit in usbcnc so that the spindle can not go any further than the set limit. I do not have homing switches on my machine and currently I'm running the machine in the middle of the bed so I have no fear of crashing into the x negative and positive limits. And no chance of hitting the y negative and positive limits as well. But because I have a 4 axis machine, my z axis gets hit on the negative (up) frequently because it only leaves me about 20 or 30 mm of travel from the top of the part. And that's a generous estimate.

Is there a way to set the software with a ceiling so it won't allow the z axis to go any higher than a certain height. I realise I may have to reset this limit each time I run a part but I'd rather do that than ruin expensive parts on my machine.

Yes I'm aware homing switches are cheap but I don't have the money to buy them right now and unless someone is sending me some free ones that won't work.

So I need a software based solution. Is there anything like that built into usbcnc or a workaround I can use to do it?

Thank you in advance.