My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. /**
  24. * delta.h - Delta-specific functions
  25. */
  26. #include "../core/types.h"
  27. #include "../core/macros.h"
  28. extern float delta_height;
  29. extern abc_float_t delta_endstop_adj;
  30. extern float delta_radius,
  31. delta_diagonal_rod,
  32. delta_segments_per_second;
  33. extern abc_float_t delta_tower_angle_trim;
  34. extern xy_float_t delta_tower[ABC];
  35. extern abc_float_t delta_diagonal_rod_2_tower;
  36. extern float delta_clip_start_height;
  37. extern abc_float_t delta_diagonal_rod_trim;
  38. /**
  39. * Recalculate factors used for delta kinematics whenever
  40. * settings have been changed (e.g., by M665).
  41. */
  42. void recalc_delta_settings();
  43. /**
  44. * Get a safe radius for calibration
  45. */
  46. #if ENABLED(DELTA_AUTO_CALIBRATION)
  47. extern float calibration_radius_factor;
  48. #else
  49. constexpr float calibration_radius_factor = 1;
  50. #endif
  51. #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU)
  52. float delta_calibration_radius();
  53. #endif
  54. /**
  55. * Delta Inverse Kinematics
  56. *
  57. * Calculate the tower positions for a given machine
  58. * position, storing the result in the delta[] array.
  59. *
  60. * This is an expensive calculation, requiring 3 square
  61. * roots per segmented linear move, and strains the limits
  62. * of a Mega2560 with a Graphical Display.
  63. *
  64. * Suggested optimizations include:
  65. *
  66. * - Disable the home_offset (M206) and/or position_shift (G92)
  67. * features to remove up to 12 float additions.
  68. *
  69. * - Use a fast-inverse-sqrt function and add the reciprocal.
  70. * (see above)
  71. */
  72. // Macro to obtain the Z position of an individual tower
  73. #define DELTA_Z(V,T) V.z + SQRT( \
  74. delta_diagonal_rod_2_tower[T] - HYPOT2( \
  75. delta_tower[T].x - V.x, \
  76. delta_tower[T].y - V.y \
  77. ) \
  78. )
  79. #define DELTA_IK(V) delta.set(DELTA_Z(V, A_AXIS), DELTA_Z(V, B_AXIS), DELTA_Z(V, C_AXIS))
  80. void inverse_kinematics(const xyz_pos_t &raw);
  81. /**
  82. * Calculate the highest Z position where the
  83. * effector has the full range of XY motion.
  84. */
  85. float delta_safe_distance_from_top();
  86. /**
  87. * Delta Forward Kinematics
  88. *
  89. * See the Wikipedia article "Trilateration"
  90. * https://en.wikipedia.org/wiki/Trilateration
  91. *
  92. * Establish a new coordinate system in the plane of the
  93. * three carriage points. This system has its origin at
  94. * tower1, with tower2 on the X axis. Tower3 is in the X-Y
  95. * plane with a Z component of zero.
  96. * We will define unit vectors in this coordinate system
  97. * in our original coordinate system. Then when we calculate
  98. * the Xnew, Ynew and Znew values, we can translate back into
  99. * the original system by moving along those unit vectors
  100. * by the corresponding values.
  101. *
  102. * Variable names matched to Marlin, c-version, and avoid the
  103. * use of any vector library.
  104. *
  105. * by Andreas Hardtung 2016-06-07
  106. * based on a Java function from "Delta Robot Kinematics V3"
  107. * by Steve Graves
  108. *
  109. * The result is stored in the cartes[] array.
  110. */
  111. void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3);
  112. FORCE_INLINE void forward_kinematics_DELTA(const abc_float_t &point) {
  113. forward_kinematics_DELTA(point.a, point.b, point.c);
  114. }
  115. void home_delta();