So here’s my attempt at doing a leveling matrix larger than 3 x 3. Please be advised that this is not for the faint of heart. If you mess up this process you can bury your nozzle into your print surface. I know, I did. I’ll try and tell you how to avoid that. If you aren’t having any trouble with the first layer of printing then this process isn’t for you. I am doing this on an A250, so you may have to change some things for your size Snapmaker.
The controller has a version of leveling that the Snapmaker uses. It’s “G1029”. Like the G29 it is a modal type process where you start the process, do the leveling, do the Z offset, then end the process. I think it is just a “G29” wrapper and actually calls the normal Marlin “G29” to do most of the work. You can put these commands in a GCODE file or you can use Luban’s built in Macro widget. I find the Macro widget convenient because you can do the editing and execute it right in the workspace. I use two different Macro’s, one to start, one to end. You have to do the Z offset manually in between the two.
The matrix definition:
G1029P5
Notes: I just do this manually on the console. The “5” in this example is defining a 5 X 5 matrix. You can create up to an 11 x 11 matrix! If you do a “M420V” right after this command you will see that the matrix size has changed. At this point in time the old matrix values will still be there, the rest of the matrix is just filled with zeros.
The “Level” macro:
G0Z230F6000
G0X0Y250F6000
M190S70
G1029A
Notes: The first two commands just get the print head up close to home. The “G1029A” command will want to do a “home command” (G28). The third command turns on the heat and waits till it’s up to temperature. I’m turning on heating because I want the matrix to compensate for heat change. You may want to use a different value there. The G1029A will turn off the heat so the matrix won’t be perfect as in this example it drops to about 50 by the time the process has completed. The “A” in the command is telling it to start the Auto level process. The G1029A will do the grid scan and stop at the end point where you need to set the Z offset value. It will use that value to shift the matrix to the correct Z level. You can use the “Control” mode of the Touch Screen in the “Axes” tab to move the head to that location. BE AWARE that the movement levels are 10X the ones normally used in leveling. You can create a Z-.05 macro to do smaller amounts if you want. You’re using the console with manual commands, macros, and the Touch Screen all at the same time.
The Z offset:
Use the Touch Screen to move the head down until it is touching the test card. I find that you have to move down somewhere around 5.4mm. Your printer may be different because of how your sensor is located. Because of backlash I usually go down until there is resistance on the card and then move back up .1mm (or .05 if you have a macro set up). As the head moves around in normal printing the Z backlash will tend to settle out, although if you have a thin layer being printed, the pressure of the filament coming out of the nozzle may push against the bed and allow movement of the head in the positive Z direction. Once you have the head in the right Z position you are ready for the finish.
The “FINISH” macro:
G1029S
G1029D0
M420V
Notes: The S does a save of the Z offset and the matrix values, the next line, the D0 (that’s a zero, not an “Oh”) This is meant to do an additional “Delta” offset that shifts the matrix by the value of the “D” command. That value has to be in the range of 0 to 1mm. I’m not exactly sure what this is useful for but the “D” command does appear to end the leveling process and ends the leveling mode, turns the “level enabled” on. The M420V is just there to print out the new matrix on the console. It can be omitted.
At this point in time the matrix is now there and active. It hasn’t been saved into EEPROM yet. You’ll have to do a “M500” command to save it. If you have Auto Level turned on it will replace your matrix with the standard 3 x 3.
Now, I have an additional macro that does a “TWEAK” of the matrix as I find the matrix is still not perfect. (Still investigating why) It is basically incrementing the matrix values by the values I measure with my Dial Indicator “Check Level Ind.gcode” file. You can also determine those values using my “Check Level.gcode” file. It takes a different version that is sized for the matrix size I’m currently experimenting with.
The “TWEAK” macro:
M421 I0J0 Q-.03
M421 I1J0 Q-.03
M421 I2J0 Q-.07
M421 I3J0 Q-.04
M421 I4J0 Q.00
M421 I0J1 Q-.11
M421 I1J1 Q-.10
M421 I2J1 Q.02
M421 I3J1 Q-.18
M421 I4J1 Q-.01
M421 I0J2 Q-.02
M421 I1J2 Q-.02
M421 I2J2 Q.00
M421 I3J2 Q-.07
M421 I4J2 Q-.15
M421 I0J3 Q-.10
M421 I1J3 Q-.02
M421 I2J3 Q.11
M421 I3J3 Q-.15
M421 I4J3 Q-.01
M421 I0J4 Q-.02
M421 I1J4 Q-.02
M421 I2J4 Q.08
M421 I3J4 Q-.02
M421 I4J4 Q.18
M420V
Notes: As you can see by the values in the “Q” that is how far off my matrix is. YOUR VALUES WILL BE DIFFERENT. Your file will have to include more or less M421 commands to match your grid size. This example is a 5 x 5 and so there are 25 commands. The “I” & “J” values are the matrix address of each point and correspond to the X & Y directions. The values go from 0 to 4 for a 5 x 5 matrix.
So in conclusion, a larger matrix won’t be the end of your leveling problems, it might just be the beginning!! Because the matrix still isn’t perfect that means you have more points to “TWEAK”. You may still be better off just trying to improve (tweak) your 3 x 3 matrix values. I’ll be posting a new and improved “Check Level. gcode”.
EDIT: How I buried my nozzle into the bed, I didn’t end the level process correctly and as a consequence it thought it was in a different location that it really was. This was because I still didn’t understand how to end the leveling process. When it’s doing the level it is in what they call “raw” position mode. The Z zero position is actually 3+mm or so below where your are when the leveling is turned on. Normally it won’t let you go below Z0 but when you’re in leveling mode, that zero is lower. As a consequence I tried a move that pushed it into the bed.
A BIG thanks to the Snapmaker team for all their help and for making the source code available. I hope they’re not upset with me revealing this matrix stuff. They may have some comments on it where I’m off base.
EDIT: See this post for a Google Sheets help file.