|
@@ -0,0 +1,189 @@
|
|
1
|
+/**
|
|
2
|
+ * Marlin 3D Printer Firmware
|
|
3
|
+ * Copyright (c) 2020 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
|
+#include "../../inc/MarlinConfig.h"
|
|
23
|
+
|
|
24
|
+#if ENABLED(REPETIER_GCODE_M360)
|
|
25
|
+
|
|
26
|
+#include "../gcode.h"
|
|
27
|
+
|
|
28
|
+#include "../../module/motion.h"
|
|
29
|
+#include "../../module/planner.h"
|
|
30
|
+
|
|
31
|
+static void config_prefix(PGM_P const name, PGM_P const pref=nullptr) {
|
|
32
|
+ SERIAL_ECHOPGM("Config:");
|
|
33
|
+ if (pref) serialprintPGM(pref);
|
|
34
|
+ serialprintPGM(name);
|
|
35
|
+ SERIAL_CHAR(':');
|
|
36
|
+}
|
|
37
|
+static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr) {
|
|
38
|
+ config_prefix(name, pref);
|
|
39
|
+ SERIAL_ECHOLN(val);
|
|
40
|
+}
|
|
41
|
+
|
|
42
|
+/**
|
|
43
|
+ * M360: Report Firmware configuration
|
|
44
|
+ * in RepRapFirmware-compatible format
|
|
45
|
+ */
|
|
46
|
+void GcodeSuite::M360() {
|
|
47
|
+ PGMSTR(X_STR, "X");
|
|
48
|
+ PGMSTR(Y_STR, "Y");
|
|
49
|
+ PGMSTR(Z_STR, "Z");
|
|
50
|
+ PGMSTR(JERK_STR, "Jerk");
|
|
51
|
+
|
|
52
|
+ //
|
|
53
|
+ // Basics and Enabled items
|
|
54
|
+ //
|
|
55
|
+ config_line(PSTR("Baudrate"), BAUDRATE);
|
|
56
|
+ config_line(PSTR("InputBuffer"), MAX_CMD_SIZE);
|
|
57
|
+ config_line(PSTR("PrintlineCache"), BUFSIZE);
|
|
58
|
+ config_line(PSTR("MixingExtruder"), ENABLED(MIXING_EXTRUDER));
|
|
59
|
+ config_line(PSTR("SDCard"), ENABLED(SDSUPPORT));
|
|
60
|
+ config_line(PSTR("Fan"), ENABLED(HAS_FAN));
|
|
61
|
+ config_line(PSTR("LCD"), ENABLED(HAS_DISPLAY));
|
|
62
|
+ config_line(PSTR("SoftwarePowerSwitch"), 1);
|
|
63
|
+ config_line(PSTR("SupportLocalFilamentchange"), ENABLED(ADVANCED_PAUSE_FEATURE));
|
|
64
|
+ config_line(PSTR("CaseLights"), ENABLED(CASE_LIGHT_ENABLE));
|
|
65
|
+ config_line(PSTR("ZProbe"), ENABLED(HAS_BED_PROBE));
|
|
66
|
+ config_line(PSTR("Autolevel"), ENABLED(HAS_LEVELING));
|
|
67
|
+ config_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS));
|
|
68
|
+
|
|
69
|
+ //
|
|
70
|
+ // Homing Directions
|
|
71
|
+ //
|
|
72
|
+ PGMSTR(H_DIR_STR, "HomeDir");
|
|
73
|
+ config_line(H_DIR_STR, X_HOME_DIR, X_STR);
|
|
74
|
+ config_line(H_DIR_STR, Y_HOME_DIR, Y_STR);
|
|
75
|
+ config_line(H_DIR_STR, Z_HOME_DIR, Z_STR);
|
|
76
|
+
|
|
77
|
+ //
|
|
78
|
+ // XYZ Axis Jerk
|
|
79
|
+ //
|
|
80
|
+ #if HAS_CLASSIC_JERK
|
|
81
|
+ if (planner.max_jerk.x == planner.max_jerk.y)
|
|
82
|
+ config_line(PSTR("XY"), planner.max_jerk.x, JERK_STR);
|
|
83
|
+ else {
|
|
84
|
+ config_line(X_STR, planner.max_jerk.x, JERK_STR);
|
|
85
|
+ config_line(Y_STR, planner.max_jerk.y, JERK_STR);
|
|
86
|
+ }
|
|
87
|
+ config_line(Z_STR, planner.max_jerk.z, JERK_STR);
|
|
88
|
+ #endif
|
|
89
|
+
|
|
90
|
+ //
|
|
91
|
+ // Firmware Retraction
|
|
92
|
+ //
|
|
93
|
+ config_line(PSTR("SupportG10G11"), ENABLED(FWRETRACT));
|
|
94
|
+ #if ENABLED(FWRETRACT)
|
|
95
|
+ PGMSTR(RET_STR, "Retraction");
|
|
96
|
+ PGMSTR(UNRET_STR, "RetractionUndo"),
|
|
97
|
+ PGMSTR(SPEED_STR, "Speed");
|
|
98
|
+ // M10 Retract with swap (long) moves
|
|
99
|
+ config_line(PSTR("Length"), fwretract.settings.retract_length, RET_STR);
|
|
100
|
+ config_line(SPEED_STR, fwretract.settings.retract_feedrate_mm_s, RET_STR);
|
|
101
|
+ config_line(PSTR("ZLift"), fwretract.settings.retract_zraise, RET_STR);
|
|
102
|
+ config_line(PSTR("LongLength"), fwretract.settings.swap_retract_length, RET_STR);
|
|
103
|
+ // M11 Recover (undo) with swap (long) moves
|
|
104
|
+ config_line(SPEED_STR, fwretract.settings.retract_recover_feedrate_mm_s, UNRET_STR);
|
|
105
|
+ config_line(PSTR("ExtraLength"), fwretract.settings.retract_recover_extra, UNRET_STR);
|
|
106
|
+ config_line(PSTR("ExtraLongLength"), fwretract.settings.swap_retract_recover_extra, UNRET_STR);
|
|
107
|
+ config_line(PSTR("LongSpeed"), fwretract.settings.swap_retract_recover_feedrate_mm_s, UNRET_STR);
|
|
108
|
+ #endif
|
|
109
|
+
|
|
110
|
+ //
|
|
111
|
+ // Workspace boundaries
|
|
112
|
+ //
|
|
113
|
+ const xyz_pos_t dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
|
|
114
|
+ dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
|
|
115
|
+ xyz_pos_t cmin = dmin, cmax = dmax;
|
|
116
|
+ apply_motion_limits(cmin);
|
|
117
|
+ apply_motion_limits(cmax);
|
|
118
|
+ const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
|
|
119
|
+ wmin = cmin.asLogical(), wmax = cmax.asLogical();
|
|
120
|
+
|
|
121
|
+ PGMSTR(MIN_STR, "Min");
|
|
122
|
+ PGMSTR(MAX_STR, "Max");
|
|
123
|
+ PGMSTR(SIZE_STR, "Size");
|
|
124
|
+ config_line(MIN_STR, wmin.x, X_STR);
|
|
125
|
+ config_line(MIN_STR, wmin.y, Y_STR);
|
|
126
|
+ config_line(MIN_STR, wmin.z, Z_STR);
|
|
127
|
+ config_line(MAX_STR, wmax.x, X_STR);
|
|
128
|
+ config_line(MAX_STR, wmax.y, Y_STR);
|
|
129
|
+ config_line(MAX_STR, wmax.z, Z_STR);
|
|
130
|
+ config_line(SIZE_STR, wmax.x - wmin.x, X_STR);
|
|
131
|
+ config_line(SIZE_STR, wmax.y - wmin.y, Y_STR);
|
|
132
|
+ config_line(SIZE_STR, wmax.z - wmin.z, Z_STR);
|
|
133
|
+
|
|
134
|
+ //
|
|
135
|
+ // Print and Travel Acceleration
|
|
136
|
+ //
|
|
137
|
+ #define _ACCEL(A,B) _MIN(planner.settings.max_acceleration_mm_per_s2[A##_AXIS], planner.settings.B)
|
|
138
|
+ PGMSTR(P_ACC_STR, "PrintAccel");
|
|
139
|
+ PGMSTR(T_ACC_STR, "TravelAccel");
|
|
140
|
+ config_line(P_ACC_STR, _ACCEL(X, acceleration), X_STR);
|
|
141
|
+ config_line(P_ACC_STR, _ACCEL(Y, acceleration), Y_STR);
|
|
142
|
+ config_line(P_ACC_STR, _ACCEL(Z, acceleration), Z_STR);
|
|
143
|
+ config_line(T_ACC_STR, _ACCEL(X, travel_acceleration), X_STR);
|
|
144
|
+ config_line(T_ACC_STR, _ACCEL(Y, travel_acceleration), Y_STR);
|
|
145
|
+ config_line(T_ACC_STR, _ACCEL(Z, travel_acceleration), Z_STR);
|
|
146
|
+
|
|
147
|
+ config_prefix(PSTR("PrinterType"));
|
|
148
|
+ SERIAL_ECHOLNPGM(
|
|
149
|
+ TERN_(DELTA, "Delta")
|
|
150
|
+ TERN_(IS_SCARA, "SCARA")
|
|
151
|
+ TERN_(IS_CORE, "Core")
|
|
152
|
+ TERN_(IS_CARTESIAN, "Cartesian")
|
|
153
|
+ );
|
|
154
|
+
|
|
155
|
+ //
|
|
156
|
+ // Heated Bed
|
|
157
|
+ //
|
|
158
|
+ config_line(PSTR("HeatedBed"), ENABLED(HAS_HEATED_BED));
|
|
159
|
+ #if HAS_HEATED_BED
|
|
160
|
+ config_line(PSTR("MaxBedTemp"), BED_MAX_TARGET);
|
|
161
|
+ #endif
|
|
162
|
+
|
|
163
|
+ //
|
|
164
|
+ // Per-Extruder settings
|
|
165
|
+ //
|
|
166
|
+ config_line(PSTR("NumExtruder"), EXTRUDERS);
|
|
167
|
+ #if EXTRUDERS
|
|
168
|
+ #define DIAM_VALUE(N) TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[N])
|
|
169
|
+ #if HAS_LINEAR_E_JERK
|
|
170
|
+ #define E_JERK_VAL(N) planner.max_e_jerk[E_INDEX_N(N)]
|
|
171
|
+ #elif HAS_CLASSIC_JERK
|
|
172
|
+ #define E_JERK_VAL(N) planner.max_jerk.e
|
|
173
|
+ #else
|
|
174
|
+ #define E_JERK_VAL(N) DEFAULT_EJERK
|
|
175
|
+ #endif
|
|
176
|
+ #define _EXTR_ITEM(N) do{ \
|
|
177
|
+ PGMSTR(EXTR_STR, "Extr." STRINGIFY(INCREMENT(N)) ":"); \
|
|
178
|
+ config_line(JERK_STR, E_JERK_VAL(N), EXTR_STR); \
|
|
179
|
+ config_line(PSTR("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(N)], EXTR_STR); \
|
|
180
|
+ config_line(PSTR("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(N)], EXTR_STR); \
|
|
181
|
+ config_line(PSTR("Diameter"), DIAM_VALUE(N), EXTR_STR); \
|
|
182
|
+ config_line(PSTR("MaxTemp"), (HEATER_##N##_MAXTEMP) - (HOTEND_OVERSHOOT), EXTR_STR); \
|
|
183
|
+ }while(0)
|
|
184
|
+
|
|
185
|
+ REPEAT(EXTRUDERS, _EXTR_ITEM);
|
|
186
|
+ #endif
|
|
187
|
+}
|
|
188
|
+
|
|
189
|
+#endif
|