winder / Universal-G-Code-Sender

A cross-platform G-Code sender for GRBL, Smoothieware, TinyG and G2core.
http://winder.github.io/ugs_website/
GNU General Public License v3.0
1.84k stars 758 forks source link

Allow soft limits without limit switches #2495

Open agowa opened 3 months ago

agowa commented 3 months ago

Description

Hi, please allow specifying soft limits without limit switches. I also do not quite understand what good "soft limits" are when you've actual limit switches. For me they're only ever meaningful when you don't have limit switches. What am I missing? Can someone please explain?

image

Here soft limits cannot be enabled because homing cannot be enabled and that cannot be enabled because I don't have limit switches and therefore disabled them. If I'd enable them as well as homing using some dummy config (default values) I'd be able to configure soft limits. But do they do what I think they do? As that would be very counter intuitive in that case then especially because soft limits shouldn't have a dependency on limit switches then.

breiler commented 3 months ago

Read the documentation about soft limits here: https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration#20---soft-limits-boolean

Soft limits requires the machine to be homed, and for that you need limit switches.

Additionally the limit switches can also work as hard limits, the setup wizard is currently depending on having hard limits enabled which is wrong. I have just not got around to fixing this yet.

The purpose of being able to disable hard limits can be as a work around if your limit switches are being falsely triggered due to EMI from spindles or other high powered periphials.

agowa commented 3 months ago

I don't know how else the thing I want is called. But all I want is to have the software be aware of the limits of the machine and not tell it to move beyond its capabilities.

I can see the status values in the software, so I should also be able to have the software bail out when I try to move to an offset that is outside of the safety region.

breiler commented 3 months ago

It sounds like the feature you want is "soft limits" but without using a reliable method of referencing the machine zero position using limit switches.

It should technically be possible to make UGS keep track of machine position and limit sending any command that exceeds a defined max/min. This would require you to start your machine in a specific corner which will become your machine zero position. You would then need to configure UGS which directions it can move and how far.

This would however be a huge task to implement since it would require UGS to convert the command to be sent to a machine coordinate applying any offset (such as work or tool offset).

It would be a handy feature for beginners getting started with CNC:s. But if I am being honest this is nothing I will prioritize since the time for me to implement this will far exceed the time for you to slap on three limit switches to your machine. 😄

agowa commented 3 months ago

What do you mean without "a reliable method"? If manually zeroing before starting a job is reliable enough to do the job then it is also reliable enough for a soft limit. Or not?

(Also just fyi I'm using absolute positions)

breiler commented 3 months ago

What do you mean by "If manually zeroing before starting a job"?

If you power on your controller when the spindle is positioned in your machine zero position that could technically be the same as a freshly homed machine and could be considered "reliable enough". But as stated in the GRBL documentation that I sent you earlier, you should use homing in order to use soft limits.

agowa commented 3 months ago

With "If manually zeroing before starting a job" I mean ensuring to manually home the machine by using the Jog controller and a ruler to move it to where 0,0 should be (as almost always you want to engrave at a specific location you'll have to ensure that you start at the correct point either way).

Maybe an example make it clearer. You have a 8x8x5 block of aluminum and want to remove a 4x4x4 cube from it's center. How else would you be able to ensure it is exactly in the center?

breiler commented 3 months ago

Ok I understand, you were writing about setting/zeroing work coordinates and not homing.

Lets say that you zero the work position somewhere on your aluminum block, how would UGS know how far it can move based on that position?

agowa commented 3 months ago

Entering manually?

In addition to me manually setting the zero work position I'd like to be able to manually set soft limit coordinates. I.E. coordinates the machine does not try to go beyond.

Also isn't homing just the machine zeroing itself automatically?

breiler commented 3 months ago

I will not prioritize working on such a feature as it is already present in your hardware. I'll leave this feature request open in case anyone else wants to take a stab at it.

As I have already explained (and also linked to documentation), the only thing you need is three limit switches, enable homing so that the machine can find its zero position and enable soft limits defining the max work area.

https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration#22---homing-cycle-boolean https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration#20---soft-limits-boolean

agowa commented 2 months ago

I will not prioritize working on such a feature

Understandable, as probably most people have the switches and sensors I assume?

the only thing you need is three limit switches

The machine doesn't have them. There are also no mounting holes for them. However I ordered them, lets see if I can diy them on somewhere (and I also checked, you're right, the controller does have everything for them already. Even the connector is already soldered on).