Error on 'SET_VELOCITY_LIMIT ACCEL_TO_DECEL=': unable to parse

Printer Model: Voron Trident
MCU / Printerboard: M8P

klicky-macros.cfg (43.8 KB)

printer.cfg (21.7 KB)

klippy.log (1.8 MB)

Error on ‘SET_VELOCITY_LIMIT ACCEL_TO_DECEL=’: unable to parse

So took a break from printing for a while, on returning, did some updates.
Now, I get the following error message:

Error on ‘SET_VELOCITY_LIMIT ACCEL_TO_DECEL=’: unable to parse

I see that Klipper-macros has the lines:

M400
SET_VELOCITY_LIMIT ACCEL={printer.configfile.settings.printer.max_accel}
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
RESTORE_GCODE_STATE NAME={function} MOVE={move} MOVE_SPEED={speed}

Is it trying to find
SET_VELOCITY_LIMIT ACCEL_TO_DECEL=
in printer.cfg ?

I could revert the cfg files to a previous backup but would like to resolve this is anyone can help.

Thanks, Dan.,

See the latest changes from 20240313:
https://www.klipper3d.org/Config_Changes.html#changes

As the parameter ACCEL_TO_DECEL has been deprecated along with max_accel_to_decel the respective commands for setting those are obsolete now.

You should now use: minimum_cruise_ratio
And look here for reference on the new set functions:
https://www.klipper3d.org/G-Codes.html?h=minimum_cruise_ratio#set_velocity_limit

2 Likes

You are running a non genuine Klipper version:

Git version: 'v0.12.0-125-gbfb71bc2-dirty'

For we don’t know what is changed, it’s recommended to try again with a clean Klipper version.

Thank you,

Seems I need to wait for Klipper to catch up the updates.
Set manual limits in the meantime which works.

Regards

Dan

Hi

Thanks. Seems Klicky hasn’t caught up with the changes. Manual speed solved problem in meantime.

Regards

Dan

Klipper is quite up to date!
You have to adapt your macros where those commands are involved.

Klicky I mean

Anyone have the correct entry I need to update Klicky Probe cfg?

The problem was…
M400
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}

I’ve changed it to manually set the speed, which solved the problem:.
SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2000

Thankls

Be careful as you cannot simply replace max_accel_to_decel by min_cruise_ratio.

To convert from one to the other:

min\_cruise\_ratio = 1 - \frac{max\_accel\_to\_decel}{max\_accel}
1 Like

Thanks, will give it a go.

So it was:
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}

Now it should be?:
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer.configfile.settings.printer.min_cruise_ratio = 1 - \frac{max_accel_to_decel}{max_accel}}

Or?:
SET_VELOCITY_LIMIT ACCEL_TO_DECEL= 1 - \frac{max_accel_to_decel}{max_accel}

The new variable is
printer.toolhead.minimum_cruise_ratio

I would suggest not to mess with this macro and wait until the original author updates it.
Personally, I will not invest my time to sift through this macro and find the places where an adaption is needed.

Hi Folks, hi @Hypoxic01
Have had the same Problem today, here is the solution:

You’ve only to copy the “klicky-macros.cfg” and all works as usual.

Regards

3 Likes

Thank you. Klippy-macro.cfg updated and working great!

1 Like

Thank you! This saved me a lot of debug time! worked great.

New here, but I edited the TEST_SPEED macro and it’s working.

# NOTE Find how to use instructions here: https://ellis3dp.com/Print-Tuning-Guide/articles/determining_max_speeds_accels.html
# Home, get position, throw around toolhead, home again.
# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured.
# We only measure to a full step to accomodate for endstop variance.
# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10

[gcode_macro TEST_SPEED]
gcode:
    # Speed
    {% set speed  = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %}
    # Iterations
    {% set iterations = params.ITERATIONS|default(5)|int %}
    # Acceleration
    {% set accel  = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %}
    # Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions)
    {% set bound = params.BOUND|default(20)|int %}
    # Size for small pattern box
    {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %}
    
    # Large pattern
        # Max positions, inset by BOUND
        {% set x_min = printer.toolhead.axis_minimum.x + bound %}
        {% set x_max = printer.toolhead.axis_maximum.x - bound %}
        {% set y_min = printer.toolhead.axis_minimum.y + bound %}
        {% set y_max = printer.toolhead.axis_maximum.y - bound %}
    
    # Small pattern at center
        # Find X/Y center point
        {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %}
        {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %}
        
        # Set small pattern box around center point
        {% set x_center_min = x_center - (smallpatternsize/2) %}
        {% set x_center_max = x_center + (smallpatternsize/2) %}
        {% set y_center_min = y_center - (smallpatternsize/2) %}
        {% set y_center_max = y_center + (smallpatternsize/2) %}

    # Save current gcode state (absolute/relative, etc)
    SAVE_GCODE_STATE NAME=TEST_SPEED
    
    # Output parameters to g-code terminal
    { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) }
    
    # Home and get position for comparison later:
        M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
        G28
        # QGL if not already QGLd (only if QGL section exists in config)
        {% if printer.configfile.settings.quad_gantry_level %}
            {% if printer.quad_gantry_level.applied == False %}
                QUAD_GANTRY_LEVEL
                G28 Z
            {% endif %}
        {% endif %} 
        # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24)
        G90
        G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60}
        M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
        G28 X Y
        G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
        G4 P1000 
        GET_POSITION

    # Go to starting position
    G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60}

    # Set new limits
    #SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2}
    SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} MINIMUM_CRUISE_RATIO={0.5}

    {% for i in range(iterations) %}
        # Large pattern diagonals
        G0 X{x_min} Y{y_min} F{speed*60}
        G0 X{x_max} Y{y_max} F{speed*60}
        G0 X{x_min} Y{y_min} F{speed*60}
        G0 X{x_max} Y{y_min} F{speed*60}
        G0 X{x_min} Y{y_max} F{speed*60}
        G0 X{x_max} Y{y_min} F{speed*60}
        
        # Large pattern box
        G0 X{x_min} Y{y_min} F{speed*60}
        G0 X{x_min} Y{y_max} F{speed*60}
        G0 X{x_max} Y{y_max} F{speed*60}
        G0 X{x_max} Y{y_min} F{speed*60}
        
        # Small pattern diagonals
        G0 X{x_center_min} Y{y_center_min} F{speed*60}
        G0 X{x_center_max} Y{y_center_max} F{speed*60}
        G0 X{x_center_min} Y{y_center_min} F{speed*60}
        G0 X{x_center_max} Y{y_center_min} F{speed*60}
        G0 X{x_center_min} Y{y_center_max} F{speed*60}
        G0 X{x_center_max} Y{y_center_min} F{speed*60}
        
        # Small patternbox
        G0 X{x_center_min} Y{y_center_min} F{speed*60}
        G0 X{x_center_min} Y{y_center_max} F{speed*60}
        G0 X{x_center_max} Y{y_center_max} F{speed*60}
        G0 X{x_center_max} Y{y_center_min} F{speed*60}
    {% endfor %}

    # Restore max speed/accel/accel_to_decel to their configured values
    #SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
    SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} MINIMUM_CRUISE_RATIO={printer.configfile.settings.printer.minimum_cruise_ratio}

    # Re-home and get position again for comparison:
        M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
        G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12
        # Go to XY home positions (in case your homing override leaves it elsewhere)
        G90
        G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
        G4 P1000 
        GET_POSITION

    # Restore previous gcode state (absolute/relative, etc)
    RESTORE_GCODE_STATE NAME=TEST_SPEED