Fix format of M204 emitted from machine limits for various fws
This commit is contained in:
parent
847a34c644
commit
0a52ef8da7
2 changed files with 18 additions and 17 deletions
|
@ -1663,23 +1663,25 @@ void GCode::print_machine_envelope(GCodeOutputStream &file, Print &print)
|
||||||
int(print.config().machine_max_feedrate_e.values.front() * factor + 0.5),
|
int(print.config().machine_max_feedrate_e.values.front() * factor + 0.5),
|
||||||
factor == 60 ? "mm / min" : "mm / sec");
|
factor == 60 ? "mm / min" : "mm / sec");
|
||||||
|
|
||||||
// Now M204 - acceleration. This one is quite hairy thanks to how Marlin guys care about
|
// Now M204 - acceleration. This one is quite hairy...
|
||||||
// backwards compatibility: https://github.com/prusa3d/PrusaSlicer/issues/1089
|
|
||||||
// Legacy Marlin should export travel acceleration the same as printing acceleration.
|
|
||||||
// MarlinFirmware has the two separated.
|
|
||||||
int travel_acc = flavor == gcfMarlinLegacy
|
|
||||||
? int(print.config().machine_max_acceleration_extruding.values.front() + 0.5)
|
|
||||||
: int(print.config().machine_max_acceleration_travel.values.front() + 0.5);
|
|
||||||
// Retract acceleration not accepted in M204 in RRF
|
|
||||||
if (flavor == gcfRepRapFirmware)
|
if (flavor == gcfRepRapFirmware)
|
||||||
|
// Uses M204 P[print] T[travel]
|
||||||
file.write_format("M204 P%d T%d ; sets acceleration (P, T), mm/sec^2\n",
|
file.write_format("M204 P%d T%d ; sets acceleration (P, T), mm/sec^2\n",
|
||||||
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||||
travel_acc);
|
int(print.config().machine_max_acceleration_travel.values.front() + 0.5));
|
||||||
else
|
else if (flavor == gcfMarlinLegacy)
|
||||||
file.write_format("M204 P%d R%d T%d ; sets acceleration (P, T) and retract acceleration (R), mm/sec^2\n",
|
// Legacy Marlin uses M204 S[print] T[retract]
|
||||||
|
file.write_format("M204 " + "S%d T%d ; sets acceleration (S) and retract acceleration (R), mm/sec^2\n",
|
||||||
|
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||||
|
int(print.config().machine_max_acceleration_retracting.values.front() + 0.5));
|
||||||
|
else if (flavor == gcfMarlinFirmware)
|
||||||
|
// New Marlin uses M204 P[print] R[retract] T[travel]
|
||||||
|
file.write_format("M204 " + "P%d R%d T%d ; sets acceleration (P, T) and retract acceleration (R), mm/sec^2\n",
|
||||||
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||||
int(print.config().machine_max_acceleration_retracting.values.front() + 0.5),
|
int(print.config().machine_max_acceleration_retracting.values.front() + 0.5),
|
||||||
travel_acc);
|
int(print.config().machine_max_acceleration_travel.values.front() + 0.5));
|
||||||
|
else
|
||||||
|
assert(false);
|
||||||
|
|
||||||
assert(is_decimal_separator_point());
|
assert(is_decimal_separator_point());
|
||||||
file.write_format(flavor == gcfRepRapFirmware
|
file.write_format(flavor == gcfRepRapFirmware
|
||||||
|
|
|
@ -1803,9 +1803,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
def = this->add("machine_max_acceleration_extruding", coFloats);
|
def = this->add("machine_max_acceleration_extruding", coFloats);
|
||||||
def->full_label = L("Maximum acceleration when extruding");
|
def->full_label = L("Maximum acceleration when extruding");
|
||||||
def->category = L("Machine limits");
|
def->category = L("Machine limits");
|
||||||
def->tooltip = L("Maximum acceleration when extruding (M204 P)\n\n"
|
def->tooltip = L("Maximum acceleration when extruding");
|
||||||
"Marlin (legacy) firmware flavor will use this also "
|
|
||||||
"as travel acceleration (M204 T).");
|
|
||||||
def->sidetext = L("mm/s²");
|
def->sidetext = L("mm/s²");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
|
@ -1816,7 +1814,8 @@ void PrintConfigDef::init_fff_params()
|
||||||
def = this->add("machine_max_acceleration_retracting", coFloats);
|
def = this->add("machine_max_acceleration_retracting", coFloats);
|
||||||
def->full_label = L("Maximum acceleration when retracting");
|
def->full_label = L("Maximum acceleration when retracting");
|
||||||
def->category = L("Machine limits");
|
def->category = L("Machine limits");
|
||||||
def->tooltip = L("Maximum acceleration when retracting (M204 R)");
|
def->tooltip = L("Maximum acceleration when retracting.\n\n"
|
||||||
|
"Not used for RepRapFirmware, which does not support it.");
|
||||||
def->sidetext = L("mm/s²");
|
def->sidetext = L("mm/s²");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
|
@ -1826,7 +1825,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
def = this->add("machine_max_acceleration_travel", coFloats);
|
def = this->add("machine_max_acceleration_travel", coFloats);
|
||||||
def->full_label = L("Maximum acceleration for travel moves");
|
def->full_label = L("Maximum acceleration for travel moves");
|
||||||
def->category = L("Machine limits");
|
def->category = L("Machine limits");
|
||||||
def->tooltip = L("Maximum acceleration for travel moves (M204 T)");
|
def->tooltip = L("Maximum acceleration for travel moves.");
|
||||||
def->sidetext = L("mm/s²");
|
def->sidetext = L("mm/s²");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
|
|
Loading…
Add table
Reference in a new issue