Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move out of range on first layer #83

Closed
CobreDev opened this issue Dec 12, 2022 · 15 comments
Closed

Move out of range on first layer #83

CobreDev opened this issue Dec 12, 2022 · 15 comments
Assignees
Labels
question Further information is requested

Comments

@CobreDev
Copy link

Whenever I start a print, I have to remove the first instance of TIMELAPSE_TAKE_FRAME or else I get this error:
!! Move out of range: -0.013 -0.013 0.285 [355.142]

I'm not sure what's causing it. The timelapse park position is set to Center.

@zellneralex zellneralex added the question Further information is requested label Dec 16, 2022
@zellneralex
Copy link
Member

Move out of Range is in 99% a problem with absolute/relative (G90/G91) move settings. I am a little suprised as we insure in https://github.com/mainsail-crew/moonraker-timelapse/blob/main/klipper_macro/timelapse.cfg#L275 that we are in absolute before we execute the park move.

Please slice e.g. a small cube with your slicer and provide the generated gcode. I would also need a klippy.log so that I see all your macros.

@CobreDev
Copy link
Author

I figured it was something related to absolute/relative, but wasn't sure.

Here's a 20mm x 20mm cube sliced in SuperSlicer. Right now I have TIMELAPSE_TAKE_FRAME inserting after a layer change, but it errors no matter if it's inserted before or after.
https://pastes.io/0auz0yut4a

Here's my klippy.log:
https://pastes.io/nhtb1mzwfa

Let me know if you need anything else!

@zellneralex
Copy link
Member

zellneralex commented Dec 16, 2022

That looks all ok, could you add

[gcode_macro DUMP_PRINT_AREA_LIMITS]
description: Debug: Print information about print volume and probeable area
gcode:
  {% set min = printer.toolhead.axis_minimum %}
  {% set max = printer.toolhead.axis_maximum %}
  {% set cfg = printer.configfile.settings %}
  {% set probe_offset = {'x' : cfg.probe.x_offset   if 'probe'   in cfg
                          else cfg.bltouch.x_offset if 'bltouch' in cfg
                          else 0,
                         'y' : cfg.probe.y_offset   if 'probe'   in cfg
                          else cfg.bltouch.y_offset if 'bltouch' in cfg
                          else 0} %}
  {% set probe_area = {'min' : {'x' : [min.x,(min.x-probe_offset.x)]|max,
                                'y' : [min.y,(min.y-probe_offset.y)]|max},
                       'max' : {'x' : [max.x,(max.x-probe_offset.x)]|min,
                                'y' : [max.y,(max.y-probe_offset.y)]|min}} %}
  {action_respond_info("Print Volume Limits:
                        Min X:%7.1f, Y:%7.1f, Z:%7.1f
                        Max X:%7.1f, Y:%7.1f, Z:%7.1f
                        Probe Area Limits:
                        Min X:%7.1f, Y:%7.1f
                        Max X:%7.1f, Y:%7.1f" % 
    (min.x,min.y,min.z,max.x,max.y,max.z,probe_area.min.x,probe_area.min.y,probe_area.max.x,probe_area.max.y))}

and run it in the console and send the result.
after get run GET_TIMELAPSE_SETUP and also post that result.

@CobreDev
Copy link
Author

Here you go:
https://pastes.io/7fl2prpx4y

I'm really struggling to figure out what's going on here!

@zellneralex
Copy link
Member

Please also GET_TIMELAPSE_SETUP

@CobreDev
Copy link
Author

https://pastes.io/nhhxxebex9

On line 7m, what does the dz:1 mean?

@zellneralex
Copy link
Member

zellneralex commented Dec 17, 2022

dz means delta z, on z we only lift the nozzle by that value.
That looks also ok. It detects your center and all looks normal.

Next I will modify your gcode, to add a few console outputs. Then we can see where the error really happens.
I will post that here sometime today.

@zellneralex
Copy link
Member

OK please add the following macro to your printer.cfg:

##  Use: DUMP_TO_CONSOLE MSG="QGL forced by PRINT_START"
[gcode_macro DUMP_TO_CONSOLE]
description: Helper: Action response
gcode: {action_respond_info(params.MSG)}

It simple sends the text to the console.

I used your gcode file and added some printouts:
Test_Cube.zip
Download & unzip it and then print it. You can cancle the print after you see "After TIMELAPSE_TAKE_FRAME" in the console (first picture). Please send the console output so that I get a better understanding where the move out of range really happens.

Before you print the file I recommend that you open it and confirm that I did not do anything harmful. (You will find 6 DUMP_TO_CONSOLE comands in the first 110 lines). That is something I always recomand if someone ask you to print a pre sliced file.

@CobreDev
Copy link
Author

https://pastes.io/dbvrugpppz

Here's the output!

@zellneralex
Copy link
Member

zellneralex commented Dec 19, 2022

Are you really sure that that is the output? I see that you open a other file in the middle of the print

// Set and Wait for Temps
17 $ SDCARD_PRINT_FILE FILENAME="Printer Tuning/Voron Cube 220deg.gcode"
18 // Set z hight for first layer
19 File opened:Printer Tuning/Voron Cube 220deg.gcode Size:4424359
20 // Before TIMELAPSE_TAKE_FRAME

This should never be in there.

@zellneralex
Copy link
Member

zellneralex commented Dec 19, 2022

I also do not understand

$ get_timelapse_setup

I checked the Klippy.log and also the Goode file and both do not call it. So did you execute that manual?

@CobreDev
Copy link
Author

Weird, I missed that. I must've copied some old logs too or something, my bad!

Here's a new version:
https://pastes.io/bq0ttdaizx

@zellneralex
Copy link
Member

zellneralex commented Dec 19, 2022

Ok that makes a lot more sense. It’s really looking like that the error happens in TIMELAPSE_TAKE_FRAME.

I will prepare a TIMELAPSE_TAKE_FRAME macro with debug prints so that we get a better understanding. That might take 1 or 2 days.

Sorry that the process is so slow but I can not reproduce it on my machine’s here

@zellneralex
Copy link
Member

zellneralex commented Dec 19, 2022

Wait a moment.

$ SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=takingframe VALUE=False

Is the answer of the Timelapse plugin after the shoot is done. That means the error happens at RESUME.
I also see that you home to 0:0 and only move the head a little bit up.
We have seen rounding errors with homing in the past (where no-one is sure why that happens)

Could you do one more test:
Replace your START_PRINT with the following

[gcode_macro START_PRINT]
gcode:
    {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
    {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
    M140 S{BED_TEMP}
    G90
    SET_GCODE_OFFSET Z=0
    G28
    G1 X1 Y1 Z5 F3000
    M190 S{BED_TEMP}
    M109 S{EXTRUDER_TEMP}
    M117 Printing

This will move the head away from the edge and insures that the resume point is within the bed.
Please try the print again.

@CobreDev
Copy link
Author

Ok interesting, that seems to have fixed it. Thank you for finding that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants