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

Macro for cleaning and purging nozzle

Scheduled Pinned Locked Moved
Gcode meta commands
2
54
6.1k
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
    fcwilt @Exerqtor
    last edited by 5 Jun 2022, 11:13

    @exerqtor

    I perhaps should mention that so far all I have done is try to insure the syntax and the logic is correct.

    I haven't looked at the code to see how well it will do the job or anything of that nature.

    Frederick

    Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

    1 Reply Last reply Reply Quote 0
    • undefined
      Exerqtor @fcwilt
      last edited by Exerqtor 6 May 2022, 12:07 5 Jun 2022, 12:02

      @fcwilt said in Macro for cleaning and purging nozzle:

      @exerqtor said in Macro for cleaning and purging nozzle:

      The "||" between axes in my homing check is something i've copied from one lf my other macro's that i've been using almost two years now so it's actually working.

      If the goal is to be sure that all three axes are homed it cannot be working with || unless you have uncovered a bug in the firmware.

      It's worked as far as i can understand at least, so in that case it must be a bug. Or maybe i've only been lucky with my usecase since i've been using it to like this for instance:

      ; Make sure all axes are Homed
      if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed ; if axes aren't homed
      G28 ; home all axes

      (also, why does that {1} show up here in the forum all of a sudden?)

      Got a minute to clean it up and switched to using spaces for indentations, so here's the file: nozzle_scrub.g

      The problem with tabs is that different editors with different settings are going to format the text differently. With spaces it's always going to look the same on all editors, aside from font differences and things like that.

      Aha i see, you learn something every day haha.

      @exerqtor

      Here is my first edit. I added some "section headers" where I think they belong but please check to see if I have understood what you are doing.

      nozzle_scrub_v1.g

      There were a couple of indentation errors and an if near the end that I changed to an else since it is a bit simpler and works the same overall.

      Let me know if I have made mistakes.

      Yeah you get where i'm getting at for sure!
      What editor are you using btw? I find working with spaces as supposed to tabs is somewhat difficult in notepad++ (to see where you're at if that makes sense).

      @exerqtor

      I perhaps should mention that so far all I have done is try to insure the syntax and the logic is correct.

      I haven't looked at the code to see how well it will do the job or anything of that nature.

      Well if the construct of the calculations etc. is done right now i'll drop it in the printer and see what happens, see what it outputs!
      Just give me a few!

      undefined 1 Reply Last reply 5 Jun 2022, 12:22 Reply Quote 0
      • undefined
        fcwilt @Exerqtor
        last edited by fcwilt 6 May 2022, 12:24 5 Jun 2022, 12:22

        @exerqtor

        The reason || works is you are checking for not homed via the exclamation point character proceeding the move.axes[#].homed value.

        You only need to find one not homed axis to have it be true, thus || works as desired.

        But when trying to determine if all axes are homed you need to check them all, thus the need for the &&.

        As to my editor:

        The editor I am using is one I have used for years - EditPad Pro.

        It is somewhat quirky. Example, when something goes wrong, say a file cannot be accessed, the error message may end with "Bummer!".

        But it is very powerful and once learned you can do just about anything.

        The Duet boards support FTP which stands for File Transport Protocol. This means you can upload/download files using any FTP client.

        This editor supports FTP.

        It also has the concept of a Project - which is basically a group of files that you assign to a Project which you have created and named.

        When you open a Project it opens all the assigned files. When you close the Project it closes all the files.

        Things like find or replace can work across all the files in the Project.

        But the great thing for me is the the editor supports Projects using an FTP connection.

        So when I setup a Project correctly and associate it with the correct FTP connection, then when the Project is opened all the files are downloaded from the Duet and are available for editing.

        When a file is changed and saved it is automatically uploaded back to the Duet.

        That's a very brief overview.

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

        undefined 1 Reply Last reply 6 Jun 2022, 13:54 Reply Quote 0
        • undefined
          Exerqtor @fcwilt
          last edited by Exerqtor 6 Jun 2022, 15:01 6 Jun 2022, 13:54

          @fcwilt said in Macro for cleaning and purging nozzle:

          @exerqtor

          The reason || works is you are checking for not homed via the exclamation point character proceeding the move.axes[#].homed value.

          You only need to find one not homed axis to have it be true, thus || works as desired.

          But when trying to determine if all axes are homed you need to check them all, thus the need for the &&.

          That makes sense! 😃

          As to my editor:

          The editor I am using is one I have used for years - EditPad Pro.

          It is somewhat quirky. Example, when something goes wrong, say a file cannot be accessed, the error message may end with "Bummer!".

          But it is very powerful and once learned you can do just about anything.

          The Duet boards support FTP which stands for File Transport Protocol. This means you can upload/download files using any FTP client.

          This editor supports FTP.

          It also has the concept of a Project - which is basically a group of files that you assign to a Project which you have created and named.

          When you open a Project it opens all the assigned files. When you close the Project it closes all the files.

          Things like find or replace can work across all the files in the Project.

          But the great thing for me is the the editor supports Projects using an FTP connection.

          So when I setup a Project correctly and associate it with the correct FTP connection, then when the Project is opened all the files are downloaded from the Duet and are available for editing.

          When a file is changed and saved it is automatically uploaded back to the Duet.

          That's a very brief overview.

          Okok, i'll check it out if i find working with spaces etc. in notepad to be to annoying. I'm using WinSCP to FTP into the duet if i need to work on the files in the printer allready but ther project functions sounds sweet though!

          Other than that i've made some small minute changes to the macro, but i think(?) the math is setup wrong with the parenthesis and stuff in some places.

          And the "loop" part for where it's supposed to actually wipe on the brush for the amout of times defined by var.wipe_qty don't seem to work. (Don't know if i'm just to dense or the fact that my programming skills is way bellow what it should be while working with conditional stuff. But i really miss some more examples of how to "make" the different functions etc. in the docs).

          undefined 1 Reply Last reply 6 Jun 2022, 14:00 Reply Quote 0
          • undefined
            fcwilt @Exerqtor
            last edited by 6 Jun 2022, 14:00

            @exerqtor said in Macro for cleaning and purging nozzle:

            Okok, i'll check it out if i find working with spaces etc. in notepad to be to annoying. I'm using WinSCP to FTP into the duet if i need to work on the files in the printer allready but ther project finctions sounds sweet though!

            There are likely other good editors that have similar features. I know one called UltraEdit that has been around for ages.

            Other than that i've made some small minute changes to the macro, but i think(?) the math is setup wrong with the parenthesis and stuff in some places.

            Be glad to look at it.

            And the "loop" part for where it's supposed to actually wipe on the brush for the amout of times defined by var.wipe_qty don't seem to work. (Don't know if i'm just to dense or the fact that my programming skills is way bellow what it should be while working with conditional stuff. But i really miss some more examples of how to "make" the different functions etc. in the docs).

            Be glad to create some examples for you.

            Just let me know.

            Frederick

            Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

            undefined 1 Reply Last reply 6 Jun 2022, 15:51 Reply Quote 0
            • undefined
              Exerqtor @fcwilt
              last edited by 6 Jun 2022, 15:51

              @fcwilt said in Macro for cleaning and purging nozzle:

              @exerqtor said in Macro for cleaning and purging nozzle:

              Okok, i'll check it out if i find working with spaces etc. in notepad to be to annoying. I'm using WinSCP to FTP into the duet if i need to work on the files in the printer allready but ther project finctions sounds sweet though!

              There are likely other good editors that have similar features. I know one called UltraEdit that has been around for ages.

              I'll have a look at both once i've got some spare time to "waste" 🙂

              Other than that i've made some small minute changes to the macro, but i think(?) the math is setup wrong with the parenthesis and stuff in some places.

              Be glad to look at it.

              And the "loop" part for where it's supposed to actually wipe on the brush for the amout of times defined by var.wipe_qty don't seem to work. (Don't know if i'm just to dense or the fact that my programming skills is way bellow what it should be while working with conditional stuff. But i really miss some more examples of how to "make" the different functions etc. in the docs).

              Be glad to create some examples for you.

              Just let me know.

              Sure, if you want to take a look at it you can use this(it's pretty much the same exactly the same as your V1), don't mind the stuff i've uncommented it's something i'm working on in parallell:
              nozzle_scrub_v1.1.g

              undefined 1 Reply Last reply 9 Jun 2022, 15:11 Reply Quote 0
              • undefined
                Exerqtor @Exerqtor
                last edited by 9 Jun 2022, 15:11

                Ok so now i've messed around some more with the macro and everything should be working EXCEPT the brush "loop".

                Wanna have a look @fcwilt ?
                nozzle_scrub_v1.2.g

                undefined 2 Replies Last reply 9 Jun 2022, 15:15 Reply Quote 0
                • undefined
                  fcwilt @Exerqtor
                  last edited by 9 Jun 2022, 15:15

                  @exerqtor said in Macro for cleaning and purging nozzle:

                  Ok so now i've messed around some more with the macro and everything should be working EXCEPT the brush "loop".

                  Wanna have a look @fcwilt ?
                  nozzle_scrub_v1.2.g

                  Sure. Downloading it now.

                  What is the problem with the "loop"?

                  Frederick

                  Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    fcwilt @Exerqtor
                    last edited by 9 Jun 2022, 15:18

                    @exerqtor

                    Aren't you seeing warnings about mixed indentation (tabs and spaces)?

                    I am seeing a lot of tab characters.

                    Frederick

                    Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                    undefined 1 Reply Last reply 9 Jun 2022, 16:31 Reply Quote 0
                    • undefined
                      Exerqtor @fcwilt
                      last edited by Exerqtor 6 Sept 2022, 16:35 9 Jun 2022, 16:31

                      @fcwilt said in Macro for cleaning and purging nozzle:

                      @exerqtor said in Macro for cleaning and purging nozzle:

                      Ok so now i've messed around some more with the macro and everything should be working EXCEPT the brush "loop".

                      Wanna have a look @fcwilt ?
                      nozzle_scrub_v1.2.g

                      Sure. Downloading it now.

                      What is the problem with the "loop"?

                      Well it just don't loop i guess? it just does one brush motion and stops.

                      @fcwilt said in Macro for cleaning and purging nozzle:

                      @exerqtor

                      Aren't you seeing warnings about mixed indentation (tabs and spaces)?

                      I am seeing a lot of tab characters.

                      Haven't tried running it yet, but it shouldn't be many tabs? ( I forgot using spaces on those few lines i added after the last time you looked at it).
                      This should be purged for any tabs (i think lol):
                      nozzle_scrub_v1.3.g

                      undefined 1 Reply Last reply 9 Jun 2022, 16:34 Reply Quote 0
                      • undefined
                        fcwilt @Exerqtor
                        last edited by 9 Jun 2022, 16:34

                        @exerqtor said in Macro for cleaning and purging nozzle:

                        Haven't tried running it yet, but it should be many tabs? ( I forgot using spaces on those few lines i added after the last time you looked at it).
                        This should be purged for any tabs (i think lol):

                        I would be glad to buy you a proper editor - it would make my "proof reading" easier as I wouldn't have to try to work out what the indentation was supposed to be.

                        Frederick

                        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                        undefined 1 Reply Last reply 9 Jun 2022, 16:37 Reply Quote 0
                        • undefined
                          Exerqtor @fcwilt
                          last edited by 9 Jun 2022, 16:37

                          @fcwilt said in Macro for cleaning and purging nozzle:

                          @exerqtor said in Macro for cleaning and purging nozzle:

                          Haven't tried running it yet, but it should be many tabs? ( I forgot using spaces on those few lines i added after the last time you looked at it).
                          This should be purged for any tabs (i think lol):

                          I would be glad to buy you a proper editor - it would make my "proof reading" easier as I wouldn't have to try to work out what the indentation was supposed to be.

                          Haha i THINK all the indentations should be spaces now, it was some left in the clear lines i didn't know about. Sorry for making it harder than it should😮

                          undefined 2 Replies Last reply 9 Jun 2022, 16:40 Reply Quote 0
                          • undefined
                            fcwilt @Exerqtor
                            last edited by 9 Jun 2022, 16:40

                            @exerqtor said in Macro for cleaning and purging nozzle:

                            @fcwilt said in Macro for cleaning and purging nozzle:

                            @exerqtor said in Macro for cleaning and purging nozzle:

                            Haven't tried running it yet, but it should be many tabs? ( I forgot using spaces on those few lines i added after the last time you looked at it).
                            This should be purged for any tabs (i think lol):

                            I would be glad to buy you a proper editor - it would make my "proof reading" easier as I wouldn't have to try to work out what the indentation was supposed to be.

                            Haha i THINK all the indentations should be spaces now, it was some left in the clear lines i didn't know about. Sorry for making it harder than it should😮

                            I can buy a copy of EditPad online and license it to you. Then you can download it and start to use it today.

                            Frederick

                            Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                            undefined 1 Reply Last reply 9 Jun 2022, 19:15 Reply Quote 0
                            • undefined
                              fcwilt @Exerqtor
                              last edited by fcwilt 6 Sept 2022, 21:01 9 Jun 2022, 16:54

                              @exerqtor

                              I made a change to first test for non-homed axes. It eliminates that else all the way at the end of the file. It tests and if it fails it warns you and aborts.

                              And I added a missing S parameter to a M118. Given the other times you used echo what was the reason for the M118?

                              nozzle_scrub_v1.3_fcw.g

                              Frederick

                              Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                              1 Reply Last reply Reply Quote 0
                              • undefined
                                Exerqtor @fcwilt
                                last edited by Exerqtor 6 Sept 2022, 19:42 9 Jun 2022, 19:15

                                @fcwilt said in Macro for cleaning and purging nozzle:

                                @exerqtor said in Macro for cleaning and purging nozzle:

                                @fcwilt said in Macro for cleaning and purging nozzle:

                                @exerqtor said in Macro for cleaning and purging nozzle:

                                Haven't tried running it yet, but it should be many tabs? ( I forgot using spaces on those few lines i added after the last time you looked at it).
                                This should be purged for any tabs (i think lol):

                                I would be glad to buy you a proper editor - it would make my "proof reading" easier as I wouldn't have to try to work out what the indentation was supposed to be.

                                Haha i THINK all the indentations should be spaces now, it was some left in the clear lines i didn't know about. Sorry for making it harder than it should😮

                                I can buy a copy of EditPad online and license it to you. Then you can download it and start to use it today.

                                I really appreciate the offer, but i think it's to much to ask of you to buy me a license. It's EditPad Pro you were vouching for right? I'll actually sit my ass down and take a good look at it now.

                                @fcwilt said in Macro for cleaning and purging nozzle:

                                @exerqtor

                                I made a change to first test for non-homed axes. It eliminates that else all the way at the end of the file. It tests and if it fails it warns you and aborts.

                                And I added a missing S parameter to a M118. Given the other times you used echo what was the reason for the M118?

                                nozzle_scrub_v1.3_fcw.g

                                Ah cool, much better way of doing it for sure!
                                To be honest the M118's was just some "garbage" i put in there while i started to retrofit the macro from Klipper to RRF, and since it wasn't mission critical i didn't care to do anything about it until i had other stuff fixed.

                                For reference the klipper macro i worked off is this one:
                                https://github.com/VoronDesign/VoronUsers/blob/master/abandoned_mods/printer_mods/edwardyeeks/Decontaminator_Purge_Bucket_%26_Nozzle_Scrubber/Macros/nozzle_scrub.cfg

                                I did one little itteration where i removed some of the uncommented code and fixed a bug where i had called for "var.brush_gap" instead of "var.bucket_gap" in line 151.

                                So now it works, loops and all. BUT i get Error: in file macro line 169 column 209: G1: expected ')' and i can't really understand what part of the equation it's refering to when i look at the code.
                                nozzle_scrub_v1.4.g

                                undefined 1 Reply Last reply 9 Jun 2022, 20:30 Reply Quote 0
                                • undefined
                                  Exerqtor @Exerqtor
                                  last edited by 9 Jun 2022, 20:30

                                  I figured out what was wrong with line 169 (as i'm sure you will the secound you have a look at it even though it took me like 20min lol).

                                  I also streamlined the "var.brush_oh" calculation in line 153 and fixed the timeout for the message in line 137.

                                  Lastly i added M400 at the end before M118 so that it would actually be finished with the moves before saying so.

                                  nozzle_scrub_v1.5.g

                                  undefined 2 Replies Last reply 9 Jun 2022, 21:07 Reply Quote 0
                                  • undefined
                                    fcwilt @Exerqtor
                                    last edited by 9 Jun 2022, 21:07

                                    @exerqtor said in Macro for cleaning and purging nozzle:

                                    I figured out what was wrong with line 169 (as i'm sure you will the secound you have a look at it even though it took me like 20min lol).

                                    I also streamlined the "var.brush_oh" calculation in line 153 and fixed the timeout for the message in line 137.

                                    Lastly i added M400 at the end before M118 so that it would actually be finished with the moves before saying so.

                                    nozzle_scrub_v1.5.g

                                    Glad to hear it is working for you.

                                    I have to ask - what the heck is this code for? 🤔 🤔 🤔 🤔

                                    G1 X{208.5 + ((23.5 - 12.5) / (2 - 1)) + (1 * 25) + (1 * ((12.5 + ((35.5 / 2) + (1 x 12.5))} ; code with overhang compensation

                                    Everything there is a constant - why not just do the math and enter the result?

                                    Back to perusing the file.

                                    Frederick

                                    Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                    undefined 1 Reply Last reply 9 Jun 2022, 21:27 Reply Quote 0
                                    • undefined
                                      fcwilt @Exerqtor
                                      last edited by fcwilt 6 Sept 2022, 21:49 9 Jun 2022, 21:20

                                      @exerqtor

                                      G4 with a S parameter is the time in seconds no need to do the math below:

                                      G4 P{var.ooze_dwell * 1000}

                                      As to the rest of your code - your math teachers must have loved you.

                                      Clever but harder to understand than simple conditional code.

                                      Do you have a video of this brushing thing?

                                      Thanks.

                                      Frederick

                                      Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        Exerqtor @fcwilt
                                        last edited by Exerqtor 6 Sept 2022, 21:34 9 Jun 2022, 21:27

                                        @fcwilt

                                        Hahaha it's the math for the code above, i needed to visualize what i tried to do and forgot to remove it. It's NOT meant to be in there and won't be once i get everything working 100%

                                        Looks like i've got a bug or two to iron out, when the hotend is hot and it actually does a purge it purges outside the damned purge bin 🤣 But that will have to be a challenge for tomorrow.

                                        @fcwilt said in Macro for cleaning and purging nozzle:

                                        @exerqtor

                                        G4 with a S parameter is the time in seconds no need to do the math below:

                                        G4 P{var.ooze_dwell * 1000}

                                        Good catch, i'll change that right away.

                                        As to the rest of your code - your math teachers must have loved you.

                                        Clever but harder to understand than simply conditional code.

                                        I can't take the credit for the math in that code, i've done adjustments to make it suit what i want and added a variable here and there. But the bulk of it is made by a user/users from the Voron discord.

                                        Tbh i think the next step here is to make the purge point selection etc. conditional so that that long ass equation can be emited.

                                        Do you have a video of this brushing thing?

                                        Thanks.

                                        I'll take a video tomorrow and post here, want to get that damn purge position to work first😃

                                        undefined 1 Reply Last reply 9 Jun 2022, 21:52 Reply Quote 1
                                        • undefined
                                          fcwilt @Exerqtor
                                          last edited by 9 Jun 2022, 21:52

                                          @exerqtor

                                          I will look at the intro more closely and see if I can fully understand what is the goal.

                                          I'm retired but I was a programmer for 30+ years.

                                          My gut tells me that code is more complicated than it needs to be.

                                          But to be sure I have know what the intent of the processes are.

                                          Frederick

                                          Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                          undefined 1 Reply Last reply 10 Jun 2022, 07:54 Reply Quote 0
                                          15 out of 54
                                          • First post
                                            15/54
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA