New to Klipper and have a Move out of range error when printing (Ender 5Pro)

After the recommendation of @Ender5r , I have set up Klipper with my Ender 5Pro with CR-Touch and 4.2.2 board. I thought I had the config file correct. I can get the printer to move in all axis and even build a bed mesh with the CR-Touch. I edited the Printer G-Code in Cura to just use the START_PRINT and END_PRINT macros in the Klipper printer config.

Every time I try to print I get a move error shortly after the print starts laying down filament. The error always has a -0.005 in the Z-Axis. i.e. !! Move out of range: 195.999 184.400 -0.005 [10.820]

I have the offsets for the CR-Touch set and used the PROBE_CALIBRATION command in Klipper.

I attached my printer.cfg file to this post if anyone can give me some pointers as to what might be causing my move errors.

I’m using Klipper with Fluidd.

Thanks in advance.

printer.txt (6.68 KB)

Funny, I was just reading about something like this. Mine had to do with X/Y movement, but it may be the same issue. What I found is G90 and G91 gcode commands. Apparently, many systems default to G91, which is Relative Positioning. This can cause issues sometimes, like “out of range” errors. You could try editing the gcode file (you can do it directly from the Jobs window of the fluidd Dashboard) and adding a G90 command near the top of the file. That should put the printer into Absolute Positioning mode. See if it helps. If it does, you can add it to the Start Code in your slicer so it will be part of every gcode file.

Now, I’m not absolutely positive about this, but I have seen evidence that each profile in Cura has its own Start and End codes sections, so you may have to add a G90 to every profile (if you’re using Cura).

I am using Cura and it does have the start and end gcode in the printer profiles. Luckily I am only using one printer. To avoid needing to update the Cura profiles, I am using the macro function of Klipper for the start and end gcode and then calling those macros in Cura. I am using the default START_PRINT macro the Klipper has listed in the documentation.

[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}

Start bed heating

M140 S{BED_TEMP}

Use absolute coordinates

G90

Reset the G-Code Z offset (adjust Z offset if needed)

SET_GCODE_OFFSET Z=0.0

Home the printer

G28

Move the nozzle near the bed

G1 Z5 F3000

Move the nozzle very close to the bed

G1 Z0.15 F300

Wait for bed to reach temperature

M190 S{BED_TEMP}

Set and wait for nozzle to reach temperature

M109 S{EXTRUDER_TEMP}

It does have the G90 code in it, which was a surprise to me. I didn’t read the macro close enough.

Looking at the gcode file that I am trying to print, I see the START_PRINT macro called out. I am also seeing minimum values for the print area at the beginning of the file.

;FLAVOR:Marlin
;TIME:554
;Filament used: 0.41211m
;Layer height: 0.2
;MINX:24
;MINY:24
;MINZ:0.2
;MAXX:196
;MAXY:196
;MAXZ:1
;Generated with Cura_SteamEngine 4.12.1
M140 S50
M105
M190 S50
M104 S200
M105
M109 S200
M82 ;absolute extrusion mode
START_PRINT
G92 E0
G92 E0
G1 F2700 E-5
;LAYER_COUNT:5
;LAYER:0
M107
G0 F6000 X27.198 Y27.264 Z0.2
;TYPE:SKIRT

Could those values be what’s causing issues? The printer profile I am using was made from the Ender 5 profile already in Cura. Cura would not let me manually change some of those values in the printer profile. I will have to mess with it again to remember which ones I could not edit.

You are ahead of me my friend. I have not yet moved to using macros in printer.cfg to issue gcode start commands, but it is on my todo list.

OK, the MINX and related commands at the beginning of the 2nd file are commented out. They will have zero effect on the print job. A ‘;’ tells the parser to ignore anything coming after it, until the end of that line.

You could get rid of the redundant G92 E0 near the bottom of the 2nd code segment.

Now, on to your actual question. I have to answer by asking, “exactly which values do you think might be causing issues”?

I was asking about the Min Max values in the gcode sample. Since they are commented out, then those are not causing my issues.

I was trying to macros in the printer config file, but I don’t think they are working correctly. The last two times I have tried to print something, the printer has done G28 and then not moved at all. So I will be going back to adding the start gcode to Cura.

I believe you were using an Ender 5Pro. Would you be able to let me know what you use for starting gcode in your slicer? That might let me troubleshoot the move issues.

Thanks.

Before you go back to Cura Start gcode, check the console window in fluidd. Very often, errors are reported there.

No errors were shown in the console. It just stops doing anything after G28, when starting a print. It is very odd that no errors are shown.

If you post the file, I’ll try to print it.

Thanks. The gcode is attached to this message.

CE5_DrVax_2_Box_Calibration_Model.gcode.txt (21.5 KB)

Try changing this line

G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line

to this

G1 X10.4 Y20 Z0.28 F1500.0 E15 ;Draw the second line

see if you get the same error and if so did the number change?

Thanks for the reply. I changed the code you indicated. No difference in the Move Error. The printer never finishes the first line of the extruder reset.

Before change - !! Move out of range: 10.100 170.000 -0.021
After change - !! Move out of range: 10.100 170.000 -0.021

After looking at the error a bit more, I think it might be trying to move the bed up (negative) instead of down (positive). (Ender 5 moved the bed for Z Axis instead of moving the print head up.)

When controlling the Z-Axis manually, it moves in the correct direction, so I’m a bit at a loss.

I believe I found the issue. I did not have a position_min setting in the printer.cfg. I added that setting and put a value of -.05 in it. The next Move error I received was:

!! Move out of range: 10.100 180.000 -0.055

I decided to put in the offset value for the CR-Touch which was -1.2 and now I am printing. So far so good. I will try something more complicated to print and report back.

Thanks for all the help and suggestions. Fingers crossed.

At least your making progress

Great work @Corley. It should just be a matter of fine tuning now.

Thanks. Just started the second print and everything looks good so far.

This post on Klipper’s GitHub pointed me in the correct direction: Move out of range · Issue #1024 · Klipper3d/klipper · GitHub

I’m starting to wonder if my Z-Offset for the CR-Touch is not actually applied to the settings when I did the calibration mesh. It was added automatically to the “Do Not Edit” section of the printer config when I saved the mesh. Z-Offset is commented out the BLTouch section. I’m thinking testing that after this print.

Thanks again everyone.

No need to test it. The setting in the BLTouch section is supposed to be commented out. Do NOT delete it. That will generate errors (Klipper expects to see the commented out line).

The Z Offset setting is being applied. Klipper reads it from the ==== SAVE_CONFIG === section.

You CAN edit the Z Offset line in ==== SAVE_CONFIG ===. Just be careful to not delete or add any lines in the section; just edit existing lines. Have a look at this post: http://forum.makewithtech.com/forum…2717#post12717. The main point is that you increase the Z Offset value to lower the nozzle, which seems counter-intuitive, but it is what it is.

Finally, look at this post: [U]Klipper anyone? - MakeWithTech Community Forum. Download the attached files and print them. Print the 0.24mm square 1st. Get it good, then move on to the 0.20, 0.16, and 0.12. Fine tune the Z Offset with each successive square. Check out the basic process in this video: [U]Best method for 3D printer bed levelling - YouTube. However, before you print any of the squares you should use the SCREWS_TILT_CALCULATE option on the fluidd Dashboard to ensure the bed is properly trammed (levelled).