To help level the bed the firmware provides the Manual Bed Levelling Assistant (MBLA) and Auto Bed Levelling (ABL).
The Manual Bed Levelling Assistant helps you to level the bed of a Cartesian, CoreXY[UV] or SCARA printer using the manual adjusting screws on the bed itself, when you don't have multiple independently-driven Z axis motors to do it for you, i.e. Auto Bed Levelling (ABL).
MBLA relies on your printer having adjustment screws of some sort that you can turn by hand to level the bed. Like Mesh Bed Compensation (MBC), it probes the bed but the result is information on how much to turn each adjustment screw to level the bed. It normally takes several iterations to get the bed truly level.
Mesh Bed Compensation (MBC) is intended to compensate for irregularities in the surface of the bed. As a result it also compensates for a bed that is not level BUT it is better to level the bed as best as you can and then rely on MBC to deal with bed surface irregularities.
ABL relies on your printer having multiple Z axis steppers that the firmware can use to level the bed. Again, like MBC and MBLA, it probes the bed but the result is stepper movement that works to level the bed. Sometimes it can take more than one iteration to get the best result.
MBC and MBLA/ABL work together to improve the performance of your printer.
This guide is specific to Manual Bed Levelling Assistant. Other guides for MBC and ABL can be found here:
M558 P0to indicate you will manually adjust the nozzle down to the bed (using the paper feeler test or similar).
A valid M671 command enables the bed levelling assistant. When you run G32 to perform bed probing, the final G30 command (the one with the S parameter) in bed.g will cause the assistant to run. It uses a least squares algorithm that minimises the sum of the height errors at the probe points. The amount by which each screw should be adjusted is reported. The adjustment requested for the first screw is always zero.
You can run G32 again to repeat the process.
The process typically causes a small shift in the Z=0 position. To correct this, if you are using the Z probe to do Z homing, you can just re-home Z after making the adjustments. Otherwise, do a single G30 probe at the centre of the bed to set the Z=0 position.
... M671 X-15:100:215 Y190:-10:190 P0.5 ; adjusting screws at rear left (-15,190), front middle (100,-10) and rear right (215,190), thread pitch 0.5mm ...
G28 ; home M401 ; deploy Z probe G30 P0 X20 Y190 Z-99999 ; probe near an adjusting screw G30 P1 X180 Y190 Z-99999 ; probe near an adjusting screw G30 P2 X100 Y10 Z-99999 S3 ; probe near an adjusting screw and report adjustments needed M402 ; retract probe