ENH: add decel para

thanks SoftFever

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I95a1240c8d6ce7365055e840e526f279a55939e4
This commit is contained in:
qing.zhang 2023-06-16 19:42:43 +08:00 committed by Lane.Wei
parent 4b23192d6f
commit 346321379a
7 changed files with 47 additions and 2 deletions

View file

@ -175,6 +175,11 @@ std::string GCodeWriter::set_acceleration(unsigned int acceleration)
// This is new MarlinFirmware with separated print/retraction/travel acceleration.
// Use M204 P, we don't want to override travel acc by M204 S (which is deprecated anyway).
gcode << "M204 P" << acceleration;
} else if (FLAVOR_IS(gcfKlipper) && this->config.accel_to_decel_enable) {
gcode << "SET_VELOCITY_LIMIT ACCEL_TO_DECEL=" << acceleration * this->config.accel_to_decel_factor / 100;
if (GCodeWriter::full_gcode_comment) gcode << " ; adjust ACCEL_TO_DECEL";
gcode << "\nM204 S" << acceleration;
// Set max accel to decel to half of acceleration
} else {
// M204: Set default acceleration
gcode << "M204 S" << acceleration;