Prusa MINI Firmware overview
|
Go to the documentation of this file.
24 #include "../../../inc/MarlinConfig.h"
35 #define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1))
36 #define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1))
37 #define _GET_MESH_X(I) mbl.index_to_xpos[I]
38 #define _GET_MESH_Y(J) mbl.index_to_ypos[J]
39 #define Z_VALUES_ARR mbl.z_values
44 z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y],
55 for (
uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
56 for (
uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
61 static void set_z(
const int8_t px,
const int8_t py,
const float &z) {
z_values[px][py] = z; }
63 static inline void zigzag(
const int8_t index, int8_t &px, int8_t &py) {
64 px = index % (GRID_MAX_POINTS_X);
65 py = index / (GRID_MAX_POINTS_X);
66 if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px;
77 return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2);
81 return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2);
90 return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1;
94 return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1;
101 static float calc_z0(
const float &a0,
const float &a1,
const float &z1,
const float &a2,
const float &z2) {
102 const float delta_z = (z2 - z1) / (a2 - a1),
104 return z1 + delta_a * delta_z;
108 #
if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
109 ,
const float &factor=1.0f
112 #if DISABLED(ENABLE_LEVELING_FADE_HEIGHT)
113 constexpr
float factor = 1.0f;
124 #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
#define WITHIN(N, L, H)
Definition: macros.h:195
static xy_int8_t cell_indexes(const xy_pos_t &xy)
Definition: mesh_bed_leveling.h:86
T z
Definition: types.h:383
static float index_to_xpos[GRID_MAX_POINTS_X]
Definition: mesh_bed_leveling.h:43
static float get_z(const xy_pos_t &pos)
Definition: mesh_bed_leveling.h:107
#define RECIPROCAL(x)
Definition: macros.h:273
static xy_int8_t probe_indexes(const xy_pos_t &xy)
Definition: mesh_bed_leveling.h:99
#define _MAX(V...)
Definition: macros.h:346
static int8_t probe_index_x(const float &x)
Definition: mesh_bed_leveling.h:88
static void zigzag(const int8_t index, int8_t &px, int8_t &py)
Definition: mesh_bed_leveling.h:63
T e
Definition: types.h:383
uint8_t i
Definition: screen_test_graph.c:72
#define STRINGIFY(M)
Definition: macros.h:73
static int8_t cell_index_y(const float &y)
Definition: mesh_bed_leveling.h:79
xyze_pos_t destination
Definition: motion.cpp:110
static xy_int8_t probe_indexes(const float &x, const float &y)
Definition: mesh_bed_leveling.h:96
float feedRate_t
Definition: types.h:80
static FORCE_INLINE bool has_mesh()
Definition: mesh_bed_leveling.h:54
static void report_mesh()
static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]
Definition: mesh_bed_leveling.h:43
#define NOMORE(v, n)
Definition: macros.h:133
#define ZERO(a)
Definition: macros.h:201
static int8_t cell_index_x(const float &x)
Definition: mesh_bed_leveling.h:75
#define FORCE_INLINE
Definition: macros.h:40
xyze_pos_t current_position
Definition: motion.cpp:102
Definition: mesh_bed_leveling.h:27
Definition: mesh_bed_leveling.h:31
Definition: mesh_bed_leveling.h:29
void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval)
Definition: marlin_server.cpp:945
T x
Definition: types.h:383
#define constrain(amt, low, high)
Definition: wiring_constants.h:79
static void set_z(const int8_t px, const int8_t py, const float &z)
Definition: mesh_bed_leveling.h:61
#define MESH_X_DIST
Definition: mesh_bed_leveling.h:35
T x
Definition: types.h:185
#define MESH_Y_DIST
Definition: mesh_bed_leveling.h:36
const uint8_t[]
Definition: 404_html.c:3
static float z_offset
Definition: mesh_bed_leveling.h:43
MeshLevelingState
Definition: mesh_bed_leveling.h:26
Definition: mesh_bed_leveling.h:30
static float index_to_ypos[GRID_MAX_POINTS_Y]
Definition: mesh_bed_leveling.h:43
#define CBI(A, B)
Definition: macros.h:89
static int8_t probe_index_y(const float &y)
Definition: mesh_bed_leveling.h:92
#define SERIAL_ECHOPAIR_F(S, V...)
Definition: serial.h:176
static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2)
Definition: mesh_bed_leveling.h:101
static void set_zigzag_z(const int8_t index, const float &z)
Definition: mesh_bed_leveling.h:69
#define TEST(n, b)
Definition: macros.h:81
T y
Definition: types.h:185
static xy_int8_t cell_indexes(const float &x, const float &y)
Definition: mesh_bed_leveling.h:83
Definition: mesh_bed_leveling.h:41
Definition: mesh_bed_leveling.h:28
Definition: mesh_bed_leveling.h:32
#define SERIAL_ECHOLNPGM(S)
Definition: serial.h:174
static void line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF)
#define ENABLED(V...)
Definition: macros.h:177
T y
Definition: types.h:383