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

    CNC Solenoid Control for Air and Cooling Fluid

    Scheduled Pinned Locked Moved
    CNC
    4
    13
    789
    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.
    • Shanian79undefined
      Shanian79
      last edited by

      CNC.jpg
      I ordered some 12v solenoids to control on/off for my air and cooling fluid sprayers on my CNC. What is the best way to set them up to open when a job starts and close when the job is finished?

      I'm running the latest CNC version of 3.3 on a Duet 3 Board. Using Fusion 360 Cam with Workbee post processor .nc

      o_lampeundefined T3P3Tonyundefined dc42undefined 3 Replies Last reply Reply Quote 0
      • o_lampeundefined
        o_lampe @Shanian79
        last edited by o_lampe

        @shanian79 I have good experience with a TB6612 quad driver board. It can handle 12V/ 1.2A per channel and has freewheeling diodes to protect the hardware. The solenoids I tested got pretty hot when enabled at full voltage. It was better in my case to run a 24V solenoid at 12V, but of course it wil be weaker, too.
        Optionally you can try to lower the voltage after the solenoid switched ON, with a high frequency PWM signal. That's all possible with RRF3.3 and (conditionals) in separate macros or toolchanging macros.

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

          @shanian79 what voltage are you running the Duet at? What current do the solenoids draw?

          www.duet3d.com

          Shanian79undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @Shanian79
            last edited by

            @shanian79 the usual option would be to use solenoids that are rated for your VIN voltage (so more likely 24V than 12V) and drive them from any of OUT1, OUT2 and OUT3. These outputs are rated at 5A and have built-in flyback diodes. OUT0 does not have a built-in flyback diode.

            The OUT4/5/6/7/8/9 outputs also have built-in flyback diodes, but the maximum current is lower, and if you set those outputs to 12V then the maximum total current must not exceed 800mA.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            Shanian79undefined 1 Reply Last reply Reply Quote 0
            • Shanian79undefined
              Shanian79 @o_lampe
              last edited by

              @o_lampe 600ma @24V

              1 Reply Last reply Reply Quote 0
              • Shanian79undefined
                Shanian79 @dc42
                last edited by

                @dc42 Thanks! My main question is how to set the solenoid outputs in the config to turn on when a job starts and shut off when its complete. I don't think I can modify the G-code created by Fusion360 to have starting and ending scripts like with FDM slicer software. I'm using the F360 Workbee post processor.

                o_lampeundefined dc42undefined 2 Replies Last reply Reply Quote 0
                • Shanian79undefined
                  Shanian79 @T3P3Tony
                  last edited by

                  @t3p3tony 24V and draw is 600mah

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

                    @shanian79 said in CNC Solenoid Control for Air and Cooling Fluid:

                    My main question is how to set the solenoid outputs in the config to turn on when a job starts and shut off when its complete.

                    You could write a macro in daemon.g (or create daemon.g in the first place) which checks the "printer" status in the object model.
                    Depending if it's printing, paused, idle, busy you switch the solenoids accordingly with M42 command.

                    1 Reply Last reply Reply Quote 0
                    • dc42undefined
                      dc42 administrators @Shanian79
                      last edited by

                      @shanian79 said in CNC Solenoid Control for Air and Cooling Fluid:

                      @dc42 Thanks! My main question is how to set the solenoid outputs in the config to turn on when a job starts and shut off when its complete. I don't think I can modify the G-code created by Fusion360 to have starting and ending scripts like with FDM slicer software. I'm using the F360 Workbee post processor.

                      You can turn them on in the start.g file and turn them off in the stop.g file. Alternatively, if F360 has the capability to generate the usual CNC GCode commands for controlling coolant, then you can implement those GCode commands as macro files.

                      Duet WiFi hardware designer and firmware engineer
                      Please do not ask me for Duet support via PM or email, use the forum
                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                      Shanian79undefined 3 Replies Last reply Reply Quote 0
                      • Shanian79undefined
                        Shanian79 @dc42
                        last edited by

                        @dc42 Thanks! How exactly would I do that? Is there a link to a thread that explains how to do this?

                        1 Reply Last reply Reply Quote 0
                        • Shanian79undefined
                          Shanian79 @dc42
                          last edited by

                          @dc42 disregard....I figured it out

                          1 Reply Last reply Reply Quote 0
                          • Shanian79undefined
                            Shanian79 @dc42
                            last edited by

                            @dc42 How do I setup my config.g to allow the F360 M7 commands to control the solenoid I have on out1? I can't find any documentation for how to allocate M7 to a specific i/o pin.

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

                              @shanian79 first allocate the IO pin to be a gpio output using M950, in config.g e.g:

                              M950 P0 C"out2"
                              

                              That creates an output on P0.

                              Then assuming F360 can send the M7, M9 commands for controlling coolant you can use the RRF ability to have a macro that matches a gcode to create M7.g and M9.g for example. in your /sys directory

                              ;M7.g 
                              M42 P0 S1 ; turn on coolant
                              
                              ;M9.g 
                              M42 P0 S0: turn off coolant
                              

                              M42 is used to control the state of the output pin https://duet3d.dozuki.com/Wiki/M42

                              If F360 can't do that because it can't generate the commands to control the coolant then you could add them to the start and stop macros:
                              https://duet3d.dozuki.com/Wiki/Macros#Section_Start_pause_stop_and_power_fail

                              www.duet3d.com

                              1 Reply Last reply Reply Quote 1
                              • First post
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA