MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / M600

Method M600

Marlin/src/gcode/feature/pause/M600.cpp:85–196  ·  view source on GitHub ↗

* M600: Pause for filament change * * E[distance] - Retract the filament this far * Z[distance] - Move the Z axis by this distance * X[position] - Move to this X position (instead of NOZZLE_PARK_POINT.x) * Y[position] - Move to this Y position (instead of NOZZLE_PARK_POINT.y) * I[position] - Move to this I position (instead of NOZZLE_PARK_POINT.i) * J[position] - Move to this J positi

Source from the content-addressed store, hash-verified

83 * Default values are used for omitted arguments.
84 */
85void GcodeSuite::M600() {
86
87 #if ENABLED(MIXING_EXTRUDER)
88 const int8_t eindex = get_target_e_stepper_from_command();
89 if (eindex < 0) return;
90
91 const uint8_t old_mixing_tool = mixer.get_current_vtool();
92 mixer.T(MIXER_DIRECT_SET_TOOL);
93
94 MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(eindex) ? 1.0 : 0.0);
95 mixer.normalize();
96
97 const int8_t target_extruder = active_extruder;
98 #else
99 const int8_t target_extruder = get_target_extruder_from_command();
100 if (target_extruder < 0) return;
101 #endif
102
103 #if ENABLED(DUAL_X_CARRIAGE)
104 int8_t DXC_ext = target_extruder;
105 if (!parser.seen_test('T')) { // If no tool index is specified, M600 was (probably) sent in response to filament runout.
106 // In this case, for duplicating modes set DXC_ext to the extruder that ran out.
107 #if MULTI_FILAMENT_SENSOR
108 if (idex_is_duplicating())
109 DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT2_STATE) ? 1 : 0;
110 #else
111 DXC_ext = active_extruder;
112 #endif
113 }
114 #endif
115
116 const bool standardM600 = TERN1(MMU_MENUS, TERN1(HAS_PRUSA_MMU2, !mmu2.enabled()) && TERN1(HAS_PRUSA_MMU3, !mmu3.mmu_hw_enabled));
117
118 // Show initial "wait for start" message
119 if (standardM600)
120 ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder);
121
122 TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_ChangeWait_L, ID_ChangeWait_D)); //given the context it seems this likely should have been pages 6 & 61
123
124 // If needed, home before parking for filament change
125 TERN_(HOME_BEFORE_FILAMENT_CHANGE, home_if_needed(true));
126
127 #if HAS_MULTI_EXTRUDER
128 // Change toolhead if specified
129 const uint8_t active_extruder_before_filament_change = active_extruder;
130 if (active_extruder != target_extruder && TERN1(DUAL_X_CARRIAGE, !idex_is_duplicating()))
131 tool_change(target_extruder);
132 #endif
133
134 // Initial retract before move to filament change position
135 const float retract = -ABS(parser.axisunitsval('E', E_AXIS, PAUSE_PARK_RETRACT_LENGTH));
136
137 xyz_pos_t park_point NOZZLE_PARK_POINT;
138
139 // Move XY axes to filament change position or given position
140 NUM_AXIS_CODE(
141 if (parser.seenval('X')) park_point.x = parser.linearval('X'),
142 if (parser.seenval('Y')) park_point.y = parser.linearval('Y'),

Callers

nothing calls this directly

Calls 15

idex_is_duplicatingFunction · 0.85
home_if_neededFunction · 0.85
tool_changeFunction · 0.85
ABSFunction · 0.85
pause_printFunction · 0.85
resume_printFunction · 0.85
mmu2_M600Function · 0.85
get_current_vtoolMethod · 0.80
set_collectorMethod · 0.80
seen_testMethod · 0.80
axisunitsvalMethod · 0.80
seenvalMethod · 0.80

Tested by

no test coverage detected