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

    Surfacing Macro

    Scheduled Pinned Locked Moved
    CNC
    11
    28
    2.5k
    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.
    • chimaeraghundefined
      chimaeragh @sinned6915
      last edited by

      @sinned6915 Line 89 selects the tool (T1). If your spindle is set to tool 0 (T0) change it accordingly. Line 90 sends the M3 command to start the spindle.

      Duet 2 Wifi, Ooznest Workbee CNC 1510

      1 Reply Last reply Reply Quote 0
      • CthulhuLabsundefined
        CthulhuLabs @sinned6915
        last edited by

        @sinned6915 sorry for the late reply. Have not been on this forum for a while. No I am not using a PanelDue. I am using a Pi with an HDMI touch screen monitor. As for spindle I am using a Brushless Dewalt Trim Router with the ESC replaced with an ODrive. It currently requires running commands from odrivetool on the Pi.

        @chimaeragh what all did you change in your version? I just upgraded to an ODrive Pro and can finally use an ADC input to control my spindle.

        chimaeraghundefined 1 Reply Last reply Reply Quote 0
        • chimaeraghundefined
          chimaeragh @CthulhuLabs
          last edited by chimaeragh

          @cthulhulabs My DeWalt is configured as a spindle and is automated via a relay. So I can use M3 to start it and M5 to stop it. (Already modified my Vectric postprocessor for this)
          I added M3 and M5 commands into the surfacing loop at line 89 and line 148 of the macro.

          T1 ; selects the spindle Tool 1

          M3 S17500 ; starts tool

          Duet 2 Wifi, Ooznest Workbee CNC 1510

          CthulhuLabsundefined 1 Reply Last reply Reply Quote 0
          • CthulhuLabsundefined
            CthulhuLabs @chimaeragh
            last edited by

            @chimaeragh Cool. There is a variable at the top for the spindle RPMs. Now that my spindle RPM can be controlled by the Duet I plan to add it. You should probably use that in your M3 command.

            I am thinking of rewriting this Macro to only cut in one direction to give a more uniform surface finish. Basically cut from Left to Right, raise up, rapid to the next cut, lower and repeat. There would be a flag in it to change it between Left to Right and Right to Left. Might also add a flag to go from top to bottom or bottom to top.

            nikki-mundefined 1 Reply Last reply Reply Quote 0
            • nikki-mundefined
              nikki-m @CthulhuLabs
              last edited by

              @CthulhuLabs I use your surfacing.g code on a regular basis. Love it.
              But is there any way to modify it so that the Depth of Cut could be adjusted by user input?

              It would be nice to be able to enter a different value each time I use this macro, without having to edit the code. It would be even nicer if the DOC could be modified on each susbequent pass ("run again"). Perhaps also to limit the input value to between 0.1mm and 3.0mm?

              HebigTundefined 1 Reply Last reply Reply Quote 0
              • HebigTundefined
                HebigT @nikki-m
                last edited by

                @nikki-m

                I know you can pass parameters to a macro in the macro call itself (e.g. depth of pass)

                Manually choosing this value on each run of the macro may be possible now using M291 on 3.5 beta firmware.

                nikki-mundefined 1 Reply Last reply Reply Quote 0
                • nikki-mundefined
                  nikki-m @HebigT
                  last edited by

                  @HebigT Yes, I did look into the M291 function, but sadly, I am still on the v3.3 (awaiting any update from Ooznest)!!
                  Does this mean that there is no other way to program in a variable DOC? Apart from setting up numerous versions of the macro, each with a different value for the doc?

                  HebigTundefined 1 Reply Last reply Reply Quote 0
                  • HebigTundefined
                    HebigT @nikki-m
                    last edited by HebigT

                    @nikki-m

                    With 3.3 you should still be able to pass a parameter in the macro call. You’ll just have to modify the macro (hopefully only once!) to assign that parameter to the DOC variable (e.g. var DepthOfCut= {param.y} )
                    It’ll still be a manual process of entering the parameter each time you start the macro, but it should save you the trouble of having to change the DOC variable within the macro each time.

                    See the macro parameter section at this link:

                    https://docs.duet3d.com/User_manual/Reference/Gcode_meta_commands

                    nikki-mundefined 1 Reply Last reply Reply Quote 0
                    • nikki-mundefined
                      nikki-m @HebigT
                      last edited by

                      @HebigT @HebigT I'm not sure I understand what you are saying here.
                      Is there an actual command (and presumably through a screen interaction) in v3. 3 which allows a user to type in and enter a value, and to then assign this value to an existing variable?

                      I still cannot find any means of entering an external value. I am still having to resort to having multiple versions of this macro, each wirh different values for doc.

                      OwenDundefined 1 Reply Last reply Reply Quote 0
                      • OwenDundefined
                        OwenD @nikki-m
                        last edited by OwenD

                        @nikki-m
                        For RRF 3.3 and later you can pass parameters using M98
                        So you can call your macro using M98 P"mymacro.g" Y0.002
                        and in the macro you access the parameter using param
                        e.g.

                        var depthOfCut = 0.001
                        if exists(param.Y)
                            set var.depthOfCut = param.Y
                        
                        o_lampeundefined 1 Reply Last reply Reply Quote 0
                        • Nightowlundefined
                          Nightowl
                          last edited by

                          I'm not sure if I'm being a bit too simplistic here, but this is what I do, after producing the GCode toolpath for surfacing, usually with a 0.15mm depth of cut, or sometimes more...

                          Run the toolpath. Once complete, if there are still low spots, lower the spindle/motor to Z0, then lower it again to the toolpath's cut depth (0.15mm), reset Z0 and rerun the toolpath.

                          Continue as necessary, but as you get closer to 'flat', you could reduce the 0.15mm accordingly.

                          Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                          I'm still on my learning curve, so take everything I say with caution!

                          RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                          1 Reply Last reply Reply Quote 0
                          • o_lampeundefined
                            o_lampe @OwenD
                            last edited by o_lampe

                            @OwenD
                            Isn't there a way to start the macro by doubleclicking and ask for the DOC-value from within the macro?

                            OwenDundefined 1 Reply Last reply Reply Quote 0
                            • OwenDundefined
                              OwenD @o_lampe
                              last edited by

                              @o_lampe
                              Not unless you update to RRF version 3.5.0b1
                              Then you can ask for input use M291 as mentioned above

                              nikki-mundefined 1 Reply Last reply Reply Quote 1
                              • nikki-mundefined
                                nikki-m @OwenD
                                last edited by

                                Thank for all your ideas, guys. I does seem that I can't achieve what I want whilst on v3.3.

                                So I am in the hands of Ooznest and will have to wait to see when / if they decide to release a later version of their firmware.

                                Of course, this macro would make a great plug-in, and so getting around this data input issue!

                                CthulhuLabsundefined 1 Reply Last reply Reply Quote 0
                                • CthulhuLabsundefined
                                  CthulhuLabs @nikki-m
                                  last edited by

                                  So I am working on a new version of this Macro that will prompt for user input with the M291 command. It will make the Macro far more interactive for things like DepthOfCut, RPM, FeedRate, etc. One of the prompts I want to add is to ask if it should work in Pass mode or Depth mode.

                                  In pass mode it will prompt you for the number of passes to take. It will then do that many passes before prompting you whether to surface another layer. Default will obviously be 1.

                                  In Depth mode it will prompt you for how much material to remove. So if your DepthOfCut is say 0.3mm and you enter a depth of 1mm the Macro will do three passes at 0.3mm and then a fourth pass at 0.1mm for a total of 1mm.

                                  1 Reply Last reply Reply Quote 3
                                  • CthulhuLabsundefined CthulhuLabs referenced this topic
                                  • First post
                                    Last post
                                  Unless otherwise noted, all forum content is licensed under CC-BY-SA