luc-github / ESP3D-WEBUI

A Web UI for ESP8266 or ESP32 based boards connected to 3D printers / CNC
GNU General Public License v3.0
734 stars 303 forks source link

Implement optional XY/Z Max Jog distance setting #292

Closed aaronse closed 10 months ago

aaronse commented 1 year ago

problem: jogging Z axis 100 on a CNC is recipe for trouble. cause: Most CNCs have relatively short Z axis. For example most V1E CNCs have 80mm or shorter Z axis, but may have 1200 x 2400 XY axis.

image

fix: Implement optional "Z Max Jog" distance setting, enabling user to limit maximum Z axis jog distance. For example 20 makes sense instead of 100mm for Z axis. To avoid breaking existing behavior, the new XY Max Jog and Z Max Jog distance optional settings default to 100 when not specified. Not clear who would use "XY Max Jog" setting, but I added anyway for consistency sake.

Thoughts?

luc-github commented 1 year ago

Sorry I disagree the feature 1 - over move should be handled by cnc fw 2 - this does not handle relative position neither of Zero a e.g: Z is already at 15mm and user do Zero and press 20 but it's max pos is 18mm
3 - it handle Jog not real positions which means max jog is non sense - it should handle max pos 4 - this does not handle the UI , having a max 20 when you have 50 and 100 button is confusing 5 - I agree the 100mm make no sense on laser cnc but it is on milling one, it is hard to fit all configurations -

so I may agree to remove the 100mm jog button but the max jog feature is a false good idea because of above points , even the 20mm button may lead to over move

User is responsible of what he is doing - thinking for him it is recipe of trouble because again you won't be able to anticipate everything

aaronse commented 1 year ago

Thoughts on enabling User to be able to limit/define separate maximum jog increments for XY and Z? That's the intent of the change.

Ideally firmware would limit range of motion to what's physically possible. I don't have time to fix some of the unexpected things Marlin does though. But that's a separate issue to intent of this change, which is make max z axis jog increment more useful. 100mm z move per Z- key press is useless on a machine that only has total z range of 80mm.

Currently ESP3D assumes and thinks User might want to move 100mm on Z axis, this isn't true or useful for laser and most CNC.

The UI not reflecting the max jog limit isn't a big deal in my opinion, but I guess we could edit the 100 button text to display both values. Could enforce lower limit of Max value to be more than 10. Want to keep this simple. Want to improve User experience. Want me to try making UI edits that make sense, avoid User confusion?

Another option is to let User override values used for the 4 Jogging increments instead of assuming everyone wants 0.1, 1, 10, and 100. Letting User define different increment range for XY and Z axis. So, instead of "Z Max Jog" distance we would have "Z Jog Steps" (or better name?) that's a simple comma delimited list, defaults to 0.1,1,10,100. I personally don't think this much flexibility is needed. I am new and know nothing. What feedback have Users asked for? Have they asked for configurable jog increments before? If not, then simple max jog distance limit would be good enough for now?

Guessing just a simple limit to max jog of XY and/or Z is something that most laser and CnC Users will appreciate.

As-is, the current pull request fixes a specific issue people with laser and CNC encounter. Thoughts on better solution to this existing problem?

I keep forgetting to thank you for your time and guidance. Thanks Luc!

luc-github commented 1 year ago

I still believe you try to fix position problem (absolute coordinates) with jog limit (relative move) which is wrong approach

on cnc 100 is just value on a selector for x y z jog

your screenshot show 3d printer UI which is different system, so I am confused

my only suggestion would be to just change initial default value from 100 to 1

let currentJogDistance = 100

it should prevent the people that click jog without paying attention to move too much.

no need anything else, user can change this value anytime

aaronse commented 1 year ago

Ignore ESP3D UI on picture, sorry for confusion. I shared machine picture to help show scale/dimensions of xyz we usually have.

Imagine... You're a CNC User trying to jog sharp bit using keyboard shortcuts. You don't click on the UI. You don't even look at the UI, your eyes will be focused on the sharp bit during jogging to make the bit barely touch the top corner of the expensive wood you want to cut...

You home xyz using key shortcut. Homing Z raises sharp bit to highest position. You want to jog XY to somewhere in the middle of 1200mm x 2400mm work area, the corner of your expensive wood stock. It's a long way from xy home, so you set jog increment to 100. After keyboard jogging over, now that XY is correct, you want to jog z axis down to top of stock being cut (max Z - stock thickness).

Disaster! You accidentally pressed Z- shortcut, but forgot to change jog increment, it was still on 100 from when you did XY move. Now the sharp bit is heading down to stab your expensive wood. Quickly, you jump up to abort/reset to avoid damage.

You reset just in time, now you wait... You wait for CNC/ESP3D wifi to reboot, and wait for your tablet/phone to reconnect. You wait, wondering when pull request #292 will be resolved to enable configuring smaller max jog distance per keypress for z axis 🙂

luc-github commented 1 year ago

it may be same for 20 / 50, your solution won't solve it because again the issue is not max jog but max position, and unfortumatly this cannot be handled easily using remote UI 1 - need to be sure of current position before send the jog command 2 - calculate if current position + jog is not out of machine limit and this for each jog

for me your issue should be handled using soft limit and https://github.com/gnea/grbl/blob/master/doc/markdown/settings.md#130-131-132--xyz-max-travel-mm

aaronse commented 1 year ago

the issue is not max jog but max position

Max position limits not being supported/enforced by Marlin firmware is an issue/limitation. But that's a separate issue that I'm not trying to resolve. I know enough to know I don't know how to quickly solve the max position issue at the Marlin firmware level. Honestly, I also don't want/need to fix that problem, for now at least.

This pull request is addressing ESP3D assumption/limitation that Users to jog Z 100mm with a single key press. This is an action that makes no sense for most CNC machines. My machine is a decent size but still only has total Z range of 80mm. Z jogs are slow, so being able to configure something between 100 and 10 is helpful.

This change enables Users to customize jogging behavior to better fit their build and preferred work style, for example, they can set Max jog to 20mm for Z axis, if they chose.

Repetier-Host does something similar already, notice how max XY jog distance (50mm) and max Z jog distance (10mm) are different.

image

image

Am coming from Repetier and trying to merge features that help Users. Cheers!

Edit: Am looking into improving UI to be clearer if max jog distance default of 100 has been overridden...

aaronse commented 1 year ago

Sending edits that will render default or overridden Max Jog distances in a way that is clear and useful.

image

image

luc-github commented 1 year ago

you talk about CNC or Marlin/repetier ? and again you display printer UI when talking about CNC - that is confusing

the current ESP3D CNC UI is based on other CNC UI not 3D Printer because users did not liked in previous version

the choice to make one distance selector is based on one place to change setting to be easy for phone / mobile, having big button and simple UI

For custom feature / distance - macros / macro buttons are made for this, even more now shortcut are supported , UI is generic on purpose and macro allow to customize the feature user want - I do not see the point to let user customize jog distance, if as you wrote he does not look a UI - in that case doing his own macro/shortcut is the way to go

In all case max jog distance is not the way to go, for grbl / CNC I gave you the settings to avoid the issue you mentioned

For custom distance - macro feature is already existing

I am sorry I do not get your point

luc-github commented 1 year ago

And to be clear - the UI is definitly not perfect and has lot of areas of improvements - but these improvments must be clear, address issues / problems clearly, and be properly implemented. I am the one who do support I have to time to handle feature that bring trouble/questions

if need a second selector of distance for Z or even another one for (A/B/C/...) on cnc - because of most of user case =>Ok if need a second selector of distance for Z or even another one for (A/B/C/...) on cnc - because of few user case =>Not Ok to increase code for edge cases if need a new UI because user do not watch the UI doing things => it is wrong approach

If you look at user proposal : https://github.com/luc-github/ESP3D-WEBUI/issues/144#issuecomment-765903746 or even https://cnc.js.org/ none has different selector according axis, if you look at UGS https://winder.github.io/ugs_website/ yes it has, so actually there are different choices

luc-github commented 10 months ago

closing because of https://github.com/luc-github/ESP3D-WEBUI/pull/292#issuecomment-1377176389