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

Dockable Probe Configurator Macro

Scheduled Pinned Locked Moved
Gcode meta commands
4
20
994
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.
  • undefined
    mher @jay_s_uk
    last edited by 21 Nov 2022, 09:53

    @jay_s_uk I'll do some testing tonight and potentially change the script to output the results into the retract/deploy macros. Only thing I'm slightly worried about is that it'd be overwriting any settings someone already has in there. Then again that might be a good thing

    1 Reply Last reply Reply Quote 1
    • undefined
      mher @jay_s_uk
      last edited by 22 Nov 2022, 02:01

      @jay_s_uk as promised I looked into it and I've updated the script accordingly in the start post

      1 Reply Last reply Reply Quote 1
      • undefined
        izeman @mher
        last edited by izeman 29 Dec 2023, 21:59

        @mher Thanks for this great macro. I tried it, and most of it worked for me, but I don't see what type of probe it expects.
        I configured the Klicky as z-probe switch connected to z-endstop.
        I can pick it up, detach, attach etc, but after the final test is always says:

        M292 The probe wasnt detached, please start again
        

        This is M558:

        m558
        Z Probe 0: type 5, input pin zstop, output pin nil, dive height 5.0mm, probe speeds 120,120mm/min, travel speed 6000mm/min, recovery time 0.00 sec, heaters normal, max taps 1, max diff 0.03
        
        undefined 1 Reply Last reply 29 Dec 2023, 22:16 Reply Quote 0
        • undefined
          OwenD @izeman
          last edited by 29 Dec 2023, 22:16

          @izeman
          It looks to me like the two M564 commands are indented too far.
          Try aligning them with the "abort" commands

          undefined 1 Reply Last reply 29 Dec 2023, 22:24 Reply Quote 0
          • undefined
            izeman @OwenD
            last edited by 29 Dec 2023, 22:24

            @OwenD said in Dockable Probe Configurator Macro:

            @izeman
            It looks to me like the two M564 commands are indented too far.
            Try aligning them with the "abort" commands

            There's several M564: Line #14,30,48,53,60,76,81. Which ones do you mean?

            undefined 1 Reply Last reply 29 Dec 2023, 22:30 Reply Quote 0
            • undefined
              OwenD @izeman
              last edited by 29 Dec 2023, 22:30

              @izeman
              All the ones in the if conditions which precede an abort command

              if sensors.probes[0].value[0] = 1000
                  M291 P"Make sure the klicky probe is mounted on the toolhead" S3
                  if sensors.probes[0].value[0] = 1000
              		M564 H1	; Don't allow movement without homing
                      abort "The probe doesn't seem to be attached, please attach before starting the configuration again"
               
              

              Should be

              if sensors.probes[0].value[0] = 1000
                  M291 P"Make sure the klicky probe is mounted on the toolhead" S3
                  if sensors.probes[0].value[0] = 1000
              	M564 H1	; Don't allow movement without homing
                      abort "The probe doesn't seem to be attached, please attach before starting the configuration again"
               
              
              undefined 1 Reply Last reply 29 Dec 2023, 22:40 Reply Quote 0
              • undefined
                izeman @OwenD
                last edited by izeman 29 Dec 2023, 22:40

                @OwenD Thanks. It seems though that this was somehow auto-formated already. They all look like you said. Once you copy it here it changes the format?!

                bdb3adc9-388c-4f40-930d-c32e6203c3c3-image.png

                undefined 1 Reply Last reply 29 Dec 2023, 23:04 Reply Quote 0
                • undefined
                  izeman @izeman
                  last edited by izeman 29 Dec 2023, 23:04

                  Reconfigured the probe now - seems it was wrong somehow.

                  Now I get:

                  M292
                  Error: in file macro line 270 column 7: meta command: expected string expression
                  

                  ef05c268-54fe-414d-b1cb-4690fa7f590d-image.png

                  undefined 1 Reply Last reply 29 Dec 2023, 23:19 Reply Quote 0
                  • undefined
                    OwenD @izeman
                    last edited by OwenD 29 Dec 2023, 23:19

                    @izeman
                    The first warning is a it says.
                    Review Klicky.g with a text editor set to show spaces and tabs.
                    You can see tabs before the M564 and spaces everywhere else
                    tabls.png

                    The second error is in a much bigger file.
                    Either your print file, or maybe daemon.g
                    Shouldn't be many files longer than 270 lines.
                    It'll be something like an echo or other command that doesn't have a quoted string after it.

                    undefined 1 Reply Last reply 30 Dec 2023, 10:11 Reply Quote 0
                    • undefined
                      izeman @OwenD
                      last edited by izeman 30 Dec 2023, 10:11

                      @OwenD I will check the file with another editor. Thanks!

                      But for the error in macro line 270: There is no daemon.g anywhere on the SD-card, and I'm not printing anything. I'm just calling the macro to generate deployprobe.g and retractprobe.g.
                      This must be some internal file that's called?!

                      Got all the tabs removed now, and RRF doesn't complain anymore. Now everything runs fine, and in the end it throws this error:

                      M292
                      Error: in file macro line 490 column 7: meta command: expected string expression
                      

                      Same error, different location ... If I knew where to search for it ...

                      undefined 1 Reply Last reply 30 Dec 2023, 11:09 Reply Quote 0
                      • undefined
                        OwenD @izeman
                        last edited by OwenD 30 Dec 2023, 11:09

                        @izeman
                        I'm guessing the version of RRF and/or DWC you're using is miscounting the line feeds or carriage returns that your editor is using.

                        I think the actual error is caused because there were spaces in the file between "echo >" and the filename

                        echo > {var.deployFile} "; The deploy command for Z when using a dockable probe" ; Let's create the probe loading code file for dockable probes
                        echo >> {var.deployFile} "if sensors.probes[0].value[0] != 0"
                        

                        Should be

                        echo >{var.deployFile} "; The deploy command for Z when using a dockable probe" ; Let's create the probe loading code file for dockable probes
                        echo >>{var.deployFile} "if sensors.probes[0].value[0] != 0"
                        

                        See the documentation here
                        There must be no spaces between the > or >> symbol and <filename>. The default folder for the file is /sys.

                        Try the attached file without editing it.
                        Rename it to whatever you wish
                        klicky_setup.g

                        undefined 1 Reply Last reply 30 Dec 2023, 12:33 Reply Quote 0
                        • undefined
                          izeman @OwenD
                          last edited by 30 Dec 2023, 12:33

                          @OwenD Thanks for your tremendous effort, but the problem still exists.

                          d7c3d506-9ea5-4d1e-b81a-55ec55a0e569-image.png

                          undefined undefined 2 Replies Last reply 30 Dec 2023, 14:04 Reply Quote 0
                          • undefined
                            izeman @izeman
                            last edited by 30 Dec 2023, 14:04

                            I now just went to the code, and I guess I could see what it's meant to do, and basically it's not needed to be run as a macro. I can just determine the positions per hand, and then c&p the to be generated code (the last two blocks) into the .g files. I will try that.

                            undefined 1 Reply Last reply 30 Dec 2023, 17:38 Reply Quote 0
                            • undefined
                              izeman @izeman
                              last edited by 30 Dec 2023, 17:38

                              Just in case someone else is looking for a deployprobe.g and retractprobe.g for a klicky probe, and got the same issues as I got. Just use the tool to determine the values, or do it manually, and c&p it into those two files:

                              ; The deploy command for Z when using a dockable probe" 
                              ; Let's create the probe loading code file for dockable probes
                              
                              if sensors.probes[0].value[0] != 0
                                  var originX = {move.axes[0].userPosition} ; Store the X position before grabbing the probe.
                                  var originY = {move.axes[1].userPosition} ; Store the Y position before grabbing the probe.
                                  G1 X238.6 Y55 F999999 ; Move tool in front of dock
                                  G1 X238.6 Y25 F999999 ; Move tool in position where probe is mounted
                                  G1 X238.6 Y55 F999999 ; Move tool in front of dock
                                  if var.originX > 238.6 || var.originY > 55 ; Move the toolhead back to the position we came from
                                     G1 X{var.originX} Y{var.originY} F999999
                                  M400
                              if sensors.probes[0].value[0] != 0
                                  abort ""Error probe not attached - aborting""
                              
                              ; The retract command for Z when using a dockable probe
                              ; Let's create the docking code file for dockable probes
                              
                              if sensors.probes[0].value[0] != 1000
                                  G90
                                  G1 X238.6 Y55 F999999 ; Move tool in front of dock
                                  M400
                                  G1 X238.6 Y25 F999999 ; Move tool in position where probe is mounted
                                  G1 X188.6 Y25 F999999 ; Move tool to detach probe
                                  G1 X238.6 Y55 F999999 ; Move tool in front of dock
                                  M400
                              if sensors.probes[0].value[0] != 1000
                                  abort ""Error probe not docked - aborting""
                              
                              1 Reply Last reply Reply Quote 0
                              • undefined
                                OwenD @izeman
                                last edited by 30 Dec 2023, 21:22

                                @izeman
                                I'm afraid that error is my fault. (control character in string)
                                In my haste, I did a search and replace to change all the spaces to tabs to fix the first error you were having.
                                I did not notice that it also put tabs in the echo command (which must have only spaces)
                                I do not have a klicky probe, so cannot fully test this, but I have tested everything except checking the probe status and it should now work as the OP intended.
                                Amended file attached
                                klicky_setup.g

                                BTW, you also appear to have some errors in config.g
                                You should run M98 P"config.g" and investigate

                                undefined 1 Reply Last reply 2 Jan 2024, 14:48 Reply Quote 0
                                • undefined
                                  izeman @OwenD
                                  last edited by 2 Jan 2024, 14:48

                                  @OwenD WORKS GREAT now!! Thanks a lot!!!

                                  1 Reply Last reply Reply Quote 0
                                  • undefined mher referenced this topic 18 Apr 2024, 11:24
                                  • First post
                                    Last post
                                  Unless otherwise noted, all forum content is licensed under CC-BY-SA