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.

M360.cpp 6.6KB

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