My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

bbl.h 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include "../../../inc/MarlinConfigPre.h"
  24. class LevelingBilinear {
  25. public:
  26. static bed_mesh_t z_values;
  27. static xy_pos_t grid_spacing, grid_start;
  28. private:
  29. static xy_float_t grid_factor;
  30. static xy_pos_t cached_rel;
  31. static xy_int8_t cached_g;
  32. static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir);
  33. #if ENABLED(ABL_BILINEAR_SUBDIVISION)
  34. #define ABL_GRID_POINTS_VIRT_X (GRID_MAX_CELLS_X * (BILINEAR_SUBDIVISIONS) + 1)
  35. #define ABL_GRID_POINTS_VIRT_Y (GRID_MAX_CELLS_Y * (BILINEAR_SUBDIVISIONS) + 1)
  36. static float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y];
  37. static xy_pos_t grid_spacing_virt;
  38. static xy_float_t grid_factor_virt;
  39. static float bed_level_virt_coord(const uint8_t x, const uint8_t y);
  40. static float bed_level_virt_cmr(const float p[4], const uint8_t i, const float t);
  41. static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const_float_t tx, const_float_t ty);
  42. static void bed_level_virt_interpolate();
  43. #endif
  44. public:
  45. static void reset();
  46. static void set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start);
  47. static void extrapolate_unprobed_bed_level();
  48. static void print_leveling_grid(const bed_mesh_t* _z_values = NULL);
  49. static void refresh_bed_level();
  50. static bool has_mesh() { return !!grid_spacing.x; }
  51. static bool mesh_is_valid() { return has_mesh(); }
  52. static float get_mesh_x(const uint8_t i) { return grid_start.x + i * grid_spacing.x; }
  53. static float get_mesh_y(const uint8_t j) { return grid_start.y + j * grid_spacing.y; }
  54. static float get_z_correction(const xy_pos_t &raw);
  55. static constexpr float get_z_offset() { return 0.0f; }
  56. #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
  57. static void line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF);
  58. #endif
  59. };
  60. extern LevelingBilinear bedlevel;