Merge branch 'lm_separate_travel_speed_z'

This commit is contained in:
Lukas Matena 2021-05-31 21:22:17 +02:00
commit 413bce49fc
6 changed files with 23 additions and 2 deletions

View File

@ -316,6 +316,11 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com
std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &comment)
{
// FIXME: This function was not being used when travel_speed_z was separated (bd6badf).
// Calculation of feedrate was not updated accordingly. If you want to use
// this function, fix it first.
std::terminate();
/* If target Z is lower than current Z but higher than nominal Z we
don't perform the Z move but we only move in the XY plane and
adjust the nominal Z by reducing the lift amount that will be
@ -367,10 +372,14 @@ std::string GCodeWriter::travel_to_z(double z, const std::string &comment)
std::string GCodeWriter::_travel_to_z(double z, const std::string &comment)
{
m_pos(2) = z;
double speed = this->config.travel_speed_z.value;
if (speed == 0.)
speed = this->config.travel_speed.value;
std::ostringstream gcode;
gcode << "G1 Z" << XYZF_NUM(z)
<< " F" << XYZF_NUM(this->config.travel_speed.value * 60.0);
<< " F" << XYZF_NUM(speed * 60.0);
COMMENT(comment);
gcode << "\n";
return gcode.str();

View File

@ -430,7 +430,7 @@ const std::vector<std::string>& Preset::print_options()
#endif /* HAS_PRESSURE_EQUALIZER */
"perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "infill_speed", "solid_infill_speed",
"top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed",
"bridge_speed", "gap_fill_speed", "gap_fill_enabled", "travel_speed", "first_layer_speed", "perimeter_acceleration", "infill_acceleration",
"bridge_speed", "gap_fill_speed", "gap_fill_enabled", "travel_speed", "travel_speed_z", "first_layer_speed", "perimeter_acceleration", "infill_acceleration",
"bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "draft_shield",
"min_skirt_length", "brim_width", "brim_offset", "brim_type", "support_material", "support_material_auto", "support_material_threshold", "support_material_enforce_layers",
"raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion",

View File

@ -197,6 +197,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|| opt_key == "cooling_tube_length"
|| opt_key == "extra_loading_move"
|| opt_key == "travel_speed"
|| opt_key == "travel_speed_z"
|| opt_key == "first_layer_speed"
|| opt_key == "z_offset") {
steps.emplace_back(psWipeTower);

View File

@ -2738,6 +2738,15 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(130));
def = this->add("travel_speed_z", coFloat);
def->label = L("Z travel");
def->tooltip = L("Speed for movements along the Z axis.\nWhen set to zero, the value "
"is ignored and regular travel speed is used instead.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.));
def = this->add("use_firmware_retraction", coBool);
def->label = L("Use firmware retraction");
def->tooltip = L("This experimental setting uses G10 and G11 commands to have the firmware "

View File

@ -627,6 +627,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionBool, wipe_tower_no_sparse_layers))
((ConfigOptionString, toolchange_gcode))
((ConfigOptionFloat, travel_speed))
((ConfigOptionFloat, travel_speed_z))
((ConfigOptionBool, use_firmware_retraction))
((ConfigOptionBool, use_relative_e_distances))
((ConfigOptionBool, use_volumetric_e))

View File

@ -1545,6 +1545,7 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Speed for non-print moves"));
optgroup->append_single_option_line("travel_speed");
optgroup->append_single_option_line("travel_speed_z");
optgroup = page->new_optgroup(L("Modifiers"));
optgroup->append_single_option_line("first_layer_speed");