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

configuration_store.cpp 31KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 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. /**
  23. * configuration_store.cpp
  24. *
  25. * Configuration and EEPROM storage
  26. *
  27. * IMPORTANT: Whenever there are changes made to the variables stored in EEPROM
  28. * in the functions below, also increment the version number. This makes sure that
  29. * the default values are used whenever there is a change to the data, to prevent
  30. * wrong data being written to the variables.
  31. *
  32. * ALSO: Variables in the Store and Retrieve sections must be in the same order.
  33. * If a feature is disabled, some data must still be written that, when read,
  34. * either sets a Sane Default, or results in No Change to the existing value.
  35. *
  36. */
  37. #define EEPROM_VERSION "V27"
  38. // Change EEPROM version if these are changed:
  39. #define EEPROM_OFFSET 100
  40. /**
  41. * V27 EEPROM Layout:
  42. *
  43. * 100 Version (char x4)
  44. * 104 EEPROM Checksum (uint16_t)
  45. *
  46. * 106 M92 XYZE planner.axis_steps_per_mm (float x4)
  47. * 122 M203 XYZE planner.max_feedrate_mm_s (float x4)
  48. * 138 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4)
  49. * 154 M204 P planner.acceleration (float)
  50. * 158 M204 R planner.retract_acceleration (float)
  51. * 162 M204 T planner.travel_acceleration (float)
  52. * 166 M205 S planner.min_feedrate_mm_s (float)
  53. * 170 M205 T planner.min_travel_feedrate_mm_s (float)
  54. * 174 M205 B planner.min_segment_time (ulong)
  55. * 178 M205 X planner.max_jerk[X_AXIS] (float)
  56. * 182 M205 Y planner.max_jerk[Y_AXIS] (float)
  57. * 186 M205 Z planner.max_jerk[Z_AXIS] (float)
  58. * 190 M205 E planner.max_jerk[E_AXIS] (float)
  59. * 194 M206 XYZ home_offset (float x3)
  60. * 206 M218 XYZ hotend_offset (float x3 per additional hotend)
  61. *
  62. * Mesh bed leveling:
  63. * 218 M420 S status (uint8)
  64. * 219 z_offset (float)
  65. * 223 mesh_num_x (uint8 as set in firmware)
  66. * 224 mesh_num_y (uint8 as set in firmware)
  67. * 225 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81)
  68. *
  69. * AUTO BED LEVELING
  70. * 261 M851 zprobe_zoffset (float)
  71. *
  72. * DELTA:
  73. * 265 M666 XYZ endstop_adj (float x3)
  74. * 277 M665 R delta_radius (float)
  75. * 281 M665 L delta_diagonal_rod (float)
  76. * 285 M665 S delta_segments_per_second (float)
  77. * 289 M665 A delta_diagonal_rod_trim_tower_1 (float)
  78. * 293 M665 B delta_diagonal_rod_trim_tower_2 (float)
  79. * 297 M665 C delta_diagonal_rod_trim_tower_3 (float)
  80. *
  81. * Z_DUAL_ENDSTOPS:
  82. * 301 M666 Z z_endstop_adj (float)
  83. *
  84. * ULTIPANEL:
  85. * 305 M145 S0 H lcd_preheat_hotend_temp (int x2)
  86. * 309 M145 S0 B lcd_preheat_bed_temp (int x2)
  87. * 313 M145 S0 F lcd_preheat_fan_speed (int x2)
  88. *
  89. * PIDTEMP:
  90. * 317 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4)
  91. * 333 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4)
  92. * 349 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4)
  93. * 365 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4)
  94. * 381 M301 L lpq_len (int)
  95. *
  96. * PIDTEMPBED:
  97. * 383 M304 PID thermalManager.bedKp, thermalManager.bedKi, thermalManager.bedKd (float x3)
  98. *
  99. * DOGLCD:
  100. * 395 M250 C lcd_contrast (int)
  101. *
  102. * FWRETRACT:
  103. * 397 M209 S autoretract_enabled (bool)
  104. * 398 M207 S retract_length (float)
  105. * 402 M207 W retract_length_swap (float)
  106. * 406 M207 F retract_feedrate_mm_s (float)
  107. * 410 M207 Z retract_zlift (float)
  108. * 414 M208 S retract_recover_length (float)
  109. * 418 M208 W retract_recover_length_swap (float)
  110. * 422 M208 F retract_recover_feedrate_mm_s (float)
  111. *
  112. * Volumetric Extrusion:
  113. * 426 M200 D volumetric_enabled (bool)
  114. * 427 M200 T D filament_size (float x4) (T0..3)
  115. *
  116. * 443 This Slot is Available!
  117. *
  118. */
  119. #include "Marlin.h"
  120. #include "language.h"
  121. #include "endstops.h"
  122. #include "planner.h"
  123. #include "temperature.h"
  124. #include "ultralcd.h"
  125. #include "configuration_store.h"
  126. #if ENABLED(MESH_BED_LEVELING)
  127. #include "mesh_bed_leveling.h"
  128. #endif
  129. uint16_t eeprom_checksum;
  130. const char version[4] = EEPROM_VERSION;
  131. void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
  132. uint8_t c;
  133. while (size--) {
  134. eeprom_write_byte((unsigned char*)pos, *value);
  135. c = eeprom_read_byte((unsigned char*)pos);
  136. if (c != *value) {
  137. SERIAL_ECHO_START;
  138. SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
  139. }
  140. eeprom_checksum += c;
  141. pos++;
  142. value++;
  143. };
  144. }
  145. void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
  146. do {
  147. uint8_t c = eeprom_read_byte((unsigned char*)pos);
  148. *value = c;
  149. eeprom_checksum += c;
  150. pos++;
  151. value++;
  152. } while (--size);
  153. }
  154. /**
  155. * Post-process after Retrieve or Reset
  156. */
  157. void Config_Postprocess() {
  158. // steps per s2 needs to be updated to agree with units per s2
  159. planner.reset_acceleration_rates();
  160. // Make sure delta kinematics are updated before refreshing the
  161. // planner position so the stepper counts will be set correctly.
  162. #if ENABLED(DELTA)
  163. recalc_delta_settings(delta_radius, delta_diagonal_rod);
  164. #endif
  165. // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm
  166. // and init stepper.count[], planner.position[] with current_position
  167. planner.refresh_positioning();
  168. #if ENABLED(PIDTEMP)
  169. thermalManager.updatePID();
  170. #endif
  171. calculate_volumetric_multipliers();
  172. // Software endstops depend on home_offset
  173. LOOP_XYZ(i) update_software_endstops((AxisEnum)i);
  174. }
  175. #if ENABLED(EEPROM_SETTINGS)
  176. #define DUMMY_PID_VALUE 3000.0f
  177. #define EEPROM_START() int eeprom_index = EEPROM_OFFSET
  178. #define EEPROM_SKIP(VAR) eeprom_index += sizeof(VAR)
  179. #define EEPROM_WRITE(VAR) _EEPROM_writeData(eeprom_index, (uint8_t*)&VAR, sizeof(VAR))
  180. #define EEPROM_READ(VAR) _EEPROM_readData(eeprom_index, (uint8_t*)&VAR, sizeof(VAR))
  181. /**
  182. * M500 - Store Configuration
  183. */
  184. void Config_StoreSettings() {
  185. float dummy = 0.0f;
  186. char ver[4] = "000";
  187. EEPROM_START();
  188. EEPROM_WRITE(ver); // invalidate data first
  189. EEPROM_SKIP(eeprom_checksum); // Skip the checksum slot
  190. eeprom_checksum = 0; // clear before first "real data"
  191. EEPROM_WRITE(planner.axis_steps_per_mm);
  192. EEPROM_WRITE(planner.max_feedrate_mm_s);
  193. EEPROM_WRITE(planner.max_acceleration_mm_per_s2);
  194. EEPROM_WRITE(planner.acceleration);
  195. EEPROM_WRITE(planner.retract_acceleration);
  196. EEPROM_WRITE(planner.travel_acceleration);
  197. EEPROM_WRITE(planner.min_feedrate_mm_s);
  198. EEPROM_WRITE(planner.min_travel_feedrate_mm_s);
  199. EEPROM_WRITE(planner.min_segment_time);
  200. EEPROM_WRITE(planner.max_jerk);
  201. EEPROM_WRITE(home_offset);
  202. #if HOTENDS > 1
  203. // Skip hotend 0 which must be 0
  204. for (uint8_t e = 1; e < HOTENDS; e++)
  205. LOOP_XYZ(i) EEPROM_WRITE(hotend_offset[i][e]);
  206. #endif
  207. #if ENABLED(MESH_BED_LEVELING)
  208. // Compile time test that sizeof(mbl.z_values) is as expected
  209. typedef char c_assert[(sizeof(mbl.z_values) == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) * sizeof(dummy)) ? 1 : -1];
  210. uint8_t mesh_num_x = MESH_NUM_X_POINTS,
  211. mesh_num_y = MESH_NUM_Y_POINTS,
  212. dummy_uint8 = mbl.status & _BV(MBL_STATUS_HAS_MESH_BIT);
  213. EEPROM_WRITE(dummy_uint8);
  214. EEPROM_WRITE(mbl.z_offset);
  215. EEPROM_WRITE(mesh_num_x);
  216. EEPROM_WRITE(mesh_num_y);
  217. EEPROM_WRITE(mbl.z_values);
  218. #else
  219. // For disabled MBL write a default mesh
  220. uint8_t mesh_num_x = 3,
  221. mesh_num_y = 3,
  222. dummy_uint8 = 0;
  223. dummy = 0.0f;
  224. EEPROM_WRITE(dummy_uint8);
  225. EEPROM_WRITE(dummy);
  226. EEPROM_WRITE(mesh_num_x);
  227. EEPROM_WRITE(mesh_num_y);
  228. for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_WRITE(dummy);
  229. #endif // MESH_BED_LEVELING
  230. #if !HAS_BED_PROBE
  231. float zprobe_zoffset = 0;
  232. #endif
  233. EEPROM_WRITE(zprobe_zoffset);
  234. // 9 floats for DELTA / Z_DUAL_ENDSTOPS
  235. #if ENABLED(DELTA)
  236. EEPROM_WRITE(endstop_adj); // 3 floats
  237. EEPROM_WRITE(delta_radius); // 1 float
  238. EEPROM_WRITE(delta_diagonal_rod); // 1 float
  239. EEPROM_WRITE(delta_segments_per_second); // 1 float
  240. EEPROM_WRITE(delta_diagonal_rod_trim_tower_1); // 1 float
  241. EEPROM_WRITE(delta_diagonal_rod_trim_tower_2); // 1 float
  242. EEPROM_WRITE(delta_diagonal_rod_trim_tower_3); // 1 float
  243. #elif ENABLED(Z_DUAL_ENDSTOPS)
  244. EEPROM_WRITE(z_endstop_adj); // 1 float
  245. dummy = 0.0f;
  246. for (uint8_t q = 8; q--;) EEPROM_WRITE(dummy);
  247. #else
  248. dummy = 0.0f;
  249. for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy);
  250. #endif
  251. #if DISABLED(ULTIPANEL)
  252. const int lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND },
  253. lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED },
  254. lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED };
  255. #endif // !ULTIPANEL
  256. EEPROM_WRITE(lcd_preheat_hotend_temp);
  257. EEPROM_WRITE(lcd_preheat_bed_temp);
  258. EEPROM_WRITE(lcd_preheat_fan_speed);
  259. for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) {
  260. #if ENABLED(PIDTEMP)
  261. if (e < HOTENDS) {
  262. EEPROM_WRITE(PID_PARAM(Kp, e));
  263. EEPROM_WRITE(PID_PARAM(Ki, e));
  264. EEPROM_WRITE(PID_PARAM(Kd, e));
  265. #if ENABLED(PID_EXTRUSION_SCALING)
  266. EEPROM_WRITE(PID_PARAM(Kc, e));
  267. #else
  268. dummy = 1.0f; // 1.0 = default kc
  269. EEPROM_WRITE(dummy);
  270. #endif
  271. }
  272. else
  273. #endif // !PIDTEMP
  274. {
  275. dummy = DUMMY_PID_VALUE; // When read, will not change the existing value
  276. EEPROM_WRITE(dummy); // Kp
  277. dummy = 0.0f;
  278. for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); // Ki, Kd, Kc
  279. }
  280. } // Hotends Loop
  281. #if DISABLED(PID_EXTRUSION_SCALING)
  282. int lpq_len = 20;
  283. #endif
  284. EEPROM_WRITE(lpq_len);
  285. #if DISABLED(PIDTEMPBED)
  286. dummy = DUMMY_PID_VALUE;
  287. for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy);
  288. #else
  289. EEPROM_WRITE(thermalManager.bedKp);
  290. EEPROM_WRITE(thermalManager.bedKi);
  291. EEPROM_WRITE(thermalManager.bedKd);
  292. #endif
  293. #if !HAS_LCD_CONTRAST
  294. const int lcd_contrast = 32;
  295. #endif
  296. EEPROM_WRITE(lcd_contrast);
  297. #if ENABLED(FWRETRACT)
  298. EEPROM_WRITE(autoretract_enabled);
  299. EEPROM_WRITE(retract_length);
  300. #if EXTRUDERS > 1
  301. EEPROM_WRITE(retract_length_swap);
  302. #else
  303. dummy = 0.0f;
  304. EEPROM_WRITE(dummy);
  305. #endif
  306. EEPROM_WRITE(retract_feedrate_mm_s);
  307. EEPROM_WRITE(retract_zlift);
  308. EEPROM_WRITE(retract_recover_length);
  309. #if EXTRUDERS > 1
  310. EEPROM_WRITE(retract_recover_length_swap);
  311. #else
  312. dummy = 0.0f;
  313. EEPROM_WRITE(dummy);
  314. #endif
  315. EEPROM_WRITE(retract_recover_feedrate_mm_s);
  316. #endif // FWRETRACT
  317. EEPROM_WRITE(volumetric_enabled);
  318. // Save filament sizes
  319. for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
  320. if (q < COUNT(filament_size)) dummy = filament_size[q];
  321. EEPROM_WRITE(dummy);
  322. }
  323. uint16_t final_checksum = eeprom_checksum,
  324. eeprom_size = eeprom_index;
  325. eeprom_index = EEPROM_OFFSET;
  326. EEPROM_WRITE(version);
  327. EEPROM_WRITE(final_checksum);
  328. // Report storage size
  329. SERIAL_ECHO_START;
  330. SERIAL_ECHOPAIR("Settings Stored (", eeprom_size);
  331. SERIAL_ECHOLNPGM(" bytes)");
  332. }
  333. /**
  334. * M501 - Retrieve Configuration
  335. */
  336. void Config_RetrieveSettings() {
  337. EEPROM_START();
  338. char stored_ver[4];
  339. EEPROM_READ(stored_ver);
  340. uint16_t stored_checksum;
  341. EEPROM_READ(stored_checksum);
  342. // SERIAL_ECHOPAIR("Version: [", ver);
  343. // SERIAL_ECHOPAIR("] Stored version: [", stored_ver);
  344. // SERIAL_CHAR(']');
  345. // SERIAL_EOL;
  346. if (strncmp(version, stored_ver, 3) != 0) {
  347. Config_ResetDefault();
  348. }
  349. else {
  350. float dummy = 0;
  351. eeprom_checksum = 0; // clear before reading first "real data"
  352. // version number match
  353. EEPROM_READ(planner.axis_steps_per_mm);
  354. EEPROM_READ(planner.max_feedrate_mm_s);
  355. EEPROM_READ(planner.max_acceleration_mm_per_s2);
  356. EEPROM_READ(planner.acceleration);
  357. EEPROM_READ(planner.retract_acceleration);
  358. EEPROM_READ(planner.travel_acceleration);
  359. EEPROM_READ(planner.min_feedrate_mm_s);
  360. EEPROM_READ(planner.min_travel_feedrate_mm_s);
  361. EEPROM_READ(planner.min_segment_time);
  362. EEPROM_READ(planner.max_jerk);
  363. EEPROM_READ(home_offset);
  364. #if HOTENDS > 1
  365. // Skip hotend 0 which must be 0
  366. for (uint8_t e = 1; e < HOTENDS; e++)
  367. LOOP_XYZ(i) EEPROM_READ(hotend_offset[i][e]);
  368. #endif
  369. uint8_t dummy_uint8 = 0, mesh_num_x = 0, mesh_num_y = 0;
  370. EEPROM_READ(dummy_uint8);
  371. EEPROM_READ(dummy);
  372. EEPROM_READ(mesh_num_x);
  373. EEPROM_READ(mesh_num_y);
  374. #if ENABLED(MESH_BED_LEVELING)
  375. mbl.status = dummy_uint8;
  376. mbl.z_offset = dummy;
  377. if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) {
  378. // EEPROM data fits the current mesh
  379. EEPROM_READ(mbl.z_values);
  380. }
  381. else {
  382. // EEPROM data is stale
  383. mbl.reset();
  384. for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ(dummy);
  385. }
  386. #else
  387. // MBL is disabled - skip the stored data
  388. for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ(dummy);
  389. #endif // MESH_BED_LEVELING
  390. #if !HAS_BED_PROBE
  391. float zprobe_zoffset = 0;
  392. #endif
  393. EEPROM_READ(zprobe_zoffset);
  394. #if ENABLED(DELTA)
  395. EEPROM_READ(endstop_adj); // 3 floats
  396. EEPROM_READ(delta_radius); // 1 float
  397. EEPROM_READ(delta_diagonal_rod); // 1 float
  398. EEPROM_READ(delta_segments_per_second); // 1 float
  399. EEPROM_READ(delta_diagonal_rod_trim_tower_1); // 1 float
  400. EEPROM_READ(delta_diagonal_rod_trim_tower_2); // 1 float
  401. EEPROM_READ(delta_diagonal_rod_trim_tower_3); // 1 float
  402. #elif ENABLED(Z_DUAL_ENDSTOPS)
  403. EEPROM_READ(z_endstop_adj);
  404. dummy = 0.0f;
  405. for (uint8_t q=8; q--;) EEPROM_READ(dummy);
  406. #else
  407. dummy = 0.0f;
  408. for (uint8_t q=9; q--;) EEPROM_READ(dummy);
  409. #endif
  410. #if DISABLED(ULTIPANEL)
  411. int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
  412. #endif
  413. EEPROM_READ(lcd_preheat_hotend_temp);
  414. EEPROM_READ(lcd_preheat_bed_temp);
  415. EEPROM_READ(lcd_preheat_fan_speed);
  416. #if ENABLED(PIDTEMP)
  417. for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) {
  418. EEPROM_READ(dummy); // Kp
  419. if (e < HOTENDS && dummy != DUMMY_PID_VALUE) {
  420. // do not need to scale PID values as the values in EEPROM are already scaled
  421. PID_PARAM(Kp, e) = dummy;
  422. EEPROM_READ(PID_PARAM(Ki, e));
  423. EEPROM_READ(PID_PARAM(Kd, e));
  424. #if ENABLED(PID_EXTRUSION_SCALING)
  425. EEPROM_READ(PID_PARAM(Kc, e));
  426. #else
  427. EEPROM_READ(dummy);
  428. #endif
  429. }
  430. else {
  431. for (uint8_t q=3; q--;) EEPROM_READ(dummy); // Ki, Kd, Kc
  432. }
  433. }
  434. #else // !PIDTEMP
  435. // 4 x 4 = 16 slots for PID parameters
  436. for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ(dummy); // Kp, Ki, Kd, Kc
  437. #endif // !PIDTEMP
  438. #if DISABLED(PID_EXTRUSION_SCALING)
  439. int lpq_len;
  440. #endif
  441. EEPROM_READ(lpq_len);
  442. #if ENABLED(PIDTEMPBED)
  443. EEPROM_READ(dummy); // bedKp
  444. if (dummy != DUMMY_PID_VALUE) {
  445. thermalManager.bedKp = dummy;
  446. EEPROM_READ(thermalManager.bedKi);
  447. EEPROM_READ(thermalManager.bedKd);
  448. }
  449. #else
  450. for (uint8_t q=3; q--;) EEPROM_READ(dummy); // bedKp, bedKi, bedKd
  451. #endif
  452. #if !HAS_LCD_CONTRAST
  453. int lcd_contrast;
  454. #endif
  455. EEPROM_READ(lcd_contrast);
  456. #if ENABLED(FWRETRACT)
  457. EEPROM_READ(autoretract_enabled);
  458. EEPROM_READ(retract_length);
  459. #if EXTRUDERS > 1
  460. EEPROM_READ(retract_length_swap);
  461. #else
  462. EEPROM_READ(dummy);
  463. #endif
  464. EEPROM_READ(retract_feedrate_mm_s);
  465. EEPROM_READ(retract_zlift);
  466. EEPROM_READ(retract_recover_length);
  467. #if EXTRUDERS > 1
  468. EEPROM_READ(retract_recover_length_swap);
  469. #else
  470. EEPROM_READ(dummy);
  471. #endif
  472. EEPROM_READ(retract_recover_feedrate_mm_s);
  473. #endif // FWRETRACT
  474. EEPROM_READ(volumetric_enabled);
  475. for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
  476. EEPROM_READ(dummy);
  477. if (q < COUNT(filament_size)) filament_size[q] = dummy;
  478. }
  479. if (eeprom_checksum == stored_checksum) {
  480. Config_Postprocess();
  481. SERIAL_ECHO_START;
  482. SERIAL_ECHO(version);
  483. SERIAL_ECHOPAIR(" stored settings retrieved (", eeprom_index);
  484. SERIAL_ECHOLNPGM(" bytes)");
  485. }
  486. else {
  487. SERIAL_ERROR_START;
  488. SERIAL_ERRORLNPGM("EEPROM checksum mismatch");
  489. Config_ResetDefault();
  490. }
  491. }
  492. #if ENABLED(EEPROM_CHITCHAT)
  493. Config_PrintSettings();
  494. #endif
  495. }
  496. #else // !EEPROM_SETTINGS
  497. void Config_StoreSettings() {
  498. SERIAL_ERROR_START;
  499. SERIAL_ERRORLNPGM("EEPROM disabled");
  500. }
  501. #endif // !EEPROM_SETTINGS
  502. /**
  503. * M502 - Reset Configuration
  504. */
  505. void Config_ResetDefault() {
  506. const float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT, tmp2[] = DEFAULT_MAX_FEEDRATE;
  507. const long tmp3[] = DEFAULT_MAX_ACCELERATION;
  508. LOOP_XYZE(i) {
  509. planner.axis_steps_per_mm[i] = tmp1[i];
  510. planner.max_feedrate_mm_s[i] = tmp2[i];
  511. planner.max_acceleration_mm_per_s2[i] = tmp3[i];
  512. }
  513. planner.acceleration = DEFAULT_ACCELERATION;
  514. planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
  515. planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
  516. planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE;
  517. planner.min_segment_time = DEFAULT_MINSEGMENTTIME;
  518. planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE;
  519. planner.max_jerk[X_AXIS] = DEFAULT_XJERK;
  520. planner.max_jerk[Y_AXIS] = DEFAULT_YJERK;
  521. planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK;
  522. planner.max_jerk[E_AXIS] = DEFAULT_EJERK;
  523. home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0;
  524. #if HOTENDS > 1
  525. constexpr float tmp4[XYZ][HOTENDS] = {
  526. HOTEND_OFFSET_X,
  527. HOTEND_OFFSET_Y
  528. #ifdef HOTEND_OFFSET_Z
  529. , HOTEND_OFFSET_Z
  530. #else
  531. , { 0 }
  532. #endif
  533. };
  534. static_assert(
  535. tmp4[X_AXIS][0] == 0 && tmp4[Y_AXIS][0] == 0 && tmp4[Z_AXIS][0] == 0,
  536. "Offsets for the first hotend must be 0.0."
  537. );
  538. LOOP_XYZ(i) HOTEND_LOOP() hotend_offset[i][e] = tmp4[i][e];
  539. #endif
  540. #if ENABLED(MESH_BED_LEVELING)
  541. mbl.reset();
  542. #endif
  543. #if HAS_BED_PROBE
  544. zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
  545. #endif
  546. #if ENABLED(DELTA)
  547. const float adj[ABC] = DELTA_ENDSTOP_ADJ;
  548. endstop_adj[A_AXIS] = adj[A_AXIS];
  549. endstop_adj[B_AXIS] = adj[B_AXIS];
  550. endstop_adj[C_AXIS] = adj[C_AXIS];
  551. delta_radius = DELTA_RADIUS;
  552. delta_diagonal_rod = DELTA_DIAGONAL_ROD;
  553. delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
  554. delta_diagonal_rod_trim_tower_1 = DELTA_DIAGONAL_ROD_TRIM_TOWER_1;
  555. delta_diagonal_rod_trim_tower_2 = DELTA_DIAGONAL_ROD_TRIM_TOWER_2;
  556. delta_diagonal_rod_trim_tower_3 = DELTA_DIAGONAL_ROD_TRIM_TOWER_3;
  557. #elif ENABLED(Z_DUAL_ENDSTOPS)
  558. z_endstop_adj = 0;
  559. #endif
  560. #if ENABLED(ULTIPANEL)
  561. lcd_preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND;
  562. lcd_preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND;
  563. lcd_preheat_bed_temp[0] = PREHEAT_1_TEMP_BED;
  564. lcd_preheat_bed_temp[1] = PREHEAT_2_TEMP_BED;
  565. lcd_preheat_fan_speed[0] = PREHEAT_1_FAN_SPEED;
  566. lcd_preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED;
  567. #endif
  568. #if HAS_LCD_CONTRAST
  569. lcd_contrast = DEFAULT_LCD_CONTRAST;
  570. #endif
  571. #if ENABLED(PIDTEMP)
  572. #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
  573. HOTEND_LOOP()
  574. #else
  575. int e = 0; UNUSED(e); // only need to write once
  576. #endif
  577. {
  578. PID_PARAM(Kp, e) = DEFAULT_Kp;
  579. PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki);
  580. PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd);
  581. #if ENABLED(PID_EXTRUSION_SCALING)
  582. PID_PARAM(Kc, e) = DEFAULT_Kc;
  583. #endif
  584. }
  585. #if ENABLED(PID_EXTRUSION_SCALING)
  586. lpq_len = 20; // default last-position-queue size
  587. #endif
  588. #endif // PIDTEMP
  589. #if ENABLED(PIDTEMPBED)
  590. thermalManager.bedKp = DEFAULT_bedKp;
  591. thermalManager.bedKi = scalePID_i(DEFAULT_bedKi);
  592. thermalManager.bedKd = scalePID_d(DEFAULT_bedKd);
  593. #endif
  594. #if ENABLED(FWRETRACT)
  595. autoretract_enabled = false;
  596. retract_length = RETRACT_LENGTH;
  597. #if EXTRUDERS > 1
  598. retract_length_swap = RETRACT_LENGTH_SWAP;
  599. #endif
  600. retract_feedrate_mm_s = RETRACT_FEEDRATE;
  601. retract_zlift = RETRACT_ZLIFT;
  602. retract_recover_length = RETRACT_RECOVER_LENGTH;
  603. #if EXTRUDERS > 1
  604. retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
  605. #endif
  606. retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE;
  607. #endif
  608. volumetric_enabled = false;
  609. for (uint8_t q = 0; q < COUNT(filament_size); q++)
  610. filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA;
  611. endstops.enable_globally(
  612. #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
  613. (true)
  614. #else
  615. (false)
  616. #endif
  617. );
  618. Config_Postprocess();
  619. SERIAL_ECHO_START;
  620. SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
  621. }
  622. #if DISABLED(DISABLE_M503)
  623. #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START; }while(0)
  624. /**
  625. * M503 - Print Configuration
  626. */
  627. void Config_PrintSettings(bool forReplay) {
  628. // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
  629. CONFIG_ECHO_START;
  630. if (!forReplay) {
  631. SERIAL_ECHOLNPGM("Steps per unit:");
  632. CONFIG_ECHO_START;
  633. }
  634. SERIAL_ECHOPAIR(" M92 X", planner.axis_steps_per_mm[X_AXIS]);
  635. SERIAL_ECHOPAIR(" Y", planner.axis_steps_per_mm[Y_AXIS]);
  636. SERIAL_ECHOPAIR(" Z", planner.axis_steps_per_mm[Z_AXIS]);
  637. SERIAL_ECHOPAIR(" E", planner.axis_steps_per_mm[E_AXIS]);
  638. SERIAL_EOL;
  639. CONFIG_ECHO_START;
  640. if (!forReplay) {
  641. SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
  642. CONFIG_ECHO_START;
  643. }
  644. SERIAL_ECHOPAIR(" M203 X", planner.max_feedrate_mm_s[X_AXIS]);
  645. SERIAL_ECHOPAIR(" Y", planner.max_feedrate_mm_s[Y_AXIS]);
  646. SERIAL_ECHOPAIR(" Z", planner.max_feedrate_mm_s[Z_AXIS]);
  647. SERIAL_ECHOPAIR(" E", planner.max_feedrate_mm_s[E_AXIS]);
  648. SERIAL_EOL;
  649. CONFIG_ECHO_START;
  650. if (!forReplay) {
  651. SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
  652. CONFIG_ECHO_START;
  653. }
  654. SERIAL_ECHOPAIR(" M201 X", planner.max_acceleration_mm_per_s2[X_AXIS]);
  655. SERIAL_ECHOPAIR(" Y", planner.max_acceleration_mm_per_s2[Y_AXIS]);
  656. SERIAL_ECHOPAIR(" Z", planner.max_acceleration_mm_per_s2[Z_AXIS]);
  657. SERIAL_ECHOPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS]);
  658. SERIAL_EOL;
  659. CONFIG_ECHO_START;
  660. if (!forReplay) {
  661. SERIAL_ECHOLNPGM("Accelerations: P=printing, R=retract and T=travel");
  662. CONFIG_ECHO_START;
  663. }
  664. SERIAL_ECHOPAIR(" M204 P", planner.acceleration);
  665. SERIAL_ECHOPAIR(" R", planner.retract_acceleration);
  666. SERIAL_ECHOPAIR(" T", planner.travel_acceleration);
  667. SERIAL_EOL;
  668. CONFIG_ECHO_START;
  669. if (!forReplay) {
  670. SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)");
  671. CONFIG_ECHO_START;
  672. }
  673. SERIAL_ECHOPAIR(" M205 S", planner.min_feedrate_mm_s);
  674. SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate_mm_s);
  675. SERIAL_ECHOPAIR(" B", planner.min_segment_time);
  676. SERIAL_ECHOPAIR(" X", planner.max_jerk[X_AXIS]);
  677. SERIAL_ECHOPAIR(" Y", planner.max_jerk[Y_AXIS]);
  678. SERIAL_ECHOPAIR(" Z", planner.max_jerk[Z_AXIS]);
  679. SERIAL_ECHOPAIR(" E", planner.max_jerk[E_AXIS]);
  680. SERIAL_EOL;
  681. CONFIG_ECHO_START;
  682. if (!forReplay) {
  683. SERIAL_ECHOLNPGM("Home offset (mm)");
  684. CONFIG_ECHO_START;
  685. }
  686. SERIAL_ECHOPAIR(" M206 X", home_offset[X_AXIS]);
  687. SERIAL_ECHOPAIR(" Y", home_offset[Y_AXIS]);
  688. SERIAL_ECHOPAIR(" Z", home_offset[Z_AXIS]);
  689. SERIAL_EOL;
  690. #if HOTENDS > 1
  691. CONFIG_ECHO_START;
  692. if (!forReplay) {
  693. SERIAL_ECHOLNPGM("Hotend offsets (mm)");
  694. CONFIG_ECHO_START;
  695. }
  696. for (uint8_t e = 1; e < HOTENDS; e++) {
  697. SERIAL_ECHOPAIR(" M218 T", (int)e);
  698. SERIAL_ECHOPAIR(" X", hotend_offset[X_AXIS]);
  699. SERIAL_ECHOPAIR(" Y", hotend_offset[Y_AXIS]);
  700. #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER)
  701. SERIAL_ECHOPAIR(" Z", hotend_offset[Z_AXIS]);
  702. #endif
  703. SERIAL_EOL;
  704. }
  705. #endif
  706. #if ENABLED(MESH_BED_LEVELING)
  707. if (!forReplay) {
  708. SERIAL_ECHOLNPGM("Mesh bed leveling:");
  709. CONFIG_ECHO_START;
  710. }
  711. SERIAL_ECHOPAIR(" M420 S", mbl.has_mesh() ? 1 : 0);
  712. SERIAL_ECHOPAIR(" X", MESH_NUM_X_POINTS);
  713. SERIAL_ECHOPAIR(" Y", MESH_NUM_Y_POINTS);
  714. SERIAL_EOL;
  715. for (uint8_t py = 1; py <= MESH_NUM_Y_POINTS; py++) {
  716. for (uint8_t px = 1; px <= MESH_NUM_X_POINTS; px++) {
  717. CONFIG_ECHO_START;
  718. SERIAL_ECHOPAIR(" G29 S3 X", (int)px);
  719. SERIAL_ECHOPAIR(" Y", (int)py);
  720. SERIAL_ECHOPGM(" Z");
  721. SERIAL_PROTOCOL_F(mbl.z_values[py-1][px-1], 5);
  722. SERIAL_EOL;
  723. }
  724. }
  725. #endif
  726. #if ENABLED(DELTA)
  727. CONFIG_ECHO_START;
  728. if (!forReplay) {
  729. SERIAL_ECHOLNPGM("Endstop adjustment (mm):");
  730. CONFIG_ECHO_START;
  731. }
  732. SERIAL_ECHOPAIR(" M666 X", endstop_adj[X_AXIS]);
  733. SERIAL_ECHOPAIR(" Y", endstop_adj[Y_AXIS]);
  734. SERIAL_ECHOPAIR(" Z", endstop_adj[Z_AXIS]);
  735. SERIAL_EOL;
  736. CONFIG_ECHO_START;
  737. if (!forReplay) {
  738. SERIAL_ECHOLNPGM("Delta settings: L=diagonal_rod, R=radius, S=segments_per_second, ABC=diagonal_rod_trim_tower_[123]");
  739. CONFIG_ECHO_START;
  740. }
  741. SERIAL_ECHOPAIR(" M665 L", delta_diagonal_rod);
  742. SERIAL_ECHOPAIR(" R", delta_radius);
  743. SERIAL_ECHOPAIR(" S", delta_segments_per_second);
  744. SERIAL_ECHOPAIR(" A", delta_diagonal_rod_trim_tower_1);
  745. SERIAL_ECHOPAIR(" B", delta_diagonal_rod_trim_tower_2);
  746. SERIAL_ECHOPAIR(" C", delta_diagonal_rod_trim_tower_3);
  747. SERIAL_EOL;
  748. #elif ENABLED(Z_DUAL_ENDSTOPS)
  749. CONFIG_ECHO_START;
  750. if (!forReplay) {
  751. SERIAL_ECHOLNPGM("Z2 Endstop adjustment (mm):");
  752. CONFIG_ECHO_START;
  753. }
  754. SERIAL_ECHOPAIR(" M666 Z", z_endstop_adj);
  755. SERIAL_EOL;
  756. #endif // DELTA
  757. #if ENABLED(ULTIPANEL)
  758. CONFIG_ECHO_START;
  759. if (!forReplay) {
  760. SERIAL_ECHOLNPGM("Material heatup parameters:");
  761. CONFIG_ECHO_START;
  762. }
  763. for (uint8_t i = 0; i < COUNT(lcd_preheat_hotend_temp); i++) {
  764. SERIAL_ECHOPAIR(" M145 S", (int)i);
  765. SERIAL_ECHOPAIR(" H", lcd_preheat_hotend_temp[i]);
  766. SERIAL_ECHOPAIR(" B", lcd_preheat_bed_temp[i]);
  767. SERIAL_ECHOPAIR(" F", lcd_preheat_fan_speed[i]);
  768. SERIAL_EOL;
  769. }
  770. #endif // ULTIPANEL
  771. #if HAS_PID_HEATING
  772. CONFIG_ECHO_START;
  773. if (!forReplay) {
  774. SERIAL_ECHOLNPGM("PID settings:");
  775. }
  776. #if ENABLED(PIDTEMP)
  777. #if HOTENDS > 1
  778. if (forReplay) {
  779. HOTEND_LOOP() {
  780. CONFIG_ECHO_START;
  781. SERIAL_ECHOPAIR(" M301 E", e);
  782. SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, e));
  783. SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, e)));
  784. SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, e)));
  785. #if ENABLED(PID_EXTRUSION_SCALING)
  786. SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e));
  787. if (e == 0) SERIAL_ECHOPAIR(" L", lpq_len);
  788. #endif
  789. SERIAL_EOL;
  790. }
  791. }
  792. else
  793. #endif // HOTENDS > 1
  794. // !forReplay || HOTENDS == 1
  795. {
  796. CONFIG_ECHO_START;
  797. SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0
  798. SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
  799. SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
  800. #if ENABLED(PID_EXTRUSION_SCALING)
  801. SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0));
  802. SERIAL_ECHOPAIR(" L", lpq_len);
  803. #endif
  804. SERIAL_EOL;
  805. }
  806. #endif // PIDTEMP
  807. #if ENABLED(PIDTEMPBED)
  808. CONFIG_ECHO_START;
  809. SERIAL_ECHOPAIR(" M304 P", thermalManager.bedKp);
  810. SERIAL_ECHOPAIR(" I", unscalePID_i(thermalManager.bedKi));
  811. SERIAL_ECHOPAIR(" D", unscalePID_d(thermalManager.bedKd));
  812. SERIAL_EOL;
  813. #endif
  814. #endif // PIDTEMP || PIDTEMPBED
  815. #if HAS_LCD_CONTRAST
  816. CONFIG_ECHO_START;
  817. if (!forReplay) {
  818. SERIAL_ECHOLNPGM("LCD Contrast:");
  819. CONFIG_ECHO_START;
  820. }
  821. SERIAL_ECHOPAIR(" M250 C", lcd_contrast);
  822. SERIAL_EOL;
  823. #endif
  824. #if ENABLED(FWRETRACT)
  825. CONFIG_ECHO_START;
  826. if (!forReplay) {
  827. SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
  828. CONFIG_ECHO_START;
  829. }
  830. SERIAL_ECHOPAIR(" M207 S", retract_length);
  831. #if EXTRUDERS > 1
  832. SERIAL_ECHOPAIR(" W", retract_length_swap);
  833. #endif
  834. SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_feedrate_mm_s));
  835. SERIAL_ECHOPAIR(" Z", retract_zlift);
  836. SERIAL_EOL;
  837. CONFIG_ECHO_START;
  838. if (!forReplay) {
  839. SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)");
  840. CONFIG_ECHO_START;
  841. }
  842. SERIAL_ECHOPAIR(" M208 S", retract_recover_length);
  843. #if EXTRUDERS > 1
  844. SERIAL_ECHOPAIR(" W", retract_recover_length_swap);
  845. #endif
  846. SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_recover_feedrate_mm_s));
  847. SERIAL_EOL;
  848. CONFIG_ECHO_START;
  849. if (!forReplay) {
  850. SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
  851. CONFIG_ECHO_START;
  852. }
  853. SERIAL_ECHOPAIR(" M209 S", autoretract_enabled ? 1 : 0);
  854. SERIAL_EOL;
  855. #endif // FWRETRACT
  856. /**
  857. * Volumetric extrusion M200
  858. */
  859. if (!forReplay) {
  860. CONFIG_ECHO_START;
  861. SERIAL_ECHOPGM("Filament settings:");
  862. if (volumetric_enabled)
  863. SERIAL_EOL;
  864. else
  865. SERIAL_ECHOLNPGM(" Disabled");
  866. }
  867. CONFIG_ECHO_START;
  868. SERIAL_ECHOPAIR(" M200 D", filament_size[0]);
  869. SERIAL_EOL;
  870. #if EXTRUDERS > 1
  871. CONFIG_ECHO_START;
  872. SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]);
  873. SERIAL_EOL;
  874. #if EXTRUDERS > 2
  875. CONFIG_ECHO_START;
  876. SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]);
  877. SERIAL_EOL;
  878. #if EXTRUDERS > 3
  879. CONFIG_ECHO_START;
  880. SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]);
  881. SERIAL_EOL;
  882. #endif
  883. #endif
  884. #endif
  885. if (!volumetric_enabled) {
  886. CONFIG_ECHO_START;
  887. SERIAL_ECHOLNPGM(" M200 D0");
  888. }
  889. /**
  890. * Auto Bed Leveling
  891. */
  892. #if HAS_BED_PROBE
  893. if (!forReplay) {
  894. CONFIG_ECHO_START;
  895. SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
  896. }
  897. CONFIG_ECHO_START;
  898. SERIAL_ECHOPAIR(" M851 Z", zprobe_zoffset);
  899. SERIAL_EOL;
  900. #endif
  901. }
  902. #endif // !DISABLE_M503