Skip to content

Commit

Permalink
velocity: Remove M204 override and associated option
Browse files Browse the repository at this point in the history
  • Loading branch information
jschuh committed Jun 13, 2023
1 parent de78289 commit cf2c3f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 31 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,7 @@ related commands, such as accelleration, jerk, and linear advance.
#### Marlin Compatibility

* The `M201`, `M203`, `M204`, and `M205` commands are implemented by calling
Klipper's `SET_VELOCITY_LIMIT` command. For calls that set the `ACCEL`
parameter, the `ACCEL_TO_DECEL` parameter is also set and scaled by
`variable_velocity_decel_scale` *(default: `0.5`)*.
Klipper's `SET_VELOCITY_LIMIT` command.
* The `M900` command is implemented by calling Klipper's `SET_PRESSURE_ADVANCE`
command. The `K` factor is scaled by `variable_pressure_advance_scale`
*(default: `-1.0`)*. If the scaling value is negative the `M900` command has no
Expand Down
8 changes: 5 additions & 3 deletions globals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ variable_start_z_tilt_adjust_at_temp: True
variable_travel_speed_xy: 3000
# Z travel speed in (mm/m) for movement macros.
variable_travel_speed_z: 600
# Value to scale acceleration by when setting ACCEL_TO_DECEL in M204, etc.
variable_velocity_decel_scale: 0.5
################################################################################
description: Initializes our globals, including any _km_options overrides.
gcode:
Expand Down Expand Up @@ -124,7 +122,11 @@ gcode:
"can now be achieved by inserting custom gcode before the "
"_PRINT_START_PHASE_PURGE line in your slicer's start gcode, or by "
"wrapping the _PRINT_START_PHASE_PURGE macro. See the Slicer "
"Configuration section in the readme for more information."
"Configuration section in the readme for more information.",
"velocity_decel_scale" :
"The velocity_decel_scale option has been removed. Klipper's input "
"shaping provides a superior mechanism for improving print quality "
"at higher speeds.",
} %}
{% set output = [] %}
{% for s in required_sections %}
Expand Down
25 changes: 0 additions & 25 deletions velocity.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ gcode:
{% set accel = (params.X|default(params.Y)|float,
params.Y|default(params.X)|float)|min %}
SET_GCODE_VARIABLE MACRO=m201 VARIABLE=max_accel VALUE="{accel}"
{% if accel < printer.toolhead.max_accel %}
SET_VELOCITY_LIMIT ACCEL="{accel
}" ACCEL_TO_DECEL="{accel * km.velocity_decel_scale}"
{% endif %}
{% else %}
SET_VELOCITY_LIMIT
{% endif %}
Expand All @@ -32,27 +28,6 @@ gcode:
SET_VELOCITY_LIMIT
{% endif %}

[gcode_macro m204]
description: Sets maximum accelleration.
Usage: M204 [S<accel>] [P<accel> T<accel>]
rename_existing: M204.6245197
gcode:
{% set km = printer["gcode_macro _km_globals"] %}
{% set max_accel = printer["gcode_macro m201"].max_accel %}
{% set accel = 0.0 %}
{% if 'S' in params %}
{% set accel = (params.S|float, max_accel)|min %}
{% elif 'P' in params %}
{% set accel = (params.P|float, params.T|default(params.P)|float,
max_accel)|min %}
{% endif %}
{% if accel %}
SET_VELOCITY_LIMIT ACCEL="{accel
}" ACCEL_TO_DECEL="{accel * km.velocity_decel_scale}"
{% else %}
SET_VELOCITY_LIMIT
{% endif %}

[gcode_macro m205]
description: Sets square corner velocity.
Usage: M203 [X<velocity>] [Y<velocity>]
Expand Down

0 comments on commit cf2c3f1

Please sign in to comment.