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.

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