10
$\begingroup$

I have been reading through the Marlin website about ABL (Auto Bed Leveling) and I see what appears to be conflicting information.

The Marlin docs on "Automatic Bed Leveling" state that running G28 (Auto Home) will turn off ABL and that to reactivate it you need to insert the code M420 S1.

After a G29 bed leveling is automatically enabled, but in all other situations you must use M420 S1 to enable bed leveling.

However at G29 - Bed Leveling (Manual) of the Marlin G-code manual) it states:

G28 disables bed leveling. Follow with M420 S to turn leveling on, or use RESTORE_LEVELING_AFTER_G28 to automatically keep leveling on after G28

The latter is referring mostly to manual bed leveling, but in this section is referring to ABL.

So what is the difference between the S and the S1 options?

$\endgroup$
0

1 Answer 1

10
$\begingroup$

TL;DR

Short answer: "There is no difference!".


Long answer

G-code is parsed line by line. The parser in the firmware reads the command and the options (also called parameters) following it, comments are discarded.

Therefore, option S should be followed by a Boolean value 0 for False or 1 for True. Without a value it is undefined and should be reported as incorrect or treated as false (in my opinion). But, the developers have chosen differently. If a Boolean value is expected and the value is not given, the parameter is parsed as true. This has analogy with other software options or switches like e.g. used by Linux commands.

This means that for Marlin the G-code M420 S is exactly the same as M420 S1.

I've checked this with another command (this is not depending on the G-code command as there is a single parser processiong the G-codes and the following parameters); M211 where M211 S is exactly the same as M211 S1.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .