Code Monkey home page Code Monkey logo

octoprint-ublmeshedit's Introduction

OctoPrint-UBLMeshEdit

screenshot

UBL Mesh Editor can be used to view, edit and manage Marlin Unified Bed Leveling (UBL) meshes.

In its current state, this plugin is intended to be used to make minor tweaks to a mesh that is already valid and setup. This could be to correct a point that wasn't probed properly for some reason or to fine tune the mesh when using PROBE_MANUALLY. It won't help with the initial creation of a mesh, except in the case of starting with a zero mesh and manually editing points.

Note: this is only intended for UBL, and not any other ABL or MBL setup. This plugin will attempt to show and provide basic functionality for ABL meshes, but some features will be disabled and others may not function as expected.

Setup

Install via the bundled Plugin Manager or manually using this URL:

https://github.com/The-EG/OctoPrint-UBLMeshEdit/archive/main.zip

Usage

With the printer connected and idle, switch to the 'UBL Mesh Editor' tab and click 'Get Mesh'. The current mesh will be shown.

Click a point to edit the value. The current value will be shown next to 'Z Value.' That value can be changed by clicking up/down or by entering a value. To save the value, click 'Save Value.'

UBL Mesh Editor can also save and load saved meshes. Select the mesh slot next to 'Mesh Save Slot' and click either 'Save' or 'Load.'

The current mesh can also be exported to a GCode script. This script can then be loaded and 'printed' to restore the mesh. This can be used to back up a mesh or transfer it to another printer.

Note: the plugin does not currently verify the save mesh slot is valid.

Todo

  • Add 'move nozzle to point' functionality
  • Handle invalid meshes?

octoprint-ublmeshedit's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

octoprint-ublmeshedit's Issues

[FR] Send GCode commands to go to mesh spot, automating fine tuning a mesh.

When using UBL without a LCD with an encoder wheel, you must manually enter the commands to go to each spot to fine tune the probing. I propose a toggle switch that enables and disables automatically going to the mesh spots when you click on the boxes to edit them. Due to the Z-Height speed difference between Deltas and Cartesian style printers, a Z Feedrate selector would be nice too.

With the proposed step #4 under Once User clicks on a square, this Feature Request would also allow this plugin to be used to create a manual mesh from scratch as well as fine tuning an existing mesh.

User clicks on button to enable this new feature:

  1. Check that bed and nozzle temp are within a reasonable temp range. If not instruct user to heat them up first. Octoprint Printer Profile has a checkbox for whether or not a heated bed is present, so I assume that this can be checked so we don't error out for users without a heated bed.
  2. Prompt user for confirmation before continuing (wanna make absolutely sure they are ready before any motion happens)
  3. Send GCode M18 S3000 to keep stepper motors from disabling while probing.
  4. Send GCode M28 to home
  5. Send GCode G1 Z2 Fxxx to get close to bed plate (vital for Deltas since they can not move horizontally until they have descended at least some, might as well get close to bed plate at this point too)
  6. Send GCode M211 S0 to disable software endstops so user can go Negative if needed.
  7. Wait until user picks a spot to go to.

Once User clicks on a square:

  1. Send GCode G42 Ix Jy to move to the chosen spot
  2. Send GCode G1 Z0.4 Fxxx to get as close to bed plate as is safe.
  3. Wait for User to manually probe bed.
  4. Send GCode M421 Ix Jy Q/Zx.xxx to set value of the spot. If the spot currently has no value, send Zx.xxx to set the absolute value, else if the spot had an existing value, send Qx.xxx to add or subtract from the existing value.
    4.1. If user entered a value into the box, use the value they entered. If they left box blank send and check M114 to get current position and use that value automatically.
  5. Send GCode G1 Z2 Fxxx to get back off the bed. This will also automatically take the new adjustment into effect so User can repeat this process to verify their adjustment.

If User clicks on a 2nd square without saving an adjustment:

  1. Send GCode G1 Z2 Fxxx to get back off the bed.
  2. Continue with the steps under Once User clicks on a square

Once User clicks the button to disable this new feature:

  1. Send GCode G29 Sx to save mesh.
  2. Send GCode G28 to get back home.
  3. Send GCode M18 S300 to set stepper motor timeout to 5m. Not sure of an easy way to get this value to be able to revert it, so I feel that a 5m timeout without any motion is reasonable. Obviously adjust this value if you disagree.
  4. Send GCode M18 to disable stepper motors now.

[BUG] New Issue

Describe the bug
A clear and concise description of what the bug is.

M420 Output
If this bug is related to the mesh not loading or updating properly, include the output of M420 V1 T1 including the last 'ok'.

Firmware
What firmware (vanilla Marlin, etc), what version and is it a precompiled binary? If precompiled, where is it from? (Vendor, marlin.crc.in.au, etc.)

[BUG] Can't load plugin

The plugin creates errors while installing.

2021-05-19 16:09:19,600 - octoprint.plugin.core - ERROR - Invalid syntax in /home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_ublmeshedit/__init__.py for plugin ublmeshedit
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 711, in _parse_metadata
    root = ast.parse(f.read(), filename=path)
  File "/usr/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_ublmeshedit/__init__.py", line 101
    self._logger.info(f'got mesh row: {row}')
                                           ^
SyntaxError: invalid syntax
2021-05-19 16:09:19,667 - octoprint.plugin.core - INFO - Plugin Pi Support Plugin (2021.3.26.post2) did not pass check, not loading.
2021-05-19 16:09:19,736 - octoprint.plugin.core - ERROR - Error loading plugin eeprom_marlin
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 1264, in _import_plugin
    module = _load_module(module_name, spec)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 69, in _load_module
    return imp.load_module(name, f, filename, details)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_eeprom_marlin/__init__.py", line 17, in <module>
    from octoprint_eeprom_marlin import (
ImportError: cannot import name _version
2021-05-19 16:09:30,233 - octoprint.plugin.core - ERROR - Invalid syntax in /home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_ublmeshedit/__init__.py for plugin ublmeshedit
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 711, in _parse_metadata
    root = ast.parse(f.read(), filename=path)
  File "/usr/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_ublmeshedit/__init__.py", line 101
    self._logger.info(f'got mesh row: {row}')
                                           ^
SyntaxError: invalid syntax
2021-05-19 16:09:30,289 - octoprint.plugin.core - INFO - Plugin Pi Support Plugin (2021.3.26.post2) did not pass check, not loading.
2021-05-19 16:09:30,357 - octoprint.plugin.core - ERROR - Error loading plugin eeprom_marlin
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 1264, in _import_plugin
    module = _load_module(module_name, spec)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 69, in _load_module
    return imp.load_module(name, f, filename, details)
  File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_eeprom_marlin/__init__.py", line 17, in <module>
    from octoprint_eeprom_marlin import (
ImportError: cannot import name _version

[BUG] No Mesh

Describe the bug
No Mesh
The command completed successfully, but no mesh was detected. If you are sure that you have UBL setup properly and are still getting this message, this may be a bug. Please report it: Create New Bug Report

M420 Output
Send: M420 V1 T1
Recv: Mesh Bed Level data:
Recv: 3x3 mesh. Z offset: 0.00000
Recv: Measured points:
Recv: 0 1 2
Recv: 0 +0.37500 +0.47500 +0.52500
Recv: 1 +0.45000 +0.50000 +0.52500
Recv: 2 +0.40000 +0.45000 +0.50000
Recv:
Recv: echo:Bed Leveling ON
Recv: echo:Fade Height OFF
Recv: ok

Firmware
Recv: FIRMWARE_NAME:Marlin bugfix-2.0.x

cant see and edit the mesh

the Program does not load the existing mesh properly to edit it.
I Have a saved one and the tool sends the proper commands (g29 T and g29 L1) but it does not display any mesh in the tool.
In terminal i get the mesh displayed and it is valid.

[FR] Save mesh to file

Would it be possible to save and download the mesh data to a file? I like to copy/paste the data into a text file just to be safe, and it would be much easier if its automated with this plugin. Could also implement restoring a saved mesh from a file too.

[FR] support of Automatic Bed Leveling (ABL)

Would it be possible to also support ABL and not only UBL? As far as I understand it should only cause minor changes in the code.

EEPROM slots

In ABL there is no support for several EEPOM slots. You could simply replace this with M500/M501.

phases

Phases are not supported in ABL. You are using G29 P0, which could be replaced with

  • M421 Ix Jy Z0.0
  • M420 S0

[BUG] plugin says No Mesh, but g29 returns mesh

Describe the bug
plugin says No Mesh, but g29 returns mesh:

Send: G29 S0
Recv: Mesh Bed Leveling ON
Recv: 3x3 mesh. Z offset: 0.00000
Recv: Measured points:
Recv:         0        1        2
Recv:  0 -0.22500 +0.02500 +0.07500
Recv:  1 -0.10000 +0.07500 -0.02500
Recv:  2 +0.05000 +0.12500 -0.02500
Recv: 
Recv: X:-5.00 Y:0.00 Z:0.27 E:184.88 Count X:-400 Y:0 Z:3
Recv: ok

Mesh was set using the following :
https://marlinfw.org/docs/gcode/G029-mbl.html

instead of using a probe
M420 Output
If this bug is related to the mesh not loading or updating properly, include the output of M420 V1 T1 including the last 'ok'.

Send: M420 V1 T1
Recv: Mesh Bed Level data:
Recv: 3x3 mesh. Z offset: 0.00000
Recv: Measured points:
Recv:         0        1        2
Recv:  0 -0.22500 +0.02500 +0.07500
Recv:  1 -0.10000 +0.07500 -0.02500
Recv:  2 +0.05000 +0.12500 -0.02500
Recv: 
Recv: echo:Bed Leveling ON
Recv: echo:Fade Height 10.00
Recv: ok

Firmware
marlin 2.0.8 on mks sgen l v1

[FR] Support for a different ABL format (Snapmaker)

image

It is for the Snapmaker 2.0 series printer.

Send: M420 V1 T1
Recv: Bilinear Leveling Grid:
Recv: 0 1 2 3 4
Recv: 0 +6.846 +6.733 +6.764 +6.691 +6.696
Recv: 1 +7.058 +7.153 +7.148 +7.083 +6.885
Recv: 2 +7.165 +7.229 +7.153 +7.118 +6.914
Recv: 3 +7.070 +7.160 +7.125 +7.041 +6.890
Recv: 4 +6.843 +6.955 +6.926 +6.880 +6.808
Recv:
Recv: Subdivided with CATMULL ROM Leveling Grid:
Recv: 0 1 2 3 4 5 6 7 8 9 10 11 12
Recv: 0 +6.84625 +6.80297 +6.75968 +6.73250 +6.73602 +6.75565 +6.76375 +6.74440 +6.71352 +6.69125 +6.68718 +6.69171 +6.69625

[BUG] New Issue

Describe the bug
can not get ABL to work in any way

M420 Output
If this bug is related to the mesh not loading or updating properly, include the output of M420 V1 T1 including the last 'ok'.

Firmware
klipper Btt skr mini e3 v3. ender 3 v2

[FR] Support UBL that doesn't support T1 parameter for M420

Hello, thanks for this plugin. I have installed UBL to use it.

I'm using Octoprint Version 1.5.3 on Raspberry Pi 3 B
Printer: Tevo Tornado, Marlin from Tevo repository (1.x)
Sensor: BLTouch
UBL Mesh Editor: Version 0.2.1

Bug: The "Get Mesh" button has no graphical effect, even if I can see the M420 V1 T1 result.

M420 Output
Send: M420 V1 T1
Recv:
Recv: Bed Topography Report:
Recv:
Recv: (0,9) (9,9)
Recv: (5,295) (315,295)
Recv: . . . . . . . . . .
Recv:
Recv: 0.059 -0.003 -0.011 -0.051 0.007 -0.011 0.004 -0.036 . .
Recv:
Recv: 0.079 0.019 -0.013 -0.071 -0.051 -0.041 -0.033 -0.053 . .
Recv:
Recv: -0.003 -0.043 -0.091 -0.101 -0.104 [-0.088] -0.026 -0.061 . .
Recv:
Recv: 0.027 -0.033 -0.086 -0.028 0.007 -0.058 -0.063 -0.093 . .
Recv:
Recv: 0.034 0.012 -0.076 -0.088 -0.086 -0.068 -0.031 -0.011 . .
Recv:
Recv: 0.012 -0.021 -0.056 -0.106 -0.068 -0.053 -0.018 0.012 . .
Recv:
Recv: 0.079 0.039 0.044 -0.023 0.014 -0.043 T:18.39 /0.00 B:18.40 /0.00 @:0 B@:0
Recv: -0.011 -0.036 . .
Recv:
Recv: 0.119 0.082 0.069 0.032 -0.028 -0.051 -0.023 -0.071 . .
Recv:
Recv: 0.159 0.112 0.087 0.052 -0.008 -0.013 -0.036 -0.078 . .
Recv: (5,5) (315,5)
Recv: (0,0) (9,0)
Recv: UBL_MESH_VALID = 1
Recv: ubl.state.storage_slot = 1
Recv: echo:Bed Leveling Marche
Recv: echo:Fade Height 10.00
Recv: ok

Firmware
printer.firmware: Marlin TORNADO (Github)

[...]
#elif ENABLED(AUTO_BED_LEVELING_UBL)

//===========================================================================
//========================= Unified Bed Leveling ============================
//===========================================================================

#define UBL_MESH_INSET 5 // Mesh inset margin on print area
#define GRID_MAX_POINTS_X 10 // Was 10 Don't use more than 15 points per axis, implementation limited.
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

#define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh
#define UBL_PROBE_PT_1_Y 180
#define UBL_PROBE_PT_2_X 39
#define UBL_PROBE_PT_2_Y 30
#define UBL_PROBE_PT_3_X 180
#define UBL_PROBE_PT_3_Y 20

// Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION (MIN_PROBE_EDGE)
#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - MIN_PROBE_EDGE)
#define FRONT_PROBE_BED_POSITION (MIN_PROBE_EDGE)
#define BACK_PROBE_BED_POSITION (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - MIN_PROBE_EDGE)

#define UBL_G26_MESH_VALIDATION // Enable G26 mesh validation
#define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle

#elif ENABLED(MESH_BED_LEVELING)
[...]

What I'm doing wrong ?
Thanks

[BUG] New Issue

Describe the bug
(I) No Mesh
The command completed successfully, but no mesh was detected. [...]

A plugin "bed visualizer" displays the mesh correctly.

M420 Output

Send: M420 V1 T1
Recv: Mesh Bed Level data:
Recv: 5x5 mesh. Z offset: 0.00000
Recv: Measured points:
Recv:         0        1        2        3        4
Recv:  0 -0.02000 -0.10000 -0.10000 -0.08000 -0.02000
Recv:  1 +0.02000 -0.06000 -0.06000 -0.04000 +0.02000
Recv:  2 +0.06000 -0.04000 -0.04000 -0.04000 +0.04000
Recv:  3 +0.06000 -0.04000 -0.04000 -0.03000 +0.04000
Recv:  4 +0.08000 -0.02000 -0.03000 -0.02000 +0.04000
Recv: 
Recv: echo:Bed Leveling ON
Recv: echo:Fade Height OFF
Recv: ok

Firmware
https://github.com/knutwurst/Marlin-2-0-x-Anycubic-i3-MEGA-S/releases/download/1.4.0-beta.4/MEGA_X_TMC_v1.4.0-b4.hex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.