MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.29k stars 19.24k forks source link

Usage Question: How to use LCD only for manual UBL mesh creation? #6961

Closed WheresWaldo closed 7 years ago

WheresWaldo commented 7 years ago

I think this question is directed at @Tannoo since the UBL menu is his creation. So I got UBL up and running as as I suspected if I auto-create the mesh I have to go back and tweak about 80 points of the 100. For me it is not worth the time and effort to figure out how to move the head to the correct spot and then edit the information for each of those points. So I am trying to figure out how to use the "business card" method to create the entire mesh from scratch. To say the UBL menu system is a bit less than intuitive is being kind. No disrespect to all the work you did, I wouldn't have gotten as far as I have without the UBL menu system. Is there a way to outline from start to finish what buttons must be pressed in what order to go from no UBL mesh to a complete and enabled UBL mesh, using just the LCD and manually measuring each point?

Sorry for being insistent on the user experience, but no matter how much better UBL is than MESH, one thing that can be said about Ed Patel's implementation is that it was easy to do, with very few steps. So at least, at this stage since better isn't really easy, it becomes a barrier to implement.

bgort commented 7 years ago

Yeah, looks like all we need to do is set the whole bed as 'unreachable' and then G29 P2 will allow you to manually set every point.

bgort commented 7 years ago

@WheresWaldo:

Try this and tell me if this gives you what you want, effectively: G29 I 999 G29 P2 B

WheresWaldo commented 7 years ago

@bgort 99% there, it duplicated the functionality perfectly, I knew it was there all along. The only thing missing is visual feedback, but that can wait until all the important things are done. Process leaves you at the info screen the entire time.

I would also see the possibility of a single menu item under UBL tools that would do the following

G28 G29 I 999 G29 P2 B G29 S1 M420 S1 M500

then even the menu functionality would be restored.

bgort commented 7 years ago

So then really all we need to do is add a menu item named 'MANUALLY GENERATE MESH' or something, which does G29 I <mesh points> and then G29 P2 B, and have some feedback on the screen during the G29 P2 process. I believe what you're looking for was there at one point, but maybe was removed.

WheresWaldo commented 7 years ago

Yep, that would do it. It results in a simple to use alternative that stores mesh information in the format UBL needs.

bgort commented 7 years ago

I'm not all that familiar with the menu system - and I think it's being worked on pretty regularly by others anyway - so I'm not the best person to do that, but I can look into the on-screen feedback, unless anyone else wants to do it.

Roxy-3D commented 7 years ago

Besides the nozzle moving so you can see where it is relative to the bed.... What else should be seen? Probably the current (X,Y,Z) location of the nozzle. Anything else? Right now G29 P2 just displays the normal Status Screen.

It can display anything that is useful.

Are the current encoder wheel multipliers and 'Steps per Menu Item' sufficient to get the Encoder Wheel to feel good while doing a G29 P2 ? I don't know what should be changed to make the P2 feel better.

Tannoo commented 7 years ago

Where in the menu would ya'll like MANUALLY GENERATE MESH placed?

This will send G29 I999\nG29 P2 B, correct?

Roxy-3D commented 7 years ago

How about we put it at the very top for a few weeks just so people know it is there. Later we can put it in a more reasonable place.

Tannoo commented 7 years ago

I tagged a T0 at the end for those who do want the serial output during the build.

Tannoo commented 7 years ago

Okay... #6972

WheresWaldo commented 7 years ago

Sorry was busy with life today, What MESH gave you was the number of the point being probed stating at 1 and ending with Rows X Columns and the Z adjustment that way when you turned the encoder not only did the nozzle move up or down, the numbers indicated just where you were. It was a great visual cue. Then pressing the encoder button saved the point and moved the head, incremented the point number and started the process again, when it was all done and the last point was accepted it would store memory to save the mesh. Nothing fancy, but if you wanted to give the array position and Z height that would be completely understandable and easy to communicate. So the menu option actually did more than just measure, pressing LEVEL would home x,y,z then wait for input (encoder click, which was totally unnecessary) then move to first point to start the process, at the last point it would home again and save memory and tell you it was done, then exit to the info screen after an encoder press.

Roxy-3D commented 7 years ago

Tannoo just added a command to invalidate the entire mesh and then manually probe it. (And I just merged it.) We put it at the very top of the UBL LCD menu so everybody that has been using the original Mesh Bed Leveling will know it is there.

But... UBL is setup to look for the closest point to the nozzle and do things with that. Everything is designed with the ability to edit (or probe) a region that continually expands until the user says "Good enough!" and stops it. The order the points are probed should not matter so long as they all get probed....

WheresWaldo commented 7 years ago

@Roxy-3D Understood, and noticed this behavior when auto-generating the mesh. Numbering sequentially like Edward did, I believe was a concession to ease of programming and display. If it is just the array location and Z then that would be enough to tell what was going on. As you said it doesn't matter what order they are probed as long as the whole bed is probed.

Originally I thought the UBL: Tools Menu would be a good place for this, but once you flush out the entire menu system some likely spot will jump out at you. There were a lot of people in my sphere that were lost and just reapeating over and over "MESH is going away" this completely allays those fears.

Heck it could be just an indicator of Z for the most part.

Roxy-3D commented 7 years ago

There were a lot of people in my sphere that were lost and just reapeating over and over "MESH is going away" this completely allays those fears.

Well... The original Mesh Bed Leveling will go away someday. But I suspect it is still with us for another 6 months. There is nothing saying it needs to go away soon. And actually... It is so small in size it might actually make sense to keep it around especially for small 128 KB processors.

The thing is this... The very important lessons and technology that the original Mesh Bed Leveling brought us have been fully understood and absorbed into the later systems. So from that stand point, the natural thing to do is 'move on'. But there is no requirement that happens soon. Mostly, the biggest motivation to do that is to reduce some of the complexity in the code base with all the conditional compilation. And like I say... that doesn't have to happen 'soon'.

WheresWaldo commented 7 years ago

That was one reason I had the utmost confidence that the ask here was something already in the code base for UBL and just not explored or exposed for consumer use. If this works and every indication is that it will work exactly or close enough to MESH, MESH code could be completely deprecated without anyone missing it. I also want to apologize if you felt slighted in any way by my insistence, that was not my intention. I was a program manager for, at the time, the number 3 producer of PC software products in the world, and some of that was bubbling back up to the surface.

Tannoo commented 7 years ago

Does this tell you why it easily got lost in the mix?

G29 Unified Bed Leveling heading ``` /** * G29: Unified Bed Leveling by Roxy * * Parameters understood by this leveling system: * * A Activate Activate the Unified Bed Leveling system. * * B # Business Use the 'Business Card' mode of the Manual Probe subsystem. This is invoked as * G29 P2 B. The mode of G29 P2 allows you to use a business card or recipe card * as a shim that the nozzle will pinch as it is lowered. The idea is that you * can easily feel the nozzle getting to the same height by the amount of resistance * the business card exhibits to movement. You should try to achieve the same amount * of resistance on each probed point to facilitate accurate and repeatable measurements. * You should be very careful not to drive the nozzle into the business card with a * lot of force as it is very possible to cause damage to your printer if your are * careless. If you use the B option with G29 P2 B you can omit the numeric value * on first use to measure the business card's thickness. Subsequent usage of 'B' * will apply the previously-measured thickness as the default. * Note: A non-compressible Spark Gap feeler gauge is recommended over a Business Card. * * C Continue Continue, Constant, Current Location. This is not a primary command. C is used to * further refine the behaviour of several other commands. Issuing a G29 P1 C will * continue the generation of a partially constructed Mesh without invalidating what has * been done. Issuing a G29 P2 C will tell the Manual Probe subsystem to use the current * location in its search for the closest unmeasured Mesh Point. When used with a G29 Z C * it indicates to use the current location instead of defaulting to the center of the print bed. * * D Disable Disable the Unified Bed Leveling system. * * E Stow_probe Stow the probe after each sampled point. * * F # Fade Fade the amount of Mesh Based Compensation over a specified height. At the * specified height, no correction is applied and natural printer kenimatics take over. If no * number is specified for the command, 10mm is assumed to be reasonable. * * H # Height Specify the Height to raise the nozzle after each manual probe of the bed. The * default is 5mm. * * I # Invalidate Invalidate specified number of Mesh Points. The nozzle location is used unless * the X and Y parameter are used. If no number is specified, only the closest Mesh * point to the location is invalidated. The 'T' parameter is also available to produce * a map after the operation. This command is useful to invalidate a portion of the * Mesh so it can be adjusted using other tools in the Unified Bed Leveling System. When * attempting to invalidate an isolated bad point in the mesh, the 'T' option will indicate * where the nozzle is positioned in the Mesh with (#). You can move the nozzle around on * the bed and use this feature to select the center of the area (or cell) you want to * invalidate. * * J # Grid Perform a Grid Based Leveling of the current Mesh using a grid with n points on a side. * Not specifying a grid size will invoke the 3-Point leveling function. * * K # Kompare Kompare current Mesh with stored Mesh # replacing current Mesh with the result. This * command literally performs a diff between two Meshes. * * L Load Load Mesh from the previously activated location in the EEPROM. * * L # Load Load Mesh from the specified location in the EEPROM. Set this location as activated * for subsequent Load and Store operations. * * The P or Phase commands are used for the bulk of the work to setup a Mesh. In general, your Mesh will * start off being initialized with a G29 P0 or a G29 P1. Further refinement of the Mesh happens with * each additional Phase that processes it. * * P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System. This reverts the * 3D Printer to the same state it was in before the Unified Bed Leveling Compensation * was turned on. Setting the entire Mesh to Zero is a special case that allows * a subsequent G or T leveling operation for backward compatibility. * * P1 Phase 1 Invalidate entire Mesh and continue with automatic generation of the Mesh data using * the Z-Probe. Usually the probe can't reach all areas that the nozzle can reach. On * Cartesian printers, points within the X_PROBE_OFFSET_FROM_EXTRUDER and Y_PROBE_OFFSET_FROM_EXTRUDER * area cannot be automatically probed. For Delta printers the area in which DELTA_PROBEABLE_RADIUS * and DELTA_PRINTABLE_RADIUS do not overlap will not be automatically probed. * * These points will be handled in Phase 2 and Phase 3. If the Phase 1 command is given the * C (Continue) parameter it does not invalidate the Mesh prior to automatically * probing needed locations. This allows you to invalidate portions of the Mesh but still * use the automatic probing capabilities of the Unified Bed Leveling System. An X and Y * parameter can be given to prioritize where the command should be trying to measure points. * If the X and Y parameters are not specified the current probe position is used. * P1 accepts a 'T' (Topology) parameter so you can observe mesh generation. * P1 also watches for the LCD Panel Encoder Switch to be held down, and will suspend * generation of the Mesh in that case. (Note: This check is only done between probe points, * so you must press and hold the switch until the Phase 1 command detects it.) * * P2 Phase 2 Probe areas of the Mesh that can't be automatically handled. Phase 2 respects an H * parameter to control the height between Mesh points. The default height for movement * between Mesh points is 5mm. A smaller number can be used to make this part of the * calibration less time consuming. You will be running the nozzle down until it just barely * touches the glass. You should have the nozzle clean with no plastic obstructing your view. * Use caution and move slowly. It is possible to damage your printer if you are careless. * Note that this command will use the configuration #define SIZE_OF_LITTLE_RAISE if the * nozzle is moving a distance of less than BIG_RAISE_NOT_NEEDED. * * The H parameter can be set negative if your Mesh dips in a large area. You can press * and hold the LCD Panel's encoder wheel to terminate the current Phase 2 command. You * can then re-issue the G29 P 2 command with an H parameter that is more suitable for the * area you are manually probing. Note that the command tries to start you in a corner * of the bed where movement will be predictable. You can force the location to be used in * the distance calculations by using the X and Y parameters. You may find it is helpful to * print out a Mesh Map (G29 T) to understand where the mesh is invalidated and where * the nozzle will need to move in order to complete the command. The C parameter is * available on the Phase 2 command also and indicates the search for points to measure should * be done based on the current location of the nozzle. * * A B parameter is also available for this command and described up above. It places the * manual probe subsystem into Business Card mode where the thickness of a business card is * measured and then used to accurately set the nozzle height in all manual probing for the * duration of the command. (S for Shim mode would be a better parameter name, but S is needed * for Save or Store of the Mesh to EEPROM) A Business card can be used, but you will have * better results if you use a flexible Shim that does not compress very much. That makes it * easier for you to get the nozzle to press with similar amounts of force against the shim so you * can get accurate measurements. As you are starting to touch the nozzle against the shim try * to get it to grasp the shim with the same force as when you measured the thickness of the * shim at the start of the command. * * Phase 2 allows the T (Map) parameter to be specified. This helps the user see the progression * of the Mesh being built. * * P3 Phase 3 Fill the unpopulated regions of the Mesh with a fixed value. There are two different paths the * user can go down. If the user specifies the value using the C parameter, the closest invalid * mesh points to the nozzle will be filled. The user can specify a repeat count using the R * parameter with the C version of the command. * * A second version of the fill command is available if no C constant is specified. Not * specifying a C constant will invoke the 'Smart Fill' algorithm. The G29 P3 command will search * from the edges of the mesh inward looking for invalid mesh points. It will look at the next * several mesh points to determine if the print bed is sloped up or down. If the bed is sloped * upward from the invalid mesh point, it will be replaced with the value of the nearest mesh point. * If the bed is sloped downward from the invalid mesh point, it will be replaced with a value that * puts all three points in a line. The second version of the G29 P3 command is a quick, easy and * usually safe way to populate the unprobed regions of your mesh so you can continue to the G26 * Mesh Validation Pattern phase. Please note that you are populating your mesh with unverified * numbers. You should use some scrutiny and caution. * * P4 Phase 4 Fine tune the Mesh. The Delta Mesh Compensation System assume the existence of * an LCD Panel. It is possible to fine tune the mesh without the use of an LCD Panel. * (More work and details on doing this later!) * The System will search for the closest Mesh Point to the nozzle. It will move the * nozzle to this location. The user can use the LCD Panel to carefully adjust the nozzle * so it is just barely touching the bed. When the user clicks the control, the System * will lock in that height for that point in the Mesh Compensation System. * * Phase 4 has several additional parameters that the user may find helpful. Phase 4 * can be started at a specific location by specifying an X and Y parameter. Phase 4 * can be requested to continue the adjustment of Mesh Points by using the R(epeat) * parameter. If the Repetition count is not specified, it is assumed the user wishes * to adjust the entire matrix. The nozzle is moved to the Mesh Point being edited. * The command can be terminated early (or after the area of interest has been edited) by * pressing and holding the encoder wheel until the system recognizes the exit request. * Phase 4's general form is G29 P4 [R # of points] [X position] [Y position] * * Phase 4 is intended to be used with the G26 Mesh Validation Command. Using the * information left on the printer's bed from the G26 command it is very straight forward * and easy to fine tune the Mesh. One concept that is important to remember and that * will make using the Phase 4 command easy to use is this: You are editing the Mesh Points. * If you have too little clearance and not much plastic was extruded in an area, you want to * LOWER the Mesh Point at the location. If you did not get good adheasion, you want to * RAISE the Mesh Point at that location. * * * P5 Phase 5 Find Mean Mesh Height and Standard Deviation. Typically, it is easier to use and * work with the Mesh if it is Mean Adjusted. You can specify a C parameter to * Correct the Mesh to a 0.00 Mean Height. Adding a C parameter will automatically * execute a G29 P6 C . * * P6 Phase 6 Shift Mesh height. The entire Mesh's height is adjusted by the height specified * with the C parameter. Being able to adjust the height of a Mesh is useful tool. It * can be used to compensate for poorly calibrated Z-Probes and other errors. Ideally, * you should have the Mesh adjusted for a Mean Height of 0.00 and the Z-Probe measuring * 0.000 at the Z Home location. * * Q Test Load specified Test Pattern to assist in checking correct operation of system. This * command is not anticipated to be of much value to the typical user. It is intended * for developers to help them verify correct operation of the Unified Bed Leveling System. * * R # Repeat Repeat this command the specified number of times. If no number is specified the * command will be repeated GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y times. * * S Store Store the current Mesh in the Activated area of the EEPROM. It will also store the * current state of the Unified Bed Leveling system in the EEPROM. * * S # Store Store the current Mesh at the specified location in EEPROM. Activate this location * for subsequent Load and Store operations. Valid storage slot numbers begin at 0 and * extend to a limit related to the available EEPROM storage. * * S -1 Store Store the current Mesh as a print out that is suitable to be feed back into the system * at a later date. The GCode output can be saved and later replayed by the host software * to reconstruct the current mesh on another machine. * * T Topology Display the Mesh Map Topology. * 'T' can be used alone (e.g., G29 T) or in combination with most of the other commands. * This option works with all Phase commands (e.g., G29 P4 R 5 T X 50 Y100 C -.1 O) * This parameter can also specify a Map Type. T0 (the default) is user-readable. T1 can * is suitable to paste into a spreadsheet for a 3D graph of the mesh. * * U Unlevel Perform a probe of the outer perimeter to assist in physically leveling unlevel beds. * Only used for G29 P1 T U. This speeds up the probing of the edge of the bed. Useful * when the entire bed doesn't need to be probed because it will be adjusted. * * V # Verbosity Set the verbosity level (0-4) for extra details. (Default 0) * * W What? Display valuable Unified Bed Leveling System data. * * X # X Location for this command * * Y # Y Location for this command * * * Release Notes: * You MUST do M502, M500 to initialize the storage. Failure to do this will cause all * kinds of problems. Enabling EEPROM Storage is highly recommended. With EEPROM Storage * of the mesh, you are limited to 3-Point and Grid Leveling. (G29 P0 T and G29 P0 G * respectively.) * * When you do a G28 and then a G29 P1 to automatically build your first mesh, you are going to notice * the Unified Bed Leveling probes points further and further away from the starting location. (The * starting location defaults to the center of the bed.) The original Grid and Mesh leveling used * a Zig Zag pattern. The new pattern is better, especially for people with Delta printers. This * allows you to get the center area of the Mesh populated (and edited) quicker. This allows you to * perform a small print and check out your settings quicker. You do not need to populate the * entire mesh to use it. (You don't want to spend a lot of time generating a mesh only to realize * you don't have the resolution or zprobe_zoffset set correctly. The Mesh generation * gathers points closest to where the nozzle is located unless you specify an (X,Y) coordinate pair. * * The Unified Bed Leveling uses a lot of EEPROM storage to hold its data. And it takes some effort * to get this Mesh data correct for a user's printer. We do not want this data destroyed as * new versions of Marlin add or subtract to the items stored in EEPROM. So, for the benefit of * the users, we store the Mesh data at the end of the EEPROM and do not keep it contiguous with the * other data stored in the EEPROM. (For sure the developers are going to complain about this, but * this is going to be helpful to the users!) * * The foundation of this Bed Leveling System is built on Epatel's Mesh Bed Leveling code. A big * 'Thanks!' to him and the creators of 3-Point and Grid Based leveling. Combining their contributions * we now have the functionality and features of all three systems combined. */ ```
Tannoo commented 7 years ago

It was not intentionally left out. The UBL menu system has still got that new car smell.

bgort commented 7 years ago

Heck it could be just an indicator of Z for the most part.

I think just showing Z centered in the LCD is best/clearest. Can't imagine anyone will care what X and Y are.

Like: 'Z: +0.250 mm'

WheresWaldo commented 7 years ago

@bgort I think you are on the right track. Z is plenty

thinkyhead commented 7 years ago

And actually... It is so small in size it might actually make sense to keep it around especially for small 128 KB processors.

Good point. Although, without adding any other bells and whistles, all the original bed leveling systems come in at a pretty small size. Here are some current build sizes…

Default config
Program:   52744
Data:       2615

ABL 3-point, Probe Manually
Program:   59664 (+6920)
Data:       2723 (+108)

Mesh Bed Leveling
Program:   60660 (+7916)
Data:       2707 (+92)

ABL Bilinear, Probe Manually
Program:   65190 (+12446)
Data:       2795 (+180)

ABL Linear, Probe Manually
Program:   69580 (+16836)
Data:       2872 (+257)

Default plus G3D_PANEL
Program:   81366
Data:       2924

ABL 3-point, Probe Manually, LCD_BED_LEVELING
Program:   90008 (+8642)
Data:       3046 (+122)

Mesh Bed Leveling
Program:   92670 (+11304)
Data:       3021 (+97)

ABL Bilinear, Probe Manually, LCD_BED_LEVELING
Program:   96442 (+15076)
Data:       3118 (+194)

ABL Linear, Probe Manually, LCD_BED_LEVELING
Program:  100232 (+18866)
Data:       3195 (+271)
brucehvn commented 7 years ago

I have a question about manually doing probing until this menu item is working completely. I'm still using 1.1.3 and I got the manual instructions from this thread and the other one opened by @WheresWaldo, so I'm doing:

G28 G29 I 999 G29 P2 B etc.

My question is that when I finish a homing (G28). The Z axis is at my M851 Z probe offset of 2.8. Before I issue the G29 commands, should I manually move the Z to 0? It seems like when I start the G29 P2 B command, on the first point, I have to crank the Z axis down to compensate for the offset, but then for the rest I don't.

In the old mesh bed leveling I believe that after the mesh was created, it would start automatically moving the Z to 0 after homing and maybe this will do the same once I have a mesh saved, but on the first try, do I need to manually do this?

Roxy-3D commented 7 years ago

Yes.... That sequence of commands should let you build a mesh manually. You will also notice other differences. It will probe the thickness of the business card or shim you are using. It is also going to probe the bed's mesh points in a different order.

But... You will be able to build a mesh, save it, and edit it to further refine it.

jordathan commented 6 years ago

so once you get this all up and running what should starting gcode look like?

github-actions[bot] commented 2 years ago

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.