adaptive Mesh generating "move out of bounds" error when parts are close to the edge of the bed.

In ratos 2.0 with adaptive Mesh enabled. If I put a part close to the edge of the bed. I get a move out of bounds error during mesh probing. Error doesn't occur with adaptive meshing disabled. Presumably the probe point calculation is taking the probe offset into account, but not rounding to the bed limits.
8 Replies
miklschmidt
miklschmidt9mo ago
It does actually constrain it to the configured [bed_mesh] min/max. (see: https://github.com/Rat-OS/RatOS-configuration/blob/v2.x/macros.cfg#L749)
GitHub
RatOS-configuration/macros.cfg at v2.x · Rat-OS/RatOS-configuration
The RatOS modular klipper configuration. Contribute to Rat-OS/RatOS-configuration development by creating an account on GitHub.
miklschmidt
miklschmidt9mo ago
What probe? Well.. That code is definitely wrong 😂 Actually no, it's not, that should work Such a confusing notation Let's do the math. So let's assume the following: * min_x (from bed_mesh) is 20 and x0 is 0 * max_x(from bed_mesh) is 360 and x1 is 400 * min_y(from bed_mesh is 20 and y0 is 0 * max_y(from bed_mesh) is 360 and x1 is 400 then
{% set mesh_x0 = [[x0, max_x]|min, min_x]|max %}
{% set mesh_y0 = [[y0, max_y]|min, min_y]|max %}
{% set mesh_x1 = [[x1, max_x]|min, min_x]|max %}
{% set mesh_y1 = [[y1, max_y]|min, min_y]|max %}
{% set mesh_x0 = [[x0, max_x]|min, min_x]|max %}
{% set mesh_y0 = [[y0, max_y]|min, min_y]|max %}
{% set mesh_x1 = [[x1, max_x]|min, min_x]|max %}
{% set mesh_y1 = [[y1, max_y]|min, min_y]|max %}
becomes
{% set mesh_x0 = [[0, 360]|min, 20]|max %} = [0, 20]|max = 20.
{% set mesh_y0 = [[0, 360]|min, 20]|max %} = [0, 20]|max = 20.
{% set mesh_x1 = [[400, 360]|min, 20]|max %} = [360, 20]|max = 360.
{% set mesh_y1 = [[400, 360]|min, 20]|max %} = [360, 20]|max - 360.
{% set mesh_x0 = [[0, 360]|min, 20]|max %} = [0, 20]|max = 20.
{% set mesh_y0 = [[0, 360]|min, 20]|max %} = [0, 20]|max = 20.
{% set mesh_x1 = [[400, 360]|min, 20]|max %} = [360, 20]|max = 360.
{% set mesh_y1 = [[400, 360]|min, 20]|max %} = [360, 20]|max - 360.
So it does what it should do. So the question remains, what probe? and did you change your probe offsets? (because then you need to adjust your bed_mesh min/max as well). But in that case a full bed_mesh should throw errors too.
EternalPath
EternalPath9mo ago
No description
EternalPath
EternalPath9mo ago
It's possible that my statement "it works without adaptive Mesh" was from before I changed the probe offsets. So I need to subtract my probe offset from my max positions and put that new value into the [bed mesh] section. So I'm this case with the probe X_offset: 21 y_offset: -11 then mesh_max: 279, 289 Should work? I assumed the [bed mesh] section's arguments where also refering to the nozzle position
miklschmidt
miklschmidt9mo ago
Bed mesh min/max is a little complicated as it's relative to the probe's position (contrary to everything else in klipper, for reasons...). That means x,y becomes x-x_offset,y-y_offset. In your case that means mesh_min: 30, 100 corresponds to nozzle position: 9, 111 and mesh_max corresponds to nozzle position: 249, 311. If it's a 300x300 printer, that means the outer points in Y will throw errors because position_max on [stepper_y] is 300. More about klipper's bed_mesh here: https://www.klipper3d.org/Config_Reference.html#bed_mesh
EternalPath
EternalPath9mo ago
Cool thanks 👍 got it fixed. Btw is there any resource on wth programming language inside another language this is?
miklschmidt
miklschmidt9mo ago
It's jinja2, it's a template language (not a programming language per se): https://www.klipper3d.org/Command_Templates.html#template-expansion
EternalPath
EternalPath9mo ago
Okay Ty. Time to study -_- (Need to make a toolchanger config)
Want results from more Discord servers?
Add your server