My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

configuration_store.cpp 30KB

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