Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leveling edge distance count from zero position #2267

Closed
wants to merge 1 commit into from
Closed

Leveling edge distance count from zero position #2267

wants to merge 1 commit into from

Conversation

NOVAXIM
Copy link
Contributor

@NOVAXIM NOVAXIM commented Nov 25, 2021

Description

Currently, during manual bed leveling the edge bed coordinates are counted from the minimum value if >=0 (Home position). Unfortunately, when we have coordinates other than 0 at the Home position (e.g. size_min:X-10 Y-5), the physical edge positioning will is faulty. With level edge distance value at 20, the lower left corner will be at real position X10 Y15, not X20 Y20 (liked in Marlin). The last fix did not completely delete the problem.
Positioning with manual leveling is an internal affair of TFT Firmware and should not be fixed otherwise as here.

Benefits

This solution calculates the correct bed edge coordinates for manual leveling regardless of:

  • Marlin version,
  • M115_GEOMETRY_REPORT Marlin option,
  • end stoppers position.

The level_edge_distance will be counted from true 0 position (liked in Marlin). For example, if you have size_min: X-5 Y-18 and level_edge_distance: 30, the lower left leveling point would be at real X30 Y30 (liked in Marlin). This applies to all corners and center point too (if you have the correct size_max).

Note: When you have enabled M115_GEOMETRY_REPORT option in Marlin, then don't need to set size_min and size_max. However, if you don't have M115_GEOMETRY_REPORT option in Marlin, then you then you have to enter values for size_min and size_max in file(s): config.ini and/or Configuration.h.

Related Issues

#1151

@NOVAXIM
Copy link
Contributor Author

NOVAXIM commented Nov 25, 2021

I just finished checking on my printer and this solution works like this:
Leveling-from-real-0

@digant73
Copy link
Contributor

In case of max endstops, maxX and maxY cannot be satisfied (even by the current solution). Also infoSettings.machine_size_min[X_AXIS] - infoSettings.machine_size_min[X_AXIS] and infoSettings.machine_size_min[Y_AXIS] - infoSettings.machine_size_min[Y_AXIS] is always equivalent to 0

@radek8
Copy link
Contributor

radek8 commented Nov 26, 2021

Isn't it better to upgrade to Marlin which doesn't contain an error?

@NOVAXIM
Copy link
Contributor Author

NOVAXIM commented Nov 27, 2021

In case of max endstops, maxX and maxY cannot be satisfied (even by the current solution).

I don't understand well. Can you write what you mean?

In my situation I have:
infoSettings.machine_size_min[X or Y] liked end stop position (at me is X-10 and Y-5),
infoSettings.machine_size_max[X or Y] liked bed size.

My revision counts level_edge_distance from real zero position. What is wrong?
I have this sam place in Marlin mode for all corner leveling points and center leveling point.

@NOVAXIM
Copy link
Contributor Author

NOVAXIM commented Nov 27, 2021

Isn't it better to upgrade to Marlin which doesn't contain an error?

What's the bug in Marlin?!
Which version does not contain an error?
Why do you negate the solution that correctly counting point level_edge_distance?

Does my solution work badly with the latest version of Marllin?
Please report me here when it is.

Note:
My printer show X-10 Y-5 after start (flashing before homing) and all is right. My printer go to home before position at the leveling point. Everything works as it should. I am satisfied.

@NOVAXIM
Copy link
Contributor Author

NOVAXIM commented Nov 27, 2021

Marlin has nothing to do with this, because the formula for the manual leveling position is based on internal variables. Is it so hard to understand?!

@radek8
Copy link
Contributor

radek8 commented Nov 27, 2021

Marlin has nothing to do with this, because the formula for the manual leveling position is based on internal variables. Is it so hard to understand?!

Open the terminal, send the M115 command to the printer and send the answer.
I'll show you where the problem was in Marlin.

Marlin "Nightly" Builds on August 21 and later should be repaired.

I also have negative stops on the X and Y axis, and I had the same problem as you, but with the Marlin update it is solved.

@digant73
Copy link
Contributor

@NOVAXIM please see my answer on your previous PR. The current solution is already fixing the case were min must be "at least" 0. That approach should also be applied to max (in case there are max endstops) but that is impossible because we have no info about the real bed size. For that reason a gave the possibility to set min even greater than 0 (because you can also set max lower than the real bed size)

@NOVAXIM
Copy link
Contributor Author

NOVAXIM commented Dec 5, 2021

I'm sorry you waited so long. This is the printer's response to the M115:
area:{full:{min:{x:-10.0000,y:-5.0000,z:0.0000},max:{x:220.0000,y:220.0000,z:250.0000}},work:{min:{x:-10.0000,y:-5.0000,z:0.0000},max:{x:220.0000,y:220.0000,z:250.0000}}}

@radek8
Copy link
Contributor

radek8 commented Dec 5, 2021

Here is a bug in the old version of Marlin
The workspace starts at zero, not a negative value.
Update Marlin and it'll be fine

image

@radek8
Copy link
Contributor

radek8 commented Dec 5, 2021

TFT reads bad values from Marlin
see
#2128
MarlinFirmware/Marlin#22598

nirim000 added a commit to nirim000/BIGTREETECH-TouchScreenFirmware that referenced this pull request Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants