Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Unable to control Spindle with Duet 2 WiFi

    CNC
    6
    21
    206
    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.
    • wschuller
      wschuller @jay_s_uk last edited by

      @jay_s_uk thanks for the reply. M115 reports the following:

      FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.3 ELECTRONICS: Duet WiFi 1.02 or later FIRMWARE_DATE: 2021-06-15 21:45:03

      I do admit I have had some difficulties with interpreting solutions provided with code used in older versions.

      I did work out the error was due to not having T1 to select the tool. It might be helpful to add this as a note under M950 & M563, explaining the complete set of commands required. In any case I still am unable to control the spindle via the duet 2, and I will provide an update of changes I have made my reply to o_lampe's post.

      1 Reply Last reply Reply Quote 1
      • wschuller
        wschuller @o_lampe last edited by

        @o_lampe said in Unable to control Spindle with Duet 2 WiFi:

        IIRC correctly, the Duet2 expansion header pins only deliver 3.3V signals. That might be to low for the SSR.
        You can try to use a fan output instead (directly on the Duet2, not the expansion header)
        They can be jumpered to 5V or Vin, but both should be OK for the SSR.
        If the spindle controller needs 0-10V analog speed input, there are 3rd party DAC-boards available just for this purpose.
        Maybe someone can chime in here with a link?

        Yeah thanks o_lampe you're 100% right, but I thought it was because those expansion header pins were PWM. So I moved the connections to Heater 1 & 2, connected the spindle controller you mentioned to Heater 1 to control the relay ON/OFF function, and made code changes to the Config.g Tools Section as shown below:
        ; Tools
        M453 ; set machine to CNC mode
        M950 R0 C"e1heat+e0heat" Q1000 L1:12000 ; Create spindle index 0, with PWM on e1heat pin, with ON/OFF on e0heat and PWM frequency is 1000Hz & full RPM is 12000
        M563 P1 S"Spindle" R0 ; Create tool 1 with Spindle 0 and call it "Spindle"
        T1 ; select tool 1
        Note: Here I was testing if L1 made a difference to L0, and it didn't.

        Now when I run M3 I get a green command response, no errors, but nothing happens with the spindle, and still no led on the relay. If my code updates above are correct, then I will need to verify every connection and test every device works. I was hoping it would be in my code.

        o_lampe 1 Reply Last reply Reply Quote 0
        • Nightowl
          Nightowl last edited by Nightowl

          Sorry if I haven't read this properly, but do you have a milling motor with a digital interface (like an AMB or Mafell/Soroted) or a 'proper' spindle with speed control?

          I have the Sorotec SFM1000 PV-ER which is controlled via a PWM converter connected to the Duet board, but this link might help you with a spindle, although that also uses a PWM converter?

          Happy to help if it's milling motor, though.

          Good luck!

          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

          wschuller 1 Reply Last reply Reply Quote 0
          • markz
            markz last edited by markz

            If I understand this right, your motor uses an analog voltage to determine the speed. A PWM signal is a digital signal (a square wave) at a single voltage with a variable duty cycle - it is not an analog signal that would control your speed.

            However - it's not that hard to convert that digital PWM into an analog voltage. A simple low-pass filter (resistor and capacitor) can convert PWM to rough analog as a test, but as @Nightowl has noted you can get a PWM->Analog converter cheaply that will produce a solid DC analog output.

            JoergS5 wschuller 2 Replies Last reply Reply Quote 0
            • JoergS5
              JoergS5 @markz last edited by

              @markz said in Unable to control Spindle with Duet 2 WiFi:

              u can get a PWM->Analog converter cheap

              as in section connecting a spindle, https://docs.duet3d.com/User_manual/Machine_configuration/Configuration_CNCnotes it is better to buy the green PCB version, not the blue one, because the green one is opto-coupled, the blue one not.

              Nightowl wschuller 2 Replies Last reply Reply Quote 0
              • o_lampe
                o_lampe @wschuller last edited by

                @wschuller
                On a Duet2 you can enable a pullup resistor to any PWM output by adding "^" in front of the pin name.

                M950 R0 C"e1heat+^e0heat" Q1000 L1:12000 ;  pullup enabled for e0heat
                

                I don't know, if that's necessary for the on/off switch.
                Maybe you have to invert the signal as well with "!" ?

                M950 R0 C"e1heat+!^e0heat" Q1000 L1:12000 ; pullup enabled and inverted
                
                
                wschuller 1 Reply Last reply Reply Quote 0
                • Nightowl
                  Nightowl @JoergS5 last edited by

                  @JoergS5 said in Unable to control Spindle with Duet 2 WiFi:

                  @markz said in Unable to control Spindle with Duet 2 WiFi:

                  u can get a PWM->Analog converter cheap

                  as in section connecting a spindle, https://docs.duet3d.com/User_manual/Machine_configuration/Configuration_CNCnotes it is better to buy the green PCB version, not the blue one, because the green one is opto-coupled, the blue one not.

                  This is the one I got for mine.

                  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
                  • wschuller
                    wschuller @Nightowl last edited by

                    @Nightowl said in Unable to control Spindle with Duet 2 WiFi:

                    this link

                    Thanks Nightowl, I have one of those Chinese 500w spindle motors, however, I have upgraded to a safer PSU and wired as per the Youtube link in my original post. The only difference is he uses a generic GRBL board and I am trying to connect the Duet 2 WiFi.

                    1 Reply Last reply Reply Quote 0
                    • wschuller
                      wschuller @markz last edited by

                      @markz Thanks for your reply, yes I have one of the GREEN PWM converters as specified in the Duet documentation mentioned. Sorry, I may have confused everyone calling it the Spindle Controller above.

                      1 Reply Last reply Reply Quote 0
                      • wschuller
                        wschuller @JoergS5 last edited by

                        @JoergS5 thanks for the link. I am using the GREEN PWM Converter shown.

                        JoergS5 1 Reply Last reply Reply Quote 0
                        • JoergS5
                          JoergS5 @wschuller last edited by JoergS5

                          @wschuller I have one additional comment, but you will probably already know it. The chinese spindles often have very bad grounding (or worse, the ground connector is not connected to the housing at all), in CNC forums are reports that they often need resoldering. If you'not done it, better measure that grounding works correctly.

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

                            @o_lampe thanks for the assistance. I tried all combinations of adding pull up resistor and inverting the signal and found no change. I will need to double check wiring, continuity, polarity etc and find out how to test devices such as the PWM converter, as I don't have an oscilloscope. Diving further down the rabbit hole!!!

                            1 Reply Last reply Reply Quote 0
                            • wschuller
                              wschuller @JoergS5 last edited by

                              @JoergS5 do you mean the PSU supplied with the spindle has bad grounding or do mean the actual spindle motor itself?

                              JoergS5 1 Reply Last reply Reply Quote 0
                              • wschuller
                                wschuller last edited by

                                I have just been performing my happy dance for the last half hour having solved my particular dilemma. I changed from using heater pins to fan 1 & 2 and voila it all worked. I can only suggest that I have damaged the E0 & E1 terminals over tightening them with all the failed attempts over the last year.

                                A big thank you to those providing assistance. 🙏 It clearly prompted me to try different things, which led to the breakthrough.

                                I understand it is difficult to diagnose issues remotely as you have no idea what state all the parts in the puzzle are in, nor all the pieces are present.

                                From my experience with this issue I have found it difficult to be 100% certain I have used all the correct devices, wired it up correctly and generated the correct code, as everything I tried from other posts failed, until today. I now know my devices, wiring and code are spot on.

                                I would like to create a solution page similar to this link: https://learn.ooznest.co.uk/Guide/Connect+a+AMB+Kress+or+Mafell+spindle+with+digital+control/161

                                If anyone has a suggestion as to where that should be posted, please let me know so I can create the solution to assist others.👍

                                1 Reply Last reply Reply Quote 1
                                • JoergS5
                                  JoergS5 @wschuller last edited by JoergS5

                                  @wschuller said in Unable to control Spindle with Duet 2 WiFi:

                                  actual spindle motor itself

                                  I mean the spindle itself. The housing is often not grounded correctly, see e.g. https://www.cnczone.com/forums/spindles-vfd/426990-cnc-forum.html and I mention it because it dangers life if not grounding. User mactec54 with black humour "This what they call in China population control. No Earth Ground Required". There is an additional danger, that aluminium oxidizes after a few minuts and is an isolator, so an aluminium holder is e.g. not useful for grounding.

                                  o_lampe wschuller 2 Replies Last reply Reply Quote 0
                                  • o_lampe
                                    o_lampe @JoergS5 last edited by

                                    @JoergS5
                                    I want to clarify the terms used here:
                                    "Erde" = PE (protection earth)
                                    "Masse" = GND (ground)

                                    Worldwide, there are gazilion electronic housings not grounded, because they are plastic. But upwards from a certain power level the 230V/110V mains connector has to have PE.

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

                                      @o_lampe thanks for clarifiying. In the CNC forum are some discussions about plastic, special rules for new zealand etc. I just wanted to warn, because it can harm health (very much!).

                                      1 Reply Last reply Reply Quote 0
                                      • Referenced by  Nightowl Nightowl 
                                      • wschuller
                                        wschuller @JoergS5 last edited by

                                        @JoergS5 said in Unable to control Spindle with Duet 2 WiFi:

                                        https://www.cnczone.com/forums/spindles-vfd/426990-cnc-forum.html

                                        Thanks, yes the 48v power supply I am using is earthed and I am using a dc spindle.

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