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

ConfigurationStore.cpp 19KB

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