|
@@ -2436,38 +2436,44 @@ void refresh_cmd_timeout(void)
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef FWRETRACT
|
|
#ifdef FWRETRACT
|
|
- void retract(bool retracting, bool swapretract = false) {
|
|
+void retract(bool retracting, bool swapretract = false) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if(retracting && !retracted[active_extruder]) {
|
|
if(retracting && !retracted[active_extruder]) {
|
|
- destination[X_AXIS]=current_position[X_AXIS];
|
|
+ st_synchronize();
|
|
- destination[Y_AXIS]=current_position[Y_AXIS];
|
|
+ set_destination_to_current();
|
|
- destination[Z_AXIS]=current_position[Z_AXIS];
|
|
+ current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f;
|
|
- destination[E_AXIS]=current_position[E_AXIS];
|
|
+ plan_set_e_position(current_position[E_AXIS]);
|
|
- current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f;
|
|
+ float oldFeedrate = feedrate;
|
|
- plan_set_e_position(current_position[E_AXIS]);
|
|
+ feedrate=cs.retract_feedrate*60;
|
|
- float oldFeedrate = feedrate;
|
|
+ retracted[active_extruder]=true;
|
|
- feedrate=cs.retract_feedrate*60;
|
|
+ prepare_move();
|
|
- retracted[active_extruder]=true;
|
|
+ if(cs.retract_zlift) {
|
|
- prepare_move();
|
|
+ st_synchronize();
|
|
- current_position[Z_AXIS]-=cs.retract_zlift;
|
|
+ current_position[Z_AXIS]-=cs.retract_zlift;
|
|
- plan_set_position_curposXYZE();
|
|
+ plan_set_position_curposXYZE();
|
|
- prepare_move();
|
|
+ prepare_move();
|
|
- feedrate = oldFeedrate;
|
|
+ }
|
|
|
|
+ feedrate = oldFeedrate;
|
|
} else if(!retracting && retracted[active_extruder]) {
|
|
} else if(!retracting && retracted[active_extruder]) {
|
|
- destination[X_AXIS]=current_position[X_AXIS];
|
|
+ st_synchronize();
|
|
- destination[Y_AXIS]=current_position[Y_AXIS];
|
|
+ set_destination_to_current();
|
|
- destination[Z_AXIS]=current_position[Z_AXIS];
|
|
+ float oldFeedrate = feedrate;
|
|
- destination[E_AXIS]=current_position[E_AXIS];
|
|
+ feedrate=cs.retract_recover_feedrate*60;
|
|
- current_position[Z_AXIS]+=cs.retract_zlift;
|
|
+ if(cs.retract_zlift) {
|
|
- plan_set_position_curposXYZE();
|
|
+ current_position[Z_AXIS]+=cs.retract_zlift;
|
|
- current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f;
|
|
+ plan_set_position_curposXYZE();
|
|
- plan_set_e_position(current_position[E_AXIS]);
|
|
+ prepare_move();
|
|
- float oldFeedrate = feedrate;
|
|
+ st_synchronize();
|
|
- feedrate=cs.retract_recover_feedrate*60;
|
|
+ }
|
|
- retracted[active_extruder]=false;
|
|
+ current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f;
|
|
- prepare_move();
|
|
+ plan_set_e_position(current_position[E_AXIS]);
|
|
- feedrate = oldFeedrate;
|
|
+ retracted[active_extruder]=false;
|
|
|
|
+ prepare_move();
|
|
|
|
+ feedrate = oldFeedrate;
|
|
}
|
|
}
|
|
- }
|
|
+}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
void trace() {
|
|
void trace() {
|
|
@@ -2722,8 +2728,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
|
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-
|
|
+
|
|
-
|
|
|
|
if (home_z)
|
|
if (home_z)
|
|
babystep_undo();
|
|
babystep_undo();
|
|
|
|
|
|
@@ -4383,21 +4388,22 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) {
|
|
if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) {
|
|
total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100);
|
|
total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100);
|
|
}
|
|
}
|
|
- #ifdef FWRETRACT
|
|
|
|
- if(cs.autoretract_enabled)
|
|
|
|
- if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) {
|
|
|
|
- float echange=destination[E_AXIS]-current_position[E_AXIS];
|
|
|
|
-
|
|
|
|
- if((echange<-MIN_RETRACT && !retracted[active_extruder]) || (echange>MIN_RETRACT && retracted[active_extruder])) {
|
|
|
|
- current_position[E_AXIS] = destination[E_AXIS];
|
|
|
|
- plan_set_e_position(current_position[E_AXIS]);
|
|
|
|
- retract(!retracted[active_extruder]);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
+#ifdef FWRETRACT
|
|
|
|
+ if(cs.autoretract_enabled) {
|
|
|
|
+ if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) {
|
|
|
|
+ float echange=destination[E_AXIS]-current_position[E_AXIS];
|
|
|
|
+ if((echange<-MIN_RETRACT && !retracted[active_extruder]) || (echange>MIN_RETRACT && retracted[active_extruder])) {
|
|
|
|
+ st_synchronize();
|
|
|
|
+ current_position[E_AXIS] = destination[E_AXIS];
|
|
|
|
+ plan_set_e_position(current_position[E_AXIS]);
|
|
|
|
+ retract(!retracted[active_extruder]);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- #endif
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
prepare_move();
|
|
prepare_move();
|
|
|
|
|
|
}
|
|
}
|
|
@@ -4465,9 +4471,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
lcd_update(0);
|
|
lcd_update(0);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- #ifdef FWRETRACT
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+#ifdef FWRETRACT
|
|
|
|
|
|
### G10 - Retract <a href="https://reprap.org/wiki/G-code#G10:_Retract">G10: Retract</a>
|
|
### G10 - Retract <a href="https://reprap.org/wiki/G-code#G10:_Retract">G10: Retract</a>
|
|
Retracts filament according to settings of `M207`
|
|
Retracts filament according to settings of `M207`
|
|
@@ -4480,7 +4486,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
retract(true);
|
|
retract(true);
|
|
#endif
|
|
#endif
|
|
break;
|
|
break;
|
|
-
|
|
+
|
|
|
|
|
|
|
|
|
|
### G11 - Retract recover <a href="https://reprap.org/wiki/G-code#G11:_Unretract">G11: Unretract</a>
|
|
### G11 - Retract recover <a href="https://reprap.org/wiki/G-code#G11:_Unretract">G11: Unretract</a>
|
|
@@ -4493,8 +4499,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
retract(false);
|
|
retract(false);
|
|
#endif
|
|
#endif
|
|
break;
|
|
break;
|
|
- #endif
|
|
+#endif
|
|
-
|
|
+
|
|
|
|
|
|
|
|
|
|
### G21 - Sets Units to Millimters <a href="https://reprap.org/wiki/G-code#G21:_Set_Units_to_Millimeters">G21: Set Units to Millimeters</a>
|
|
### G21 - Sets Units to Millimters <a href="https://reprap.org/wiki/G-code#G21:_Set_Units_to_Millimeters">G21: Set Units to Millimeters</a>
|
|
@@ -4754,6 +4760,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
*/
|
|
*/
|
|
case 30:
|
|
case 30:
|
|
{
|
|
{
|
|
|
|
+ homing_flag = true;
|
|
st_synchronize();
|
|
st_synchronize();
|
|
|
|
|
|
int l_feedmultiply = setup_for_endstop_move();
|
|
int l_feedmultiply = setup_for_endstop_move();
|
|
@@ -4765,6 +4772,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z);
|
|
printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z);
|
|
|
|
|
|
clean_up_after_endstop_move(l_feedmultiply);
|
|
clean_up_after_endstop_move(l_feedmultiply);
|
|
|
|
+ homing_flag = false;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -4855,6 +4863,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ homing_flag = true;
|
|
lcd_update_enable(true);
|
|
lcd_update_enable(true);
|
|
KEEPALIVE_STATE(NOT_BUSY);
|
|
KEEPALIVE_STATE(NOT_BUSY);
|
|
SERIAL_ECHOLNPGM("PINDA probe calibration start");
|
|
SERIAL_ECHOLNPGM("PINDA probe calibration start");
|
|
@@ -4899,6 +4909,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
bool find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
|
bool find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
|
if (find_z_result == false) {
|
|
if (find_z_result == false) {
|
|
lcd_temp_cal_show_result(find_z_result);
|
|
lcd_temp_cal_show_result(find_z_result);
|
|
|
|
+ homing_flag = false;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
zero_z = current_position[Z_AXIS];
|
|
zero_z = current_position[Z_AXIS];
|
|
@@ -4949,9 +4960,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z);
|
|
printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z);
|
|
|
|
|
|
EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
-
|
|
|
|
}
|
|
}
|
|
lcd_temp_cal_show_result(true);
|
|
lcd_temp_cal_show_result(true);
|
|
|
|
+ homing_flag = false;
|
|
|
|
|
|
#else
|
|
#else
|
|
|
|
|
|
@@ -5161,8 +5172,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
|
|
|
mbl.reset();
|
|
mbl.reset();
|
|
|
|
|
|
-
|
|
+
|
|
-
|
|
|
|
babystep_undo();
|
|
babystep_undo();
|
|
|
|
|
|
|
|
|
|
@@ -7314,8 +7324,9 @@ Sigma_Exit:
|
|
if(code_seen(axis_codes[i])) cs.add_homing[i] = code_value();
|
|
if(code_seen(axis_codes[i])) cs.add_homing[i] = code_value();
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- #ifdef FWRETRACT
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+#ifdef FWRETRACT
|
|
|
|
|
|
### M207 - Set firmware retraction <a href="https://reprap.org/wiki/G-code#M207:_Set_retract_length">M207: Set retract length</a>
|
|
### M207 - Set firmware retraction <a href="https://reprap.org/wiki/G-code#M207:_Set_retract_length">M207: Set retract length</a>
|
|
#### Usage
|
|
#### Usage
|
|
@@ -7413,7 +7424,9 @@ Sigma_Exit:
|
|
}
|
|
}
|
|
|
|
|
|
}break;
|
|
}break;
|
|
- #endif
|
|
+#endif
|
|
|
|
+
|
|
|
|
+
|
|
#if EXTRUDERS > 1
|
|
#if EXTRUDERS > 1
|
|
|
|
|
|
|
|
|