Cherry-picked Repetier acceleration fixes, thanks to @lordofhyphens

e0d8101627
885f27b8ae

Added a printer settings to enable / disable variable layer height editing.
This commit is contained in:
Joseph Lenox 2016-07-16 09:52:11 -05:00 committed by bubnikv
parent db30cee6a9
commit abda054720
7 changed files with 30 additions and 9 deletions

View File

@ -132,7 +132,7 @@ The author of the Silk icon set is Mark James.
(default: 100,100) (default: 100,100)
--z-offset Additional height in mm to add to vertical coordinates --z-offset Additional height in mm to add to vertical coordinates
(+/-, default: 0) (+/-, default: 0)
--gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/machinekit/no-extrusion, --gcode-flavor The type of G-code to generate (reprap/teacup/repetier/makerware/sailfish/mach3/machinekit/smoothie/no-extrusion,
default: reprap) default: reprap)
--use-relative-e-distances Enable this to get relative E values (default: no) --use-relative-e-distances Enable this to get relative E values (default: no)
--use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no) --use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no)

View File

@ -1129,7 +1129,7 @@ sub build {
serial_port serial_speed serial_port serial_speed
octoprint_host octoprint_apikey octoprint_host octoprint_apikey
use_firmware_retraction pressure_advance use_firmware_retraction pressure_advance
use_volumetric_e use_volumetric_e variable_layer_height
start_gcode end_gcode before_layer_gcode layer_gcode toolchange_gcode start_gcode end_gcode before_layer_gcode layer_gcode toolchange_gcode
nozzle_diameter extruder_offset nozzle_diameter extruder_offset
retract_length retract_lift retract_speed retract_restart_extra retract_before_travel retract_layer_change wipe retract_length retract_lift retract_speed retract_restart_extra retract_before_travel retract_layer_change wipe
@ -1334,6 +1334,7 @@ sub build {
$optgroup->append_single_option_line('use_firmware_retraction'); $optgroup->append_single_option_line('use_firmware_retraction');
$optgroup->append_single_option_line('use_volumetric_e'); $optgroup->append_single_option_line('use_volumetric_e');
$optgroup->append_single_option_line('pressure_advance'); $optgroup->append_single_option_line('pressure_advance');
$optgroup->append_single_option_line('variable_layer_height');
} }
} }
{ {

View File

@ -298,7 +298,7 @@ $j
(default: 100,100) (default: 100,100)
--z-offset Additional height in mm to add to vertical coordinates --z-offset Additional height in mm to add to vertical coordinates
(+/-, default: $config->{z_offset}) (+/-, default: $config->{z_offset})
--gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/machinekit/no-extrusion, --gcode-flavor The type of G-code to generate (reprap/teacup/repetier/makerware/sailfish/mach3/machinekit/smoothie/no-extrusion,
default: $config->{gcode_flavor}) default: $config->{gcode_flavor})
--use-relative-e-distances Enable this to get relative E values (default: no) --use-relative-e-distances Enable this to get relative E values (default: no)
--use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no) --use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no)

View File

@ -22,7 +22,7 @@ _arguments -S \
'*--nozzle-diameter[specify nozzle diameter]:nozzle diameter in mm' \ '*--nozzle-diameter[specify nozzle diameter]:nozzle diameter in mm' \
'--print-center[specify print center coordinates]:print center coordinates in mm,mm' \ '--print-center[specify print center coordinates]:print center coordinates in mm,mm' \
'--z-offset[specify Z-axis offset]:Z-axis offset in mm' \ '--z-offset[specify Z-axis offset]:Z-axis offset in mm' \
'--gcode-flavor[specify the type of G-code to generate]:G-code flavor:(reprap teacup makerware sailfish mach3 machinekit no-extrusion)' \ '--gcode-flavor[specify the type of G-code to generate]:G-code flavor:(reprap teacup repetier makerware sailfish mach3 machinekit smoothie no-extrusion)' \
'(--use-relative-e-distances --no-use-relative-e-distances)'--{no-,}use-relative-e-distances'[disable/enable relative E values]' \ '(--use-relative-e-distances --no-use-relative-e-distances)'--{no-,}use-relative-e-distances'[disable/enable relative E values]' \
'--extrusion-axis[specify letter associated with the extrusion axis]:extrusion axis letter' \ '--extrusion-axis[specify letter associated with the extrusion axis]:extrusion axis letter' \
'(--gcode-arcs --no-gcode-arcs)'--{no-,}gcode-arcs'[disable/enable G2/G3 commands for native arcs]' \ '(--gcode-arcs --no-gcode-arcs)'--{no-,}gcode-arcs'[disable/enable G2/G3 commands for native arcs]' \

View File

@ -41,7 +41,7 @@ GCodeWriter::preamble()
gcode << "G21 ; set units to millimeters\n"; gcode << "G21 ; set units to millimeters\n";
gcode << "G90 ; use absolute coordinates\n"; gcode << "G90 ; use absolute coordinates\n";
} }
if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfTeacup)) { if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfRepetier) || FLAVOR_IS(gcfSmoothie)) {
if (this->config.use_relative_e_distances) { if (this->config.use_relative_e_distances) {
gcode << "M83 ; use relative distances for extrusion\n"; gcode << "M83 ; use relative distances for extrusion\n";
} else { } else {
@ -172,7 +172,14 @@ GCodeWriter::set_acceleration(unsigned int acceleration)
this->_last_acceleration = acceleration; this->_last_acceleration = acceleration;
std::ostringstream gcode; std::ostringstream gcode;
gcode << "M204 S" << acceleration; if (FLAVOR_IS(gcfRepetier)) {
gcode << "M201 X" << acceleration << " Y" << acceleration;
if (this->config.gcode_comments) gcode << " ; adjust acceleration";
gcode << "\n";
gcode << "M202 X" << acceleration << " Y" << acceleration;
} else {
gcode << "M204 S" << acceleration;
}
if (this->config.gcode_comments) gcode << " ; adjust acceleration"; if (this->config.gcode_comments) gcode << " ; adjust acceleration";
gcode << "\n"; gcode << "\n";

View File

@ -526,18 +526,22 @@ PrintConfigDef::PrintConfigDef()
def->cli = "gcode-flavor=s"; def->cli = "gcode-flavor=s";
def->enum_keys_map = ConfigOptionEnum<GCodeFlavor>::get_enum_values(); def->enum_keys_map = ConfigOptionEnum<GCodeFlavor>::get_enum_values();
def->enum_values.push_back("reprap"); def->enum_values.push_back("reprap");
def->enum_values.push_back("repetier");
def->enum_values.push_back("teacup"); def->enum_values.push_back("teacup");
def->enum_values.push_back("makerware"); def->enum_values.push_back("makerware");
def->enum_values.push_back("sailfish"); def->enum_values.push_back("sailfish");
def->enum_values.push_back("mach3"); def->enum_values.push_back("mach3");
def->enum_values.push_back("machinekit"); def->enum_values.push_back("machinekit");
def->enum_values.push_back("smoothie");
def->enum_values.push_back("no-extrusion"); def->enum_values.push_back("no-extrusion");
def->enum_labels.push_back("RepRap (Marlin/Sprinter/Repetier)"); def->enum_labels.push_back("RepRap (Marlin/Sprinter)");
def->enum_labels.push_back("Repetier");
def->enum_labels.push_back("Teacup"); def->enum_labels.push_back("Teacup");
def->enum_labels.push_back("MakerWare (MakerBot)"); def->enum_labels.push_back("MakerWare (MakerBot)");
def->enum_labels.push_back("Sailfish (MakerBot)"); def->enum_labels.push_back("Sailfish (MakerBot)");
def->enum_labels.push_back("Mach3/LinuxCNC"); def->enum_labels.push_back("Mach3/LinuxCNC");
def->enum_labels.push_back("Machinekit"); def->enum_labels.push_back("Machinekit");
def->enum_labels.push_back("Smoothie");
def->enum_labels.push_back("No extrusion"); def->enum_labels.push_back("No extrusion");
def->default_value = new ConfigOptionEnum<GCodeFlavor>(gcfRepRap); def->default_value = new ConfigOptionEnum<GCodeFlavor>(gcfRepRap);
@ -1432,6 +1436,12 @@ PrintConfigDef::PrintConfigDef()
def->cli = "use-volumetric-e!"; def->cli = "use-volumetric-e!";
def->default_value = new ConfigOptionBool(false); def->default_value = new ConfigOptionBool(false);
def = this->add("variable_layer_height", coBool);
def->label = "Enable variable layer height feature";
def->tooltip = "Some printers or printer setups may have difficulties printing with a variable layer height. Enabled by default.";
def->cli = "variable-layer-height!";
def->default_value = new ConfigOptionBool(true);
def = this->add("wipe", coBools); def = this->add("wipe", coBools);
def->label = "Wipe while retracting"; def->label = "Wipe while retracting";
def->tooltip = "This flag will move the nozzle while retracting to minimize the possible blob on leaky extruders."; def->tooltip = "This flag will move the nozzle while retracting to minimize the possible blob on leaky extruders.";

View File

@ -26,7 +26,7 @@
namespace Slic3r { namespace Slic3r {
enum GCodeFlavor { enum GCodeFlavor {
gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion, gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion, gcfSmoothie, gcfRepetier,
}; };
enum InfillPattern { enum InfillPattern {
@ -45,9 +45,11 @@ enum SeamPosition {
template<> inline t_config_enum_values ConfigOptionEnum<GCodeFlavor>::get_enum_values() { template<> inline t_config_enum_values ConfigOptionEnum<GCodeFlavor>::get_enum_values() {
t_config_enum_values keys_map; t_config_enum_values keys_map;
keys_map["reprap"] = gcfRepRap; keys_map["reprap"] = gcfRepRap;
keys_map["repetier"] = gcfRepetier;
keys_map["teacup"] = gcfTeacup; keys_map["teacup"] = gcfTeacup;
keys_map["makerware"] = gcfMakerWare; keys_map["makerware"] = gcfMakerWare;
keys_map["sailfish"] = gcfSailfish; keys_map["sailfish"] = gcfSailfish;
keys_map["smoothie"] = gcfSmoothie;
keys_map["mach3"] = gcfMach3; keys_map["mach3"] = gcfMach3;
keys_map["machinekit"] = gcfMachinekit; keys_map["machinekit"] = gcfMachinekit;
keys_map["no-extrusion"] = gcfNoExtrusion; keys_map["no-extrusion"] = gcfNoExtrusion;
@ -324,6 +326,7 @@ class GCodeConfig : public virtual StaticPrintConfig
ConfigOptionBool use_firmware_retraction; ConfigOptionBool use_firmware_retraction;
ConfigOptionBool use_relative_e_distances; ConfigOptionBool use_relative_e_distances;
ConfigOptionBool use_volumetric_e; ConfigOptionBool use_volumetric_e;
ConfigOptionBool variable_layer_height;
GCodeConfig(bool initialize = true) : StaticPrintConfig() { GCodeConfig(bool initialize = true) : StaticPrintConfig() {
if (initialize) if (initialize)
@ -361,7 +364,7 @@ class GCodeConfig : public virtual StaticPrintConfig
OPT_PTR(use_firmware_retraction); OPT_PTR(use_firmware_retraction);
OPT_PTR(use_relative_e_distances); OPT_PTR(use_relative_e_distances);
OPT_PTR(use_volumetric_e); OPT_PTR(use_volumetric_e);
OPT_PTR(variable_layer_height);
return NULL; return NULL;
}; };