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

    Continuous rotational axis

    Scheduled Pinned Locked Moved Unsolved
    CNC
    6
    12
    494
    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.
    • MaxGyverundefined
      MaxGyver
      last edited by

      Is there a way to set up an axis to rotate continuously at a certain speed and also start/stop it or change the speed without interfering with a running program?

      I am using a nema17 peristaltic pump to control the flow of coolant in my minimal lubrication system. Until now, I used a motor controller that I hacked together from some parts I had lying around. Now that I have upgraded my CNC-Controller to Duet, I would like to run the motor directly from the Duet.

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

        @MaxGyver You don't have continuos rotation, but you can setup a 2^31 steps long virtual axis, so you can run a stepper for weeks before it reaches the fence.
        If you want to change speed or stop it, you should use the DWC command line instead of macros. In Deamon.g you can add the code to react accordingly.
        With M669 Snnnn you can set a segment length, which helps interrupting the move faster.

        Untestet, so use at own risk
        //edit I guess the only way to change speed is to change steps/rev with M92. A simple G1 Annnnn Fmmm will probably be overwritten by the main code

        MaxGyverundefined 1 Reply Last reply Reply Quote 2
        • MaxGyverundefined MaxGyver marked this topic as a question
        • MaxGyverundefined
          MaxGyver @o_lampe
          last edited by

          @o_lampe

          Thank you for your suggestions. Unfortunately, I need a way to quickly adjust coolant flow during machining. Typing commands in the command line is just not practical. Furthermore, I would like to automatically adjust the coolant flow rate depending on the loaded tool.

          I have ordered another peristaltic pump that uses a 24V DC-Motor instead of a Stepper. My plan is to set it up as a fan in the firmware. This way I have can use the fanslider in DWC to manually adjust coolant flow as well as using gcode to set the flow dependent on the tool.

          Phaedruxundefined 1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator @MaxGyver
            last edited by

            @MaxGyver said in Continuous rotational axis:

            Typing commands in the command line is just not practical.

            how bout a macro?

            Z-Bot CoreXY Build | Thingiverse Profile

            soare0undefined 1 Reply Last reply Reply Quote 0
            • soare0undefined
              soare0 @Phaedrux
              last edited by

              @Phaedrux Would a macro do it in ”real time”? He needs to use a flow sensor I guess, so probably the 24V DC motor is the best option, and the easiest, too, as the tacho input may be used for the flow sensor...
              I think that implementing this for a stepper, would be a nice addon to RRF.

              MaxGyverundefined 1 Reply Last reply Reply Quote 0
              • MaxGyverundefined
                MaxGyver @soare0
                last edited by

                Unfortunately, the DC peristaltic pump I ordered has far too high flow rate even at the slowest achievable speed. I recon this is why peristaltic pumps with stepper motors exist. The latter allows for super fine and repeatable dosing of fluids... exactly what I need for my minimal lubrication system.

                @Phaedrux

                I have tried setting up a simple while loop that would constantly progress the stepper axis while the coolant output is active. But the while loop blocks all other moves and commands until it is completed...

                while state.gpOut[2].pwm>0 & iterations<=50
                    G91              ; relative
                    G0 W{iterations} ; progress W-axis
                    G90              ; absolute
                    echo iterations
                

                It would be super handy if there was a command to just rotate a set a stepper at a certain Speed or RPM. The G0 command for the W axis could be something like G0 Waaa where aaa is the axis max speed set in M203.

                droftartsundefined soare0undefined o_lampeundefined 3 Replies Last reply Reply Quote 1
                • droftartsundefined
                  droftarts administrators @MaxGyver
                  last edited by

                  @MaxGyver If you've got a Duet 3 and running latest RRF 3.5.0-rc.3, you can use the second motion queue for this. See
                  https://docs.duet3d.com/en/User_manual/RepRapFirmware/Multiple_motion_systems
                  https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m596-select-movement-queue-number

                  Ian

                  Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                  1 Reply Last reply Reply Quote 1
                  • soare0undefined
                    soare0 @MaxGyver
                    last edited by soare0

                    @MaxGyver
                    1.You may try to use a 3 way valve to regulate the flow ratio? One way , of course would be a return flow, and the other, the working one.
                    2.Still, the fact that actual flow is so high already, would not help too much to such a setup. In fact, one single flow regulator, and a free return path, may be a better idea.

                    MaxGyverundefined 1 Reply Last reply Reply Quote 0
                    • MaxGyverundefined
                      MaxGyver @soare0
                      last edited by MaxGyver

                      @soare0

                      Thats a good idea, I could just use the option to choose between for example "Flood" and "Mist" coolant in Fusion CAM to trigger different coolant flow rates for different tools.

                      My Plan B was to add a needle valve to the coolant line that can be adjusted by a RC-Servo... but the constant clogging problems with the needle valve of my FogBuster send me on this path in the first place. 😁

                      @droftarts

                      I have got a Duet 3 6XD and running RRF 3.5.0-rc.3, but did not manage to get the macro working on the second movement queue. The macro is supposed to run when the air solenoid is active -> state.gpOut[2].pwm>0 but it only stops when the maximum number of iterations is reached.

                      M596 P1              ; select movement queue number
                      M595 Q1 P10          ; lengthen movement queue to 10 elements
                      M564 H0              ; allow movement of axis that have not been homed
                      
                      while state.gpOut[2].pwm>0 & iterations<=30
                          G91              ; relative
                          G0 W{iterations} ; progress W-axis
                          G90              ; absolute
                          G4 P100
                          echo iterations
                      
                      soare0undefined T3P3Tonyundefined 2 Replies Last reply Reply Quote 0
                      • soare0undefined
                        soare0 @MaxGyver
                        last edited by

                        @MaxGyver said in Continuous rotational axis:

                        My Plan B was to add a needle valve to the coolant line that can be adjusted by a RC-Servo... but the constant clogging problems with the needle valve of my FogBuster send me on this path in the first place.

                        I think a return path is mandatory, unless you adjust the motor speed, especially working with a needle valve. But as this depends on your pump configuration and such stuff...
                        I do not get how valve clogs, as usually one has some filtering system in place in front of the pump (and maybe another after), but the world is full of wonders...!

                        Tinkery weekend then....

                        1 Reply Last reply Reply Quote 0
                        • T3P3Tonyundefined
                          T3P3Tony administrators @MaxGyver
                          last edited by

                          @MaxGyver I have updated the FR for this with a reference to this thread:
                          https://github.com/Duet3D/RepRapFirmware/issues/780

                          T3P3 created this issue in Duet3D/RepRapFirmware

                          open Support configuring an axis as "continuous rotary" #780

                          www.duet3d.com

                          1 Reply Last reply Reply Quote 3
                          • o_lampeundefined
                            o_lampe @MaxGyver
                            last edited by o_lampe

                            @MaxGyver I believe the most time consuming part in your macro is the echo iterations line?

                            //edit Just cobbled together my version of your macro, which I made bulletproof with brackets (CNC-mode expressions are different)
                            Also placed G91/G90 outside of the loop. No need to repeat those lines 30 times, I guess?

                            M596 P1              ; select movement queue number
                            M595 Q1 P10          ; lengthen movement queue to 10 elements
                            M564 H0              ; allow movement of axis that have not been homed
                             
                            G91              ; relative
                            while {(iterations<=30)}
                            	if {(state.gpOut[2].pwm>0 )}
                            	     break
                                G0 W{iterations} ; progress W-axis
                                G4 P100	
                             G90              ; absolute 
                            
                            1 Reply Last reply Reply Quote 0
                            • MaxGyverundefined MaxGyver referenced this topic
                            • First post
                              Last post
                            Unless otherwise noted, all forum content is licensed under CC-BY-SA