Option for klipper only: Adjustment of "accel_to_decel" (#220)

* Klipper option: Adjustment of "accel_to_decel"

Add option to automatically adjust accel_to_decel to 50% of chosen acceleration.

* allow variable accel_to_decel percentage

allow variable accel_to_decel percentage for klipper firmware
This commit is contained in:
Patrice Côté 2023-01-24 08:33:34 -05:00 committed by GitHub
parent cdd9c51949
commit bf782028ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 9 deletions

View file

@ -174,10 +174,15 @@ 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 {
// M204: Set default 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 max_accel_to_decel to chosen % of new accel value\n";
gcode << "M204 S" << acceleration;
}
// Set max accel to decel to half of acceleration
} else
gcode << "M204 S" << acceleration;
//BBS
if (GCodeWriter::full_gcode_comment) gcode << " ; adjust acceleration";
gcode << "\n";