MarlinFirmware/Marlin

M851, does it work with MESH Leveling?

Closed this issue · 11 comments

This is more of a question, rather than a bug, per se. I am trying to figure out is M851 Z_Offset actually works with MESH. If I need to do a slight adjustment to the leveling grid and M851 does not work, how would you accomplish this?

On a side note, I noticed with MESH when you execute M851 all by itself your response is just an 'ok' and not any number you may have stored in EEPROM for that particular M code. This behavior is different than previous versions of RC's with ABL set. I have only tested MESH on RC4, RC5 and the current RCBugFix and M851 does not appear to do anything.

// Custom M code points
#define CUSTOM_M_CODES
#if ENABLED(CUSTOM_M_CODES)
  #if ENABLED(AUTO_BED_LEVELING_FEATURE)
    #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
    #define Z_PROBE_OFFSET_RANGE_MIN -20
    #define Z_PROBE_OFFSET_RANGE_MAX 20
  #endif
#endif

No AUTO_BED_LEVELING_FEATURE -> No M851

M851 makes no sense with Manual/Mesh -leveling. No probe -> no probe offset.

Mesh leveling has its own Z tuning offset (maybe not in RC yet)

Looks like it is available in both RC and RCFix right now.

Perfect, thanks for the quick response. I will test it today.

We might want to make "Set MBL Z Offset" into its own code (M422?) instead of piggybacking on G29. I think we should probably add a menu item for this too, since we now have a sub-menu for Bed Leveling anyway. And, as long as we're at it, we should have an "MBL Adjustment: On/Off" switch in that sub-menu too.

My thoughts exactly, Offset is offset is offset, why have different ways to express the same value just because a few configuration items are different. It was odd to see MESH use G29 when I expected it would use the already implemented M851. Please pick one and stay with it.

@WheresWaldo As I understand it, the intent of the "Z offset" in Mesh Bed Leveling is different from the "Z Probe Z Offset" as set by M851. The MBL "Z Offset" is meant to be a fine-grained correction across the whole mesh. In contrast, the M851 offset is the Z distance measured from the tip of the nozzle to the "tip" of the deployed probe. So normally the MBL "Z offset" is zero. But the M851 offset is usually a negative number, at least -2 (mm) or more. So really, we can't just use M851 here.

Perhaps programmatically they are all different. But to the end user they may appear the same as they perform similar functions. Thus end users might want to treat them the same with the same G/M-code. It was just a suggestion.

As an FYI my view is from the perspective of a Robo3D user. Its probe design triggering below the top surface of the bed causes the M851 value to always be positive not negative. Regardless, I am sure the community will be fine with whatever the final decision is.

Its probe design triggering below the top surface of the bed...

Indeed, positive M851 values are becoming more common due to these kinds of "probes." The MECHANICAL_PROBE (once added) will always have a positive offset, for example.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.