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

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