Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Cura Script to Automatically Probe Only Printed Area

    Scheduled Pinned Locked Moved
    General Discussion
    15
    60
    7.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • tcjundefined
      tcj @zapta
      last edited by

      @zapta could you please change the script that it can handle negative coordinates in --meshable ?
      This will make it usable for Delta printers, because
      "For Cartesian printers, specify minimum and maximum X and Y values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. "
      https://duet3d.dozuki.com/Wiki/Gcode#Section_M557_Set_Z_probe_point_or_define_probing_grid

      Thank you

      zaptaundefined 1 Reply Last reply Reply Quote 1
      • zaptaundefined
        zapta @tcj
        last edited by

        @tcj, I made the change. Can you give it another try?

        https://github.com/zapta/misc/tree/master/duet3d_automesh

        tcjundefined 1 Reply Last reply Reply Quote 0
        • tcjundefined
          tcj @zapta
          last edited by tcj

          @zapta thank you for the effort, but ist does not work yet
          only defining the default meshable area within the script (line 50) by

          default="-185:185,-185:185"
          

          works,
          but when adding

          <path to your python3> <path_to_the_duet3d_automesh.py file> --meshable "-185:185,-185:185"
          

          to the Post-processing script, it fails

          zaptaundefined 1 Reply Last reply Reply Quote 1
          • zaptaundefined
            zapta @tcj
            last edited by

            @tcj, try this syntax for the flags (notice the '=')

            --meshable=-30:250,-3:280

            tcjundefined 1 Reply Last reply Reply Quote 1
            • tcjundefined
              tcj @zapta
              last edited by

              @zapta 👍 👏

              Thank you

              1 Reply Last reply Reply Quote 0
              • DK90undefined
                DK90
                last edited by DK90

                @zapta said in Cura Script to Automatically Probe Only Printed Area:

                --meshable=-30:250,-3:280

                Hello, i have the following error when i am trying to ad the postprocess
                can some one help me please?

                Thanks

                Post-processing script C:\Users\Dominic\AppData\Local\Programs\Python\Python36-32\python.exe C:\Program Files\Prusa3D\PrusaSlicer\duet3d_automesh.py file on file D:\2_Projekte\3D Druck\2_Modelle\28_R2D2_Did3D\R2D2_Did3D_SW_FullPack_h\STL_Final\zumdruckenbereit\Cube_PLA_Center foot_0.2mm_PET_2h24m.gcode failed.
                Error code: 2
                ```~~~~
                tcjundefined 1 Reply Last reply Reply Quote 0
                • tcjundefined
                  tcj @DK90
                  last edited by

                  @DK90 the space in "Program Files" leads to this error
                  change it to

                  C:\Users\Dominic\AppData\Local\Programs\Python\Python36-32\python.exe "C:\Program Files\Prusa3D\PrusaSlicer\duet3d_automesh.py"
                  

                  notice the "

                  DK90undefined 1 Reply Last reply Reply Quote 1
                  • DK90undefined
                    DK90 @tcj
                    last edited by DK90

                    @tcj said in Cura Script to Automatically Probe Only Printed Area:

                    C:\Users\Dominic\AppData\Local\Programs\Python\Python36-32\python.exe "C:\Program Files\Prusa3D\PrusaSlicer\duet3d_automesh.py"

                    Oh 🙂 thank you now ot works 🙂
                    but wehn i start the print, there is now mesh leveling ....
                    where is my error?

                    Start G-Code

                    M83  ; extruder relative mode
                    M140 S[first_layer_bed_temperature] ; set bed temp
                    
                    M190 S[first_layer_bed_temperature] ; wait for bed temp
                    
                    
                    
                    ; For automesh
                         M557 TBD  ; parameters will be set automatically
                         G28  ;home
                         ;G29 S1 P"heightmap.csv"; Hoehenkarte Laden
                    
                    M109 S[first_layer_temperature] ; wait for extruder temp
                    ;G29 S1 P"heightmap.csv"; Hoehenkarte Laden
                    
                    
                    ; Reinigungs Fahrt
                    G1 X-3.0 Y-10 F1500.0 ; go outside print area
                    G92 E0.0
                    G1 Z0
                    G1 E8 ; Purge Bubble
                    G1 X60.0 E9.0  F1000.0 ; intro line
                    G1 X100.0 E12.5  F1000.0 ; intro line
                    G92 E0.0
                    

                    G-Code layer change setting

                    ; Automesh: begin layer [layer_num]
                    
                    tcjundefined 1 Reply Last reply Reply Quote 0
                    • tcjundefined
                      tcj @DK90
                      last edited by tcj

                      @DK90 said in Cura Script to Automatically Probe Only Printed Area:

                      but wehn i start the print, there is now mesh leveling ....

                      and it never will without G29 😉

                      this is a part of my start sequence

                      M140 S[first_layer_bed_temperature]
                      M104 S[first_layer_temperature]
                      M116; wait for temperatures to be reached
                       
                      ; For automesh
                      M557 TBD  ; parameters will be set automatically
                      G28 ; home
                      G29 ; mesh
                      
                      1 Reply Last reply Reply Quote 0
                      • DK90undefined
                        DK90
                        last edited by

                        oh 😄 yes that sounds good....that was my mistake...:D Thank you

                        zaptaundefined 1 Reply Last reply Reply Quote 0
                        • zaptaundefined
                          zapta @DK90
                          last edited by

                          @DK90, if you use panel due and prusaslicer (and maybe cura, didn't try), try to enable Support Remaining Time in the Printer Settings | General, tab. This will include M73 time markers in the gcode that which cause the post processing script to show remaining hours and minutes in the Standby fields of Panel Duet (ignore the '-' prefix).

                          This time estimation is much more consistent than the ones provided by Duet.

                          DK90undefined 1 Reply Last reply Reply Quote 1
                          • DK90undefined
                            DK90 @zapta
                            last edited by

                            @zapta Thank you for the info. I will try it. That sound good.

                            1 Reply Last reply Reply Quote 0
                            • tcjundefined
                              tcj
                              last edited by tcj

                              @zapta I'm sorry to say that, but it does not work properly yet.
                              The script gives

                              M557 X-10:32 Y-10:32 P3:3
                              

                              where it should deliver

                              M557 X-32:32 Y-32:32 P3:3
                              

                              for a testcube in the middle of the bed with some mm of skirt

                              total dimensions +/- 21.xx mm

                              OwenDundefined zaptaundefined 2 Replies Last reply Reply Quote 0
                              • OwenDundefined
                                OwenD @tcj
                                last edited by

                                @tcj what are your probe offsets?

                                1 Reply Last reply Reply Quote 0
                                • CCS86undefined
                                  CCS86
                                  last edited by

                                  Probe offsets wouldn't matter.

                                  Posting the gcode would be helpful though.

                                  1 Reply Last reply Reply Quote 0
                                  • zaptaundefined
                                    zapta @tcj
                                    last edited by

                                    @tcj, try to run the script manually and see what it prints. To do that, run it from command line with the same arguments you have in the slicer and also add the name of the gcode file at the end of the command line.

                                    When I run it I get prints like this

                                    MESHABLE area: 30.0:280.0,30.0:280.0
                                    Opening gcode file: /var/folders/dt/1t1sf6d574d3l023pknh_754000cbj/T/.PrusaSlicer.upload.7e0e-12b6-1a76-0282
                                    Read 83648 lines
                                    Parsing state = ParsingState.WAITING_FOR_LAYER1
                                    ;Automesh: begin layer 0
                                    Parsing state = ParsingState.IN_LAYER1
                                    ;Automesh: begin layer 1
                                    Parsing state = ParsingState.LAYER1_DONE
                                    First layer print areas: 92:189,131:210
                                    printArea: 92:189,131:210
                                    Will use 4 x 3 mesh points
                                    Marker: M557 TBD  ; marker for automesh script
                                    Inserted: M557 X82:199 Y121:220 P4:3
                                    

                                    (if you prefer, post your gcode file and command line parameters and I can test it here)

                                    1 Reply Last reply Reply Quote 0
                                    • tcjundefined
                                      tcj
                                      last edited by

                                      C:\Users\tcj-a>C:\Users\tcj-a\AppData\Local\Programs\Python\Python38-32\python.exe C:\Users\tcj-a\Documents\scripts\duet3d_automesh.py C:\Users\tcj-a\Desktop\single_wall_box.gcode --meshable=-185:185,-185:185
                                      MESHABLE area: -185.0:185.0,-185.0:185.0
                                      Opening gcode file: C:\Users\tcj-a\Desktop\single_wall_box.gcode
                                      Read 7472 lines
                                      Parsing state = ParsingState.WAITING_FOR_LAYER1
                                      ; Automesh: begin layer 0
                                      Parsing state = ParsingState.IN_LAYER1
                                      ; Automesh: begin layer 1
                                      Parsing state = ParsingState.LAYER1_DONE
                                      First layer print areas: 0:22,12:22
                                      printArea: 0:22,12:22
                                      Will use 3 x 3 mesh points
                                      Marker: M557 TBD  ; parameters will be set automatically
                                      Inserted: M557 X-10:32 Y2:32 P3:3
                                      

                                      single_wall_box.gcode

                                      obviously the script does not handle negative numbers as needed, because the first layer print area is -22:-22, 22:22

                                      zaptaundefined 1 Reply Last reply Reply Quote 0
                                      • zaptaundefined
                                        zapta @tcj
                                        last edited by zapta

                                        @tcj, thanks for the example and for your patient.

                                        I made a fix and am now getting the output below. The problem existed in the original code posted in this thread, parsing only non negative x and y values.

                                        MESHABLE area: -100.0:100.0,-100.0:100.0
                                        Opening gcode file: single_wall_box.gcode
                                        Read 7472 lines
                                        Parsing state = ParsingState.WAITING_FOR_LAYER1
                                        ; Automesh: begin layer 0
                                        Parsing state = ParsingState.IN_LAYER1
                                        ; Automesh: begin layer 1
                                        Parsing state = ParsingState.LAYER1_DONE
                                        First layer print areas: -22:22,-22:22
                                        printArea: -22:22,-22:22
                                        Will use 3 x 3 mesh points
                                        Marker: M557 TBD  ; parameters will be set automatically
                                        Inserted: M557 X-32:32 Y-32:32 P3:3
                                        

                                        https://github.com/zapta/misc/blob/master/duet3d_automesh/duet3d_automesh.iml

                                        Baenwortundefined 1 Reply Last reply Reply Quote 1
                                        • tcjundefined
                                          tcj
                                          last edited by

                                          @zapta thank you

                                          1 Reply Last reply Reply Quote 1
                                          • Baenwortundefined
                                            Baenwort @zapta
                                            last edited by

                                            @zapta said in Cura Script to Automatically Probe Only Printed Area:

                                            @tcj, thanks for the example and for your patient.

                                            I made a fix and am now getting the output below. The problem existed in the original code posted in this thread, parsing only non negative x and y values.

                                            https://github.com/zapta/misc/blob/master/duet3d_automesh/duet3d_automesh.iml

                                            Does this bring it closer to working for Delta's? Or at least probing a square area of the circular bed?

                                            zaptaundefined tcjundefined 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA