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

configuration_store.cpp 31KB

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