My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

probe.h 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * probe.h - Move, deploy, enable, etc.
  25. */
  26. #include "../inc/MarlinConfig.h"
  27. #if HAS_BED_PROBE
  28. constexpr xyz_pos_t nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET;
  29. extern xyz_pos_t probe_offset;
  30. bool set_probe_deployed(const bool deploy);
  31. #ifdef Z_AFTER_PROBING
  32. void move_z_after_probing();
  33. #endif
  34. enum ProbePtRaise : unsigned char {
  35. PROBE_PT_NONE, // No raise or stow after run_z_probe
  36. PROBE_PT_STOW, // Do a complete stow after run_z_probe
  37. PROBE_PT_RAISE, // Raise to "between" clearance after run_z_probe
  38. PROBE_PT_BIG_RAISE // Raise to big clearance after run_z_probe
  39. };
  40. float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true);
  41. inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true) {
  42. return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative);
  43. }
  44. #define DEPLOY_PROBE() set_probe_deployed(true)
  45. #define STOW_PROBE() set_probe_deployed(false)
  46. #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
  47. extern const char msg_wait_for_bed_heating[25];
  48. #endif
  49. #else
  50. constexpr xyz_pos_t probe_offset{0};
  51. #define DEPLOY_PROBE()
  52. #define STOW_PROBE()
  53. #endif
  54. #if HAS_LEVELING && HAS_BED_PROBE
  55. inline float probe_min_x() {
  56. return _MAX(
  57. #if IS_KINEMATIC
  58. PROBE_X_MIN, MESH_MIN_X
  59. #else
  60. (X_MIN_BED) + (MIN_PROBE_EDGE_LEFT), (X_MIN_POS) + probe_offset.x
  61. #endif
  62. );
  63. }
  64. inline float probe_max_x() {
  65. return _MIN(
  66. #if IS_KINEMATIC
  67. PROBE_X_MAX, MESH_MAX_X
  68. #else
  69. (X_MAX_BED) - (MIN_PROBE_EDGE_RIGHT), (X_MAX_POS) + probe_offset.x
  70. #endif
  71. );
  72. }
  73. inline float probe_min_y() {
  74. return _MAX(
  75. #if IS_KINEMATIC
  76. PROBE_Y_MIN, MESH_MIN_Y
  77. #else
  78. (Y_MIN_BED) + (MIN_PROBE_EDGE_FRONT), (Y_MIN_POS) + probe_offset.y
  79. #endif
  80. );
  81. }
  82. inline float probe_max_y() {
  83. return _MIN(
  84. #if IS_KINEMATIC
  85. PROBE_Y_MAX, MESH_MAX_Y
  86. #else
  87. (Y_MAX_BED) - (MIN_PROBE_EDGE_BACK), (Y_MAX_POS) + probe_offset.y
  88. #endif
  89. );
  90. }
  91. #else
  92. inline float probe_min_x() { return 0; };
  93. inline float probe_max_x() { return 0; };
  94. inline float probe_min_y() { return 0; };
  95. inline float probe_max_y() { return 0; };
  96. #endif
  97. #if HAS_Z_SERVO_PROBE
  98. void servo_probe_init();
  99. #endif
  100. #if QUIET_PROBING
  101. void probing_pause(const bool p);
  102. #endif