My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ConfigurationStore.cpp 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. /**
  2. * ConfigurationStore.cpp
  3. *
  4. * Configuration and EEPROM storage
  5. *
  6. * V16 EEPROM Layout:
  7. *
  8. * ver
  9. * axis_steps_per_unit (x4)
  10. * max_feedrate (x4)
  11. * max_acceleration_units_per_sq_second (x4)
  12. * acceleration
  13. * retract_acceleration
  14. * travel_aceeleration
  15. * minimumfeedrate
  16. * mintravelfeedrate
  17. * minsegmenttime
  18. * max_xy_jerk
  19. * max_z_jerk
  20. * max_e_jerk
  21. * add_homing (x3)
  22. *
  23. * DELTA:
  24. * endstop_adj (x3)
  25. * delta_radius
  26. * delta_diagonal_rod
  27. * delta_segments_per_second
  28. *
  29. * ULTIPANEL:
  30. * plaPreheatHotendTemp
  31. * plaPreheatHPBTemp
  32. * plaPreheatFanSpeed
  33. * absPreheatHotendTemp
  34. * absPreheatHPBTemp
  35. * absPreheatFanSpeed
  36. * zprobe_zoffset
  37. *
  38. * PIDTEMP:
  39. * Kp[0], Ki[0], Kd[0], Kc[0]
  40. * Kp[1], Ki[1], Kd[1], Kc[1]
  41. * Kp[2], Ki[2], Kd[2], Kc[2]
  42. * Kp[3], Ki[3], Kd[3], Kc[3]
  43. *
  44. * DOGLCD:
  45. * lcd_contrast
  46. *
  47. * SCARA:
  48. * axis_scaling (x3)
  49. *
  50. * FWRETRACT:
  51. * autoretract_enabled
  52. * retract_length
  53. * retract_length_swap
  54. * retract_feedrate
  55. * retract_zlift
  56. * retract_recover_length
  57. * retract_recover_length_swap
  58. * retract_recover_feedrate
  59. *
  60. * volumetric_enabled
  61. *
  62. * filament_size (x4)
  63. *
  64. */
  65. #include "Marlin.h"
  66. #include "language.h"
  67. #include "planner.h"
  68. #include "temperature.h"
  69. #include "ultralcd.h"
  70. #include "ConfigurationStore.h"
  71. void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
  72. uint8_t c;
  73. while(size--) {
  74. eeprom_write_byte((unsigned char*)pos, *value);
  75. c = eeprom_read_byte((unsigned char*)pos);
  76. if (c != *value) {
  77. SERIAL_ECHO_START;
  78. SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
  79. }
  80. pos++;
  81. value++;
  82. };
  83. }
  84. void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
  85. do {
  86. *value = eeprom_read_byte((unsigned char*)pos);
  87. pos++;
  88. value++;
  89. } while (--size);
  90. }
  91. #define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value))
  92. #define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value))
  93. //======================================================================================
  94. #define DUMMY_PID_VALUE 3000.0f
  95. #define EEPROM_OFFSET 100
  96. // IMPORTANT: Whenever there are changes made to the variables stored in EEPROM
  97. // in the functions below, also increment the version number. This makes sure that
  98. // the default values are used whenever there is a change to the data, to prevent
  99. // wrong data being written to the variables.
  100. // ALSO: always make sure the variables in the Store and retrieve sections are in the same order.
  101. #define EEPROM_VERSION "V16"
  102. #ifdef EEPROM_SETTINGS
  103. void Config_StoreSettings() {
  104. float dummy = 0.0f;
  105. char ver[4] = "000";
  106. int i = EEPROM_OFFSET;
  107. EEPROM_WRITE_VAR(i, ver); // invalidate data first
  108. EEPROM_WRITE_VAR(i, axis_steps_per_unit);
  109. EEPROM_WRITE_VAR(i, max_feedrate);
  110. EEPROM_WRITE_VAR(i, max_acceleration_units_per_sq_second);
  111. EEPROM_WRITE_VAR(i, acceleration);
  112. EEPROM_WRITE_VAR(i, retract_acceleration);
  113. EEPROM_WRITE_VAR(i, travel_acceleration);
  114. EEPROM_WRITE_VAR(i, minimumfeedrate);
  115. EEPROM_WRITE_VAR(i, mintravelfeedrate);
  116. EEPROM_WRITE_VAR(i, minsegmenttime);
  117. EEPROM_WRITE_VAR(i, max_xy_jerk);
  118. EEPROM_WRITE_VAR(i, max_z_jerk);
  119. EEPROM_WRITE_VAR(i, max_e_jerk);
  120. EEPROM_WRITE_VAR(i, add_homing);
  121. #ifdef DELTA
  122. EEPROM_WRITE_VAR(i, endstop_adj); // 3 floats
  123. EEPROM_WRITE_VAR(i, delta_radius); // 1 float
  124. EEPROM_WRITE_VAR(i, delta_diagonal_rod); // 1 float
  125. EEPROM_WRITE_VAR(i, delta_segments_per_second); // 1 float
  126. #else
  127. dummy = 0.0f;
  128. for (int q=6; q--;) EEPROM_WRITE_VAR(i, dummy);
  129. #endif
  130. #ifndef ULTIPANEL
  131. int plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP, plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP, plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED,
  132. absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP, absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP, absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
  133. #endif // !ULTIPANEL
  134. EEPROM_WRITE_VAR(i, plaPreheatHotendTemp);
  135. EEPROM_WRITE_VAR(i, plaPreheatHPBTemp);
  136. EEPROM_WRITE_VAR(i, plaPreheatFanSpeed);
  137. EEPROM_WRITE_VAR(i, absPreheatHotendTemp);
  138. EEPROM_WRITE_VAR(i, absPreheatHPBTemp);
  139. EEPROM_WRITE_VAR(i, absPreheatFanSpeed);
  140. EEPROM_WRITE_VAR(i, zprobe_zoffset);
  141. for (int e = 0; e < 4; e++) {
  142. #ifdef PIDTEMP
  143. if (e < EXTRUDERS) {
  144. EEPROM_WRITE_VAR(i, PID_PARAM(Kp, e));
  145. EEPROM_WRITE_VAR(i, PID_PARAM(Ki, e));
  146. EEPROM_WRITE_VAR(i, PID_PARAM(Kd, e));
  147. #ifdef PID_ADD_EXTRUSION_RATE
  148. EEPROM_WRITE_VAR(i, PID_PARAM(Kc, e));
  149. #else
  150. dummy = 1.0f; // 1.0 = default kc
  151. EEPROM_WRITE_VAR(i, dummy);
  152. #endif
  153. }
  154. else {
  155. #else // !PIDTEMP
  156. {
  157. #endif // !PIDTEMP
  158. dummy = DUMMY_PID_VALUE;
  159. EEPROM_WRITE_VAR(i, dummy);
  160. dummy = 0.0f;
  161. for (int q = 3; q--;) EEPROM_WRITE_VAR(i, dummy);
  162. }
  163. } // Extruders Loop
  164. #ifndef DOGLCD
  165. int lcd_contrast = 32;
  166. #endif
  167. EEPROM_WRITE_VAR(i, lcd_contrast);
  168. #ifdef SCARA
  169. EEPROM_WRITE_VAR(i, axis_scaling); // 3 floats
  170. #else
  171. dummy = 1.0f;
  172. EEPROM_WRITE_VAR(i, dummy);
  173. #endif
  174. #ifdef FWRETRACT
  175. EEPROM_WRITE_VAR(i, autoretract_enabled);
  176. EEPROM_WRITE_VAR(i, retract_length);
  177. #if EXTRUDERS > 1
  178. EEPROM_WRITE_VAR(i, retract_length_swap);
  179. #else
  180. dummy = 0.0f;
  181. EEPROM_WRITE_VAR(i, dummy);
  182. #endif
  183. EEPROM_WRITE_VAR(i, retract_feedrate);
  184. EEPROM_WRITE_VAR(i, retract_zlift);
  185. EEPROM_WRITE_VAR(i, retract_recover_length);
  186. #if EXTRUDERS > 1
  187. EEPROM_WRITE_VAR(i, retract_recover_length_swap);
  188. #else
  189. dummy = 0.0f;
  190. EEPROM_WRITE_VAR(i, dummy);
  191. #endif
  192. EEPROM_WRITE_VAR(i, retract_recover_feedrate);
  193. #endif // FWRETRACT
  194. EEPROM_WRITE_VAR(i, volumetric_enabled);
  195. // Save filament sizes
  196. for (int q = 0; q < 4; q++) {
  197. if (q < EXTRUDERS) dummy = filament_size[q];
  198. EEPROM_WRITE_VAR(i, dummy);
  199. }
  200. int storageSize = i;
  201. char ver2[4] = EEPROM_VERSION;
  202. int j = EEPROM_OFFSET;
  203. EEPROM_WRITE_VAR(j, ver2); // validate data
  204. // Report storage size
  205. SERIAL_ECHO_START;
  206. SERIAL_ECHOPAIR("Settings Stored (", (unsigned long)i);
  207. SERIAL_ECHOLNPGM(" bytes)");
  208. }
  209. void Config_RetrieveSettings() {
  210. int i = EEPROM_OFFSET;
  211. char stored_ver[4];
  212. char ver[4] = EEPROM_VERSION;
  213. EEPROM_READ_VAR(i, stored_ver); //read stored version
  214. // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
  215. if (strncmp(ver, stored_ver, 3) != 0) {
  216. Config_ResetDefault();
  217. }
  218. else {
  219. float dummy = 0;
  220. // version number match
  221. EEPROM_READ_VAR(i, axis_steps_per_unit);
  222. EEPROM_READ_VAR(i, max_feedrate);
  223. EEPROM_READ_VAR(i, max_acceleration_units_per_sq_second);
  224. // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
  225. reset_acceleration_rates();
  226. EEPROM_READ_VAR(i, acceleration);
  227. EEPROM_READ_VAR(i, retract_acceleration);
  228. EEPROM_READ_VAR(i, travel_acceleration);
  229. EEPROM_READ_VAR(i, minimumfeedrate);
  230. EEPROM_READ_VAR(i, mintravelfeedrate);
  231. EEPROM_READ_VAR(i, minsegmenttime);
  232. EEPROM_READ_VAR(i, max_xy_jerk);
  233. EEPROM_READ_VAR(i, max_z_jerk);
  234. EEPROM_READ_VAR(i, max_e_jerk);
  235. EEPROM_READ_VAR(i, add_homing);
  236. #ifdef DELTA
  237. EEPROM_READ_VAR(i, endstop_adj); // 3 floats
  238. EEPROM_READ_VAR(i, delta_radius); // 1 float
  239. EEPROM_READ_VAR(i, delta_diagonal_rod); // 1 float
  240. EEPROM_READ_VAR(i, delta_segments_per_second); // 1 float
  241. #else
  242. for (int q=6; q--;) EEPROM_READ_VAR(i, dummy);
  243. #endif
  244. #ifndef ULTIPANEL
  245. int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed,
  246. absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed;
  247. #endif
  248. EEPROM_READ_VAR(i, plaPreheatHotendTemp);
  249. EEPROM_READ_VAR(i, plaPreheatHPBTemp);
  250. EEPROM_READ_VAR(i, plaPreheatFanSpeed);
  251. EEPROM_READ_VAR(i, absPreheatHotendTemp);
  252. EEPROM_READ_VAR(i, absPreheatHPBTemp);
  253. EEPROM_READ_VAR(i, absPreheatFanSpeed);
  254. EEPROM_READ_VAR(i, zprobe_zoffset);
  255. #ifdef PIDTEMP
  256. for (int e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin
  257. EEPROM_READ_VAR(i, dummy);
  258. if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) {
  259. // do not need to scale PID values as the values in EEPROM are already scaled
  260. PID_PARAM(Kp, e) = dummy;
  261. EEPROM_READ_VAR(i, PID_PARAM(Ki, e));
  262. EEPROM_READ_VAR(i, PID_PARAM(Kd, e));
  263. #ifdef PID_ADD_EXTRUSION_RATE
  264. EEPROM_READ_VAR(i, PID_PARAM(Kc, e));
  265. #else
  266. EEPROM_READ_VAR(i, dummy);
  267. #endif
  268. }
  269. else {
  270. for (int q=3; q--;) EEPROM_READ_VAR(i, dummy); // Ki, Kd, Kc
  271. }
  272. }
  273. #else // !PIDTEMP
  274. // 4 x 4 = 16 slots for PID parameters
  275. for (int q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc
  276. #endif // !PIDTEMP
  277. #ifndef DOGLCD
  278. int lcd_contrast;
  279. #endif
  280. EEPROM_READ_VAR(i, lcd_contrast);
  281. #ifdef SCARA
  282. EEPROM_READ_VAR(i, axis_scaling); // 3 floats
  283. #else
  284. EEPROM_READ_VAR(i, dummy);
  285. #endif
  286. #ifdef FWRETRACT
  287. EEPROM_READ_VAR(i, autoretract_enabled);
  288. EEPROM_READ_VAR(i, retract_length);
  289. #if EXTRUDERS > 1
  290. EEPROM_READ_VAR(i, retract_length_swap);
  291. #else
  292. EEPROM_READ_VAR(i, dummy);
  293. #endif
  294. EEPROM_READ_VAR(i, retract_feedrate);
  295. EEPROM_READ_VAR(i, retract_zlift);
  296. EEPROM_READ_VAR(i, retract_recover_length);
  297. #if EXTRUDERS > 1
  298. EEPROM_READ_VAR(i, retract_recover_length_swap);
  299. #else
  300. EEPROM_READ_VAR(i, dummy);
  301. #endif
  302. EEPROM_READ_VAR(i, retract_recover_feedrate);
  303. #endif // FWRETRACT
  304. EEPROM_READ_VAR(i, volumetric_enabled);
  305. for (int q = 0; q < 4; q++) {
  306. EEPROM_READ_VAR(i, dummy);
  307. if (q < EXTRUDERS) filament_size[q] = dummy;
  308. }
  309. calculate_volumetric_multipliers();
  310. // Call updatePID (similar to when we have processed M301)
  311. updatePID();
  312. // Report settings retrieved and length
  313. SERIAL_ECHO_START;
  314. SERIAL_ECHO(ver);
  315. SERIAL_ECHOPAIR(" stored settings retrieved (", (unsigned long)i);
  316. SERIAL_ECHOLNPGM(" bytes)");
  317. }
  318. #ifdef EEPROM_CHITCHAT
  319. Config_PrintSettings();
  320. #endif
  321. }
  322. #endif // EEPROM_SETTINGS
  323. void Config_ResetDefault() {
  324. float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT;
  325. float tmp2[] = DEFAULT_MAX_FEEDRATE;
  326. long tmp3[] = DEFAULT_MAX_ACCELERATION;
  327. for (int i = 0; i < NUM_AXIS; i++) {
  328. axis_steps_per_unit[i] = tmp1[i];
  329. max_feedrate[i] = tmp2[i];
  330. max_acceleration_units_per_sq_second[i] = tmp3[i];
  331. #ifdef SCARA
  332. if (i < sizeof(axis_scaling) / sizeof(*axis_scaling))
  333. axis_scaling[i] = 1;
  334. #endif
  335. }
  336. // steps per sq second need to be updated to agree with the units per sq second
  337. reset_acceleration_rates();
  338. acceleration = DEFAULT_ACCELERATION;
  339. retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
  340. travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
  341. minimumfeedrate = DEFAULT_MINIMUMFEEDRATE;
  342. minsegmenttime = DEFAULT_MINSEGMENTTIME;
  343. mintravelfeedrate = DEFAULT_MINTRAVELFEEDRATE;
  344. max_xy_jerk = DEFAULT_XYJERK;
  345. max_z_jerk = DEFAULT_ZJERK;
  346. max_e_jerk = DEFAULT_EJERK;
  347. add_homing[X_AXIS] = add_homing[Y_AXIS] = add_homing[Z_AXIS] = 0;
  348. #ifdef DELTA
  349. endstop_adj[X_AXIS] = endstop_adj[Y_AXIS] = endstop_adj[Z_AXIS] = 0;
  350. delta_radius = DELTA_RADIUS;
  351. delta_diagonal_rod = DELTA_DIAGONAL_ROD;
  352. delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
  353. recalc_delta_settings(delta_radius, delta_diagonal_rod);
  354. #endif
  355. #ifdef ULTIPANEL
  356. plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP;
  357. plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP;
  358. plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
  359. absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP;
  360. absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
  361. absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
  362. #endif
  363. #ifdef ENABLE_AUTO_BED_LEVELING
  364. zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER;
  365. #endif
  366. #ifdef DOGLCD
  367. lcd_contrast = DEFAULT_LCD_CONTRAST;
  368. #endif
  369. #ifdef PIDTEMP
  370. #ifdef PID_PARAMS_PER_EXTRUDER
  371. for (int e = 0; e < EXTRUDERS; e++)
  372. #else
  373. int e = 0; // only need to write once
  374. #endif
  375. {
  376. PID_PARAM(Kp, e) = DEFAULT_Kp;
  377. PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki);
  378. PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd);
  379. #ifdef PID_ADD_EXTRUSION_RATE
  380. PID_PARAM(Kc, e) = DEFAULT_Kc;
  381. #endif
  382. }
  383. // call updatePID (similar to when we have processed M301)
  384. updatePID();
  385. #endif // PIDTEMP
  386. #ifdef FWRETRACT
  387. autoretract_enabled = false;
  388. retract_length = RETRACT_LENGTH;
  389. #if EXTRUDERS > 1
  390. retract_length_swap = RETRACT_LENGTH_SWAP;
  391. #endif
  392. retract_feedrate = RETRACT_FEEDRATE;
  393. retract_zlift = RETRACT_ZLIFT;
  394. retract_recover_length = RETRACT_RECOVER_LENGTH;
  395. #if EXTRUDERS > 1
  396. retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
  397. #endif
  398. retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
  399. #endif
  400. volumetric_enabled = false;
  401. filament_size[0] = DEFAULT_NOMINAL_FILAMENT_DIA;
  402. #if EXTRUDERS > 1
  403. filament_size[1] = DEFAULT_NOMINAL_FILAMENT_DIA;
  404. #if EXTRUDERS > 2
  405. filament_size[2] = DEFAULT_NOMINAL_FILAMENT_DIA;
  406. #if EXTRUDERS > 3
  407. filament_size[3] = DEFAULT_NOMINAL_FILAMENT_DIA;
  408. #endif
  409. #endif
  410. #endif
  411. calculate_volumetric_multipliers();
  412. SERIAL_ECHO_START;
  413. SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
  414. }
  415. #ifndef DISABLE_M503
  416. void Config_PrintSettings(bool forReplay) {
  417. // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
  418. SERIAL_ECHO_START;
  419. if (!forReplay) {
  420. SERIAL_ECHOLNPGM("Steps per unit:");
  421. SERIAL_ECHO_START;
  422. }
  423. SERIAL_ECHOPAIR(" M92 X", axis_steps_per_unit[X_AXIS]);
  424. SERIAL_ECHOPAIR(" Y", axis_steps_per_unit[Y_AXIS]);
  425. SERIAL_ECHOPAIR(" Z", axis_steps_per_unit[Z_AXIS]);
  426. SERIAL_ECHOPAIR(" E", axis_steps_per_unit[E_AXIS]);
  427. SERIAL_EOL;
  428. SERIAL_ECHO_START;
  429. #ifdef SCARA
  430. if (!forReplay) {
  431. SERIAL_ECHOLNPGM("Scaling factors:");
  432. SERIAL_ECHO_START;
  433. }
  434. SERIAL_ECHOPAIR(" M365 X", axis_scaling[X_AXIS]);
  435. SERIAL_ECHOPAIR(" Y", axis_scaling[Y_AXIS]);
  436. SERIAL_ECHOPAIR(" Z", axis_scaling[Z_AXIS]);
  437. SERIAL_EOL;
  438. SERIAL_ECHO_START;
  439. #endif // SCARA
  440. if (!forReplay) {
  441. SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
  442. SERIAL_ECHO_START;
  443. }
  444. SERIAL_ECHOPAIR(" M203 X", max_feedrate[X_AXIS]);
  445. SERIAL_ECHOPAIR(" Y", max_feedrate[Y_AXIS]);
  446. SERIAL_ECHOPAIR(" Z", max_feedrate[Z_AXIS]);
  447. SERIAL_ECHOPAIR(" E", max_feedrate[E_AXIS]);
  448. SERIAL_EOL;
  449. SERIAL_ECHO_START;
  450. if (!forReplay) {
  451. SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
  452. SERIAL_ECHO_START;
  453. }
  454. SERIAL_ECHOPAIR(" M201 X", max_acceleration_units_per_sq_second[X_AXIS] );
  455. SERIAL_ECHOPAIR(" Y", max_acceleration_units_per_sq_second[Y_AXIS] );
  456. SERIAL_ECHOPAIR(" Z", max_acceleration_units_per_sq_second[Z_AXIS] );
  457. SERIAL_ECHOPAIR(" E", max_acceleration_units_per_sq_second[E_AXIS]);
  458. SERIAL_EOL;
  459. SERIAL_ECHO_START;
  460. if (!forReplay) {
  461. SERIAL_ECHOLNPGM("Accelerations: P=printing, R=retract and T=travel");
  462. SERIAL_ECHO_START;
  463. }
  464. SERIAL_ECHOPAIR(" M204 P", acceleration );
  465. SERIAL_ECHOPAIR(" R", retract_acceleration);
  466. SERIAL_ECHOPAIR(" T", travel_acceleration);
  467. SERIAL_EOL;
  468. SERIAL_ECHO_START;
  469. if (!forReplay) {
  470. 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)");
  471. SERIAL_ECHO_START;
  472. }
  473. SERIAL_ECHOPAIR(" M205 S", minimumfeedrate );
  474. SERIAL_ECHOPAIR(" T", mintravelfeedrate );
  475. SERIAL_ECHOPAIR(" B", minsegmenttime );
  476. SERIAL_ECHOPAIR(" X", max_xy_jerk );
  477. SERIAL_ECHOPAIR(" Z", max_z_jerk);
  478. SERIAL_ECHOPAIR(" E", max_e_jerk);
  479. SERIAL_EOL;
  480. SERIAL_ECHO_START;
  481. if (!forReplay) {
  482. SERIAL_ECHOLNPGM("Home offset (mm):");
  483. SERIAL_ECHO_START;
  484. }
  485. SERIAL_ECHOPAIR(" M206 X", add_homing[X_AXIS] );
  486. SERIAL_ECHOPAIR(" Y", add_homing[Y_AXIS] );
  487. SERIAL_ECHOPAIR(" Z", add_homing[Z_AXIS] );
  488. SERIAL_EOL;
  489. #ifdef DELTA
  490. SERIAL_ECHO_START;
  491. if (!forReplay) {
  492. SERIAL_ECHOLNPGM("Endstop adjustement (mm):");
  493. SERIAL_ECHO_START;
  494. }
  495. SERIAL_ECHOPAIR(" M666 X", endstop_adj[X_AXIS] );
  496. SERIAL_ECHOPAIR(" Y", endstop_adj[Y_AXIS] );
  497. SERIAL_ECHOPAIR(" Z", endstop_adj[Z_AXIS] );
  498. SERIAL_EOL;
  499. SERIAL_ECHO_START;
  500. SERIAL_ECHOLNPGM("Delta settings: L=delta_diagonal_rod, R=delta_radius, S=delta_segments_per_second");
  501. SERIAL_ECHO_START;
  502. SERIAL_ECHOPAIR(" M665 L", delta_diagonal_rod );
  503. SERIAL_ECHOPAIR(" R", delta_radius );
  504. SERIAL_ECHOPAIR(" S", delta_segments_per_second );
  505. SERIAL_EOL;
  506. #endif // DELTA
  507. #ifdef PIDTEMP
  508. SERIAL_ECHO_START;
  509. if (!forReplay) {
  510. SERIAL_ECHOLNPGM("PID settings:");
  511. SERIAL_ECHO_START;
  512. }
  513. SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echos values for E0
  514. SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
  515. SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
  516. SERIAL_EOL;
  517. #endif // PIDTEMP
  518. #ifdef FWRETRACT
  519. SERIAL_ECHO_START;
  520. if (!forReplay) {
  521. SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
  522. SERIAL_ECHO_START;
  523. }
  524. SERIAL_ECHOPAIR(" M207 S", retract_length);
  525. SERIAL_ECHOPAIR(" F", retract_feedrate*60);
  526. SERIAL_ECHOPAIR(" Z", retract_zlift);
  527. SERIAL_EOL;
  528. SERIAL_ECHO_START;
  529. if (!forReplay) {
  530. SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)");
  531. SERIAL_ECHO_START;
  532. }
  533. SERIAL_ECHOPAIR(" M208 S", retract_recover_length);
  534. SERIAL_ECHOPAIR(" F", retract_recover_feedrate*60);
  535. SERIAL_EOL;
  536. SERIAL_ECHO_START;
  537. if (!forReplay) {
  538. SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
  539. SERIAL_ECHO_START;
  540. }
  541. SERIAL_ECHOPAIR(" M209 S", (unsigned long)(autoretract_enabled ? 1 : 0));
  542. SERIAL_EOL;
  543. #if EXTRUDERS > 1
  544. if (!forReplay) {
  545. SERIAL_ECHO_START;
  546. SERIAL_ECHOLNPGM("Multi-extruder settings:");
  547. SERIAL_ECHO_START;
  548. SERIAL_ECHOPAIR(" Swap retract length (mm): ", retract_length_swap);
  549. SERIAL_EOL;
  550. SERIAL_ECHO_START;
  551. SERIAL_ECHOPAIR(" Swap rec. addl. length (mm): ", retract_recover_length_swap);
  552. SERIAL_EOL;
  553. }
  554. #endif // EXTRUDERS > 1
  555. #endif // FWRETRACT
  556. SERIAL_ECHO_START;
  557. if (volumetric_enabled) {
  558. if (!forReplay) {
  559. SERIAL_ECHOLNPGM("Filament settings:");
  560. SERIAL_ECHO_START;
  561. }
  562. SERIAL_ECHOPAIR(" M200 D", filament_size[0]);
  563. SERIAL_EOL;
  564. #if EXTRUDERS > 1
  565. SERIAL_ECHO_START;
  566. SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]);
  567. SERIAL_EOL;
  568. #if EXTRUDERS > 2
  569. SERIAL_ECHO_START;
  570. SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]);
  571. SERIAL_EOL;
  572. #if EXTRUDERS > 3
  573. SERIAL_ECHO_START;
  574. SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]);
  575. SERIAL_EOL;
  576. #endif
  577. #endif
  578. #endif
  579. } else {
  580. if (!forReplay) {
  581. SERIAL_ECHOLNPGM("Filament settings: Disabled");
  582. }
  583. }
  584. #ifdef CUSTOM_M_CODES
  585. SERIAL_ECHO_START;
  586. if (!forReplay) {
  587. SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
  588. SERIAL_ECHO_START;
  589. }
  590. SERIAL_ECHO(" M");
  591. SERIAL_ECHO(CUSTOM_M_CODE_SET_Z_PROBE_OFFSET);
  592. SERIAL_ECHOPAIR(" Z", -zprobe_zoffset);
  593. SERIAL_EOL;
  594. #endif
  595. }
  596. #endif // !DISABLE_M503