My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. #include "../../inc/MarlinConfig.h"
  23. #if ENABLED(REPETIER_GCODE_M360)
  24. #include "../gcode.h"
  25. #include "../../module/motion.h"
  26. #include "../../module/planner.h"
  27. #if HAS_EXTRUDERS
  28. #include "../../module/temperature.h"
  29. #endif
  30. static void config_prefix(PGM_P const name, PGM_P const pref=nullptr, const int8_t ind=-1) {
  31. SERIAL_ECHOPGM("Config:");
  32. if (pref) SERIAL_ECHOPGM_P(pref);
  33. if (ind >= 0) { SERIAL_ECHO(ind); SERIAL_CHAR(':'); }
  34. SERIAL_ECHOPGM_P(name, AS_CHAR(':'));
  35. }
  36. static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr, const int8_t ind=-1) {
  37. config_prefix(name, pref, ind);
  38. SERIAL_ECHOLN(val);
  39. }
  40. static void config_line(FSTR_P const name, const float val, FSTR_P const pref=nullptr, const int8_t ind=-1) {
  41. config_line(FTOP(name), val, FTOP(pref) , ind);
  42. }
  43. static void config_line_e(const int8_t e, PGM_P const name, const float val) {
  44. config_line(name, val, PSTR("Extr."), e + 1);
  45. }
  46. static void config_line_e(const int8_t e, FSTR_P const name, const float val) {
  47. config_line_e(e, FTOP(name), val);
  48. }
  49. /**
  50. * M360: Report Firmware configuration
  51. * in RepRapFirmware-compatible format
  52. */
  53. void GcodeSuite::M360() {
  54. PGMSTR(X_STR, "X");
  55. PGMSTR(Y_STR, "Y");
  56. PGMSTR(Z_STR, "Z");
  57. PGMSTR(JERK_STR, "Jerk");
  58. //
  59. // Basics and Enabled items
  60. //
  61. config_line(F("Baudrate"), BAUDRATE);
  62. config_line(F("InputBuffer"), MAX_CMD_SIZE);
  63. config_line(F("PrintlineCache"), BUFSIZE);
  64. config_line(F("MixingExtruder"), ENABLED(MIXING_EXTRUDER));
  65. config_line(F("SDCard"), ENABLED(SDSUPPORT));
  66. config_line(F("Fan"), ENABLED(HAS_FAN));
  67. config_line(F("LCD"), ENABLED(HAS_DISPLAY));
  68. config_line(F("SoftwarePowerSwitch"), 1);
  69. config_line(F("SupportLocalFilamentchange"), ENABLED(ADVANCED_PAUSE_FEATURE));
  70. config_line(F("CaseLights"), ENABLED(CASE_LIGHT_ENABLE));
  71. config_line(F("ZProbe"), ENABLED(HAS_BED_PROBE));
  72. config_line(F("Autolevel"), ENABLED(HAS_LEVELING));
  73. config_line(F("EEPROM"), ENABLED(EEPROM_SETTINGS));
  74. //
  75. // Homing Directions
  76. //
  77. PGMSTR(H_DIR_STR, "HomeDir");
  78. config_line(H_DIR_STR, X_HOME_DIR, X_STR);
  79. config_line(H_DIR_STR, Y_HOME_DIR, Y_STR);
  80. config_line(H_DIR_STR, Z_HOME_DIR, Z_STR);
  81. //
  82. // XYZ Axis Jerk
  83. //
  84. #if HAS_CLASSIC_JERK
  85. if (planner.max_jerk.x == planner.max_jerk.y)
  86. config_line(F("XY"), planner.max_jerk.x, FPSTR(JERK_STR));
  87. else {
  88. config_line(X_STR, planner.max_jerk.x, JERK_STR);
  89. config_line(Y_STR, planner.max_jerk.y, JERK_STR);
  90. }
  91. config_line(Z_STR, planner.max_jerk.z, JERK_STR);
  92. #endif
  93. //
  94. // Firmware Retraction
  95. //
  96. config_line(F("SupportG10G11"), ENABLED(FWRETRACT));
  97. #if ENABLED(FWRETRACT)
  98. PGMSTR(RET_STR, "Retraction");
  99. PGMSTR(UNRET_STR, "RetractionUndo");
  100. PGMSTR(SPEED_STR, "Speed");
  101. // M10 Retract with swap (long) moves
  102. config_line(F("Length"), fwretract.settings.retract_length, FPSTR(RET_STR));
  103. config_line(SPEED_STR, fwretract.settings.retract_feedrate_mm_s, RET_STR);
  104. config_line(F("ZLift"), fwretract.settings.retract_zraise, FPSTR(RET_STR));
  105. config_line(F("LongLength"), fwretract.settings.swap_retract_length, FPSTR(RET_STR));
  106. // M11 Recover (undo) with swap (long) moves
  107. config_line(SPEED_STR, fwretract.settings.retract_recover_feedrate_mm_s, UNRET_STR);
  108. config_line(F("ExtraLength"), fwretract.settings.retract_recover_extra, FPSTR(UNRET_STR));
  109. config_line(F("ExtraLongLength"), fwretract.settings.swap_retract_recover_extra, FPSTR(UNRET_STR));
  110. config_line(F("LongSpeed"), fwretract.settings.swap_retract_recover_feedrate_mm_s, FPSTR(UNRET_STR));
  111. #endif
  112. //
  113. // Workspace boundaries
  114. //
  115. const xyz_pos_t dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
  116. dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
  117. xyz_pos_t cmin = dmin, cmax = dmax;
  118. apply_motion_limits(cmin);
  119. apply_motion_limits(cmax);
  120. const xyz_pos_t wmin = cmin.asLogical(), wmax = cmax.asLogical();
  121. PGMSTR(MIN_STR, "Min");
  122. PGMSTR(MAX_STR, "Max");
  123. PGMSTR(SIZE_STR, "Size");
  124. config_line(MIN_STR, wmin.x, X_STR);
  125. config_line(MIN_STR, wmin.y, Y_STR);
  126. config_line(MIN_STR, wmin.z, Z_STR);
  127. config_line(MAX_STR, wmax.x, X_STR);
  128. config_line(MAX_STR, wmax.y, Y_STR);
  129. config_line(MAX_STR, wmax.z, Z_STR);
  130. config_line(SIZE_STR, wmax.x - wmin.x, X_STR);
  131. config_line(SIZE_STR, wmax.y - wmin.y, Y_STR);
  132. config_line(SIZE_STR, wmax.z - wmin.z, Z_STR);
  133. //
  134. // Print and Travel Acceleration
  135. //
  136. #define _ACCEL(A,B) _MIN(planner.settings.max_acceleration_mm_per_s2[A##_AXIS], planner.settings.B)
  137. PGMSTR(P_ACC_STR, "PrintAccel");
  138. PGMSTR(T_ACC_STR, "TravelAccel");
  139. config_line(P_ACC_STR, _ACCEL(X, acceleration), X_STR);
  140. config_line(P_ACC_STR, _ACCEL(Y, acceleration), Y_STR);
  141. config_line(P_ACC_STR, _ACCEL(Z, acceleration), Z_STR);
  142. config_line(T_ACC_STR, _ACCEL(X, travel_acceleration), X_STR);
  143. config_line(T_ACC_STR, _ACCEL(Y, travel_acceleration), Y_STR);
  144. config_line(T_ACC_STR, _ACCEL(Z, travel_acceleration), Z_STR);
  145. config_prefix(PSTR("PrinterType"));
  146. SERIAL_ECHOLNPGM(
  147. TERN_(DELTA, "Delta")
  148. TERN_(IS_SCARA, "SCARA")
  149. TERN_(IS_CORE, "Core")
  150. TERN_(MARKFORGED_XY, "MarkForgedXY")
  151. TERN_(MARKFORGED_YX, "MarkForgedYX")
  152. TERN_(IS_CARTESIAN, "Cartesian")
  153. );
  154. //
  155. // Heated Bed
  156. //
  157. config_line(F("HeatedBed"), ENABLED(HAS_HEATED_BED));
  158. #if HAS_HEATED_BED
  159. config_line(F("MaxBedTemp"), BED_MAX_TARGET);
  160. #endif
  161. //
  162. // Per-Extruder settings
  163. //
  164. config_line(F("NumExtruder"), EXTRUDERS);
  165. #if HAS_EXTRUDERS
  166. EXTRUDER_LOOP() {
  167. config_line_e(e, JERK_STR, TERN(HAS_LINEAR_E_JERK, planner.max_e_jerk[E_INDEX_N(e)], TERN(HAS_CLASSIC_JERK, planner.max_jerk.e, DEFAULT_EJERK)));
  168. config_line_e(e, F("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(e)]);
  169. config_line_e(e, F("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(e)]);
  170. config_line_e(e, F("Diameter"), TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[e]));
  171. config_line_e(e, F("MaxTemp"), thermalManager.hotend_maxtemp[e]);
  172. }
  173. #endif
  174. }
  175. #endif