|
|
@ -51,23 +51,23 @@
|
|
|
|
* G3 - CCW ARC
|
|
|
|
* G3 - CCW ARC
|
|
|
|
* G4 - Dwell S<seconds> or P<milliseconds>
|
|
|
|
* G4 - Dwell S<seconds> or P<milliseconds>
|
|
|
|
* G5 - Cubic B-spline with XYZE destination and IJPQ offsets
|
|
|
|
* G5 - Cubic B-spline with XYZE destination and IJPQ offsets
|
|
|
|
* G10 - Retract filament according to settings of M207
|
|
|
|
* G10 - Retract filament according to settings of M207 (Requires FWRETRACT)
|
|
|
|
* G11 - Retract recover filament according to settings of M208
|
|
|
|
* G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT)
|
|
|
|
* G12 - Clean tool
|
|
|
|
* G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE)
|
|
|
|
* G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G20 - Set input units to inches
|
|
|
|
* G20 - Set input units to inches (Requires INCH_MODE_SUPPORT)
|
|
|
|
* G21 - Set input units to millimeters
|
|
|
|
* G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT)
|
|
|
|
* G26 - Mesh Validation Pattern (Requires UBL_G26_MESH_VALIDATION)
|
|
|
|
* G26 - Mesh Validation Pattern (Requires UBL_G26_MESH_VALIDATION)
|
|
|
|
* G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE)
|
|
|
|
* G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE)
|
|
|
|
* G28 - Home one or more axes
|
|
|
|
* G28 - Home one or more axes
|
|
|
|
* G29 - Detailed Z probe, probes the bed at 3 or more points. Will fail if you haven't homed yet.
|
|
|
|
* G29 - Start or continue the bed leveling probe procedure (Requires bed leveling)
|
|
|
|
* G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
|
|
|
|
* G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
|
|
|
|
* G31 - Dock sled (Z_PROBE_SLED only)
|
|
|
|
* G31 - Dock sled (Z_PROBE_SLED only)
|
|
|
|
* G32 - Undock sled (Z_PROBE_SLED only)
|
|
|
|
* G32 - Undock sled (Z_PROBE_SLED only)
|
|
|
|
* G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
|
|
|
|
* G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
|
|
|
|
* G38 - Probe target - similar to G28 except it uses the Z_MIN_PROBE for all three axes
|
|
|
|
* G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET)
|
|
|
|
* G42 - Coordinated move to a mesh point (Requires AUTO_BED_LEVELING_UBL)
|
|
|
|
* G42 - Coordinated move to a mesh point (Requires AUTO_BED_LEVELING_UBL)
|
|
|
|
* G90 - Use Absolute Coordinates
|
|
|
|
* G90 - Use Absolute Coordinates
|
|
|
|
* G91 - Use Relative Coordinates
|
|
|
|
* G91 - Use Relative Coordinates
|
|
|
@ -427,16 +427,10 @@ static float saved_feedrate_mm_s;
|
|
|
|
int16_t feedrate_percentage = 100, saved_feedrate_percentage,
|
|
|
|
int16_t feedrate_percentage = 100, saved_feedrate_percentage,
|
|
|
|
flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
|
|
|
|
flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Initialized by settings.load()
|
|
|
|
bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
|
|
|
|
bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
|
|
|
|
volumetric_enabled =
|
|
|
|
volumetric_enabled;
|
|
|
|
#if ENABLED(VOLUMETRIC_DEFAULT_ON)
|
|
|
|
float filament_size[EXTRUDERS], volumetric_multiplier[EXTRUDERS];
|
|
|
|
true
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
false
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA),
|
|
|
|
|
|
|
|
volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_WORKSPACE_OFFSET
|
|
|
|
#if HAS_WORKSPACE_OFFSET
|
|
|
|
#if HAS_POSITION_SHIFT
|
|
|
|
#if HAS_POSITION_SHIFT
|
|
|
@ -513,7 +507,7 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL
|
|
|
|
static uint8_t target_extruder;
|
|
|
|
static uint8_t target_extruder;
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE
|
|
|
|
#if HAS_BED_PROBE
|
|
|
|
float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
|
|
|
|
float zprobe_zoffset; // Initialized by settings.load()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_ABL
|
|
|
|
#if HAS_ABL
|
|
|
@ -542,18 +536,12 @@ static uint8_t target_extruder;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(Z_DUAL_ENDSTOPS)
|
|
|
|
#if ENABLED(Z_DUAL_ENDSTOPS)
|
|
|
|
float z_endstop_adj =
|
|
|
|
float z_endstop_adj;
|
|
|
|
#ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT
|
|
|
|
|
|
|
|
Z_DUAL_ENDSTOPS_ADJUSTMENT
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Extruder offsets
|
|
|
|
// Extruder offsets
|
|
|
|
#if HOTENDS > 1
|
|
|
|
#if HOTENDS > 1
|
|
|
|
float hotend_offset[XYZ][HOTENDS];
|
|
|
|
float hotend_offset[XYZ][HOTENDS]; // Initialized by settings.load()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Z_SERVO_ENDSTOP
|
|
|
|
#if HAS_Z_SERVO_ENDSTOP
|
|
|
@ -561,8 +549,8 @@ static uint8_t target_extruder;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(BARICUDA)
|
|
|
|
#if ENABLED(BARICUDA)
|
|
|
|
int baricuda_valve_pressure = 0;
|
|
|
|
uint8_t baricuda_valve_pressure = 0,
|
|
|
|
int baricuda_e_to_p_pressure = 0;
|
|
|
|
baricuda_e_to_p_pressure = 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
@ -596,8 +584,7 @@ static uint8_t target_extruder;
|
|
|
|
float delta[ABC],
|
|
|
|
float delta[ABC],
|
|
|
|
endstop_adj[ABC] = { 0 };
|
|
|
|
endstop_adj[ABC] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
// These values are loaded or reset at boot time when setup() calls
|
|
|
|
// Initialized by settings.load()
|
|
|
|
// settings.load(), which calls recalc_delta_settings().
|
|
|
|
|
|
|
|
float delta_radius,
|
|
|
|
float delta_radius,
|
|
|
|
delta_tower_angle_trim[2],
|
|
|
|
delta_tower_angle_trim[2],
|
|
|
|
delta_tower[ABC][2],
|
|
|
|
delta_tower[ABC][2],
|
|
|
@ -3403,20 +3390,24 @@ inline void gcode_G4() {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* G10 - Retract filament according to settings of M207
|
|
|
|
* G10 - Retract filament according to settings of M207
|
|
|
|
* G11 - Recover filament according to settings of M208
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
inline void gcode_G10_G11(bool doRetract=false) {
|
|
|
|
inline void gcode_G10() {
|
|
|
|
#if EXTRUDERS > 1
|
|
|
|
#if EXTRUDERS > 1
|
|
|
|
if (doRetract)
|
|
|
|
const bool rs = parser.boolval('S');
|
|
|
|
retracted_swap[active_extruder] = parser.boolval('S'); // checks for swap retract argument
|
|
|
|
retracted_swap[active_extruder] = rs; // Use 'S' for swap, default to false
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
retract(doRetract
|
|
|
|
retract(true
|
|
|
|
#if EXTRUDERS > 1
|
|
|
|
#if EXTRUDERS > 1
|
|
|
|
, retracted_swap[active_extruder]
|
|
|
|
, rs
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* G11 - Recover filament according to settings of M208
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
inline void gcode_G11() { retract(false); }
|
|
|
|
|
|
|
|
|
|
|
|
#endif // FWRETRACT
|
|
|
|
#endif // FWRETRACT
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(NOZZLE_CLEAN_FEATURE)
|
|
|
|
#if ENABLED(NOZZLE_CLEAN_FEATURE)
|
|
|
@ -10450,8 +10441,8 @@ void process_next_command() {
|
|
|
|
|
|
|
|
|
|
|
|
// G2, G3
|
|
|
|
// G2, G3
|
|
|
|
#if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
|
|
|
|
#if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
|
|
|
|
case 2: // G2 - CW ARC
|
|
|
|
case 2: // G2: CW ARC
|
|
|
|
case 3: // G3 - CCW ARC
|
|
|
|
case 3: // G3: CCW ARC
|
|
|
|
gcode_G2_G3(parser.codenum == 2);
|
|
|
|
gcode_G2_G3(parser.codenum == 2);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -10462,16 +10453,17 @@ void process_next_command() {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(BEZIER_CURVE_SUPPORT)
|
|
|
|
#if ENABLED(BEZIER_CURVE_SUPPORT)
|
|
|
|
// G5
|
|
|
|
case 5: // G5: Cubic B_spline
|
|
|
|
case 5: // G5 - Cubic B_spline
|
|
|
|
|
|
|
|
gcode_G5();
|
|
|
|
gcode_G5();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif // BEZIER_CURVE_SUPPORT
|
|
|
|
#endif // BEZIER_CURVE_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
case 10: // G10: retract
|
|
|
|
case 10: // G10: retract
|
|
|
|
|
|
|
|
gcode_G10();
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 11: // G11: retract_recover
|
|
|
|
case 11: // G11: retract_recover
|
|
|
|
gcode_G10_G11(parser.codenum == 10);
|
|
|
|
gcode_G11();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif // FWRETRACT
|
|
|
|
#endif // FWRETRACT
|
|
|
|
|
|
|
|
|
|
|
@ -12511,7 +12503,7 @@ void prepare_move_to_destination() {
|
|
|
|
|
|
|
|
|
|
|
|
#endif // FAST_PWM_FAN
|
|
|
|
#endif // FAST_PWM_FAN
|
|
|
|
|
|
|
|
|
|
|
|
float calculate_volumetric_multiplier(float diameter) {
|
|
|
|
float calculate_volumetric_multiplier(const float diameter) {
|
|
|
|
if (!volumetric_enabled || diameter == 0) return 1.0;
|
|
|
|
if (!volumetric_enabled || diameter == 0) return 1.0;
|
|
|
|
return 1.0 / (M_PI * sq(diameter * 0.5));
|
|
|
|
return 1.0 / (M_PI * sq(diameter * 0.5));
|
|
|
|
}
|
|
|
|
}
|
|
|
|