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

SuperPID Spindle Controller with Duet WiFi v2.x

Scheduled Pinned Locked Moved
CNC
4
18
1.2k
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
    GeorgeM
    last edited by 25 Oct 2020, 13:51

    I use the PID, although not with Duet. In my gcode it uses M3 to start and M5 to stop. This is from aspire.

    undefined 1 Reply Last reply 25 Oct 2020, 14:02 Reply Quote 0
    • undefined
      FelixH @GeorgeM
      last edited by 25 Oct 2020, 14:02

      @GeorgeM thanks for your input. Could you eleborate? I only known of PID regarding the heater's calibration...

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User
        last edited by 25 Oct 2020, 14:18

        PID in the SuperPID is RPM control of the spindle (adjusts the power to keep RPM constant with varying load), but seems George is controlling RPM manually and not from the Duet methinks.

        undefined undefined 2 Replies Last reply 25 Oct 2020, 14:26 Reply Quote 0
        • undefined
          FelixH @A Former User
          last edited by 25 Oct 2020, 14:26

          @bearer said in SuperPID Spindle Controller with Duet WiFi v2.x:

          PID in the SuperPID is RPM control of the spindle (adjusts the power to keep RPM constant with varying load), but seems George is controlling RPM manually and not from the Duet methinks.

          oh, ok. Of course. I was totally lost on translation there... 🤦

          1 Reply Last reply Reply Quote 0
          • undefined
            GeorgeM @A Former User
            last edited by 26 Oct 2020, 13:33

            @bearer said in SuperPID Spindle Controller with Duet WiFi v2.x:

            PID in the SuperPID is RPM control of the spindle (adjusts the power to keep RPM constant with varying load), but seems George is controlling RPM manually and not from the Duet methinks.

            Not true - but as I said in my post I'm not using the duet. I am using UCCNC. I was merely trying to point out that auto speed adjustment works for me using the M3 and M5 commands in the post processor and maybe he could use that rather than M106 / 7.

            1 Reply Last reply Reply Quote 0
            • undefined
              FelixH
              last edited by 26 Oct 2020, 20:24

              thanks for the clarification 👍

              1 Reply Last reply Reply Quote 0
              • undefined
                FelixH
                last edited by 1 Nov 2020, 09:25

                just an update if somebody else is looking into that sometime...

                I got it finally working. After a heavy brainstorming with some buddies and getting nowhere, yesterday I just saw that I connected the cables wrong on the relay... :epicfacepalm:

                Next step is to control the speed with the other fan output.

                Now my question would be, how would I have to made the connection to the Duet in order to use the industry standard gcode commands such as M3 to control the spindle? I can modify the Fusion 360 post processor, but I'd like to have it as standard as I could.

                ? 1 Reply Last reply 1 Nov 2020, 13:07 Reply Quote 0
                • ?
                  A Former User @FelixH
                  last edited by 1 Nov 2020, 13:07

                  @FelixH said in SuperPID Spindle Controller with Duet WiFi v2.x:

                  Now my question would be, how would I have to made the connection to the Duet in order to use the industry standard gcode commands such as M3 to control the spindle? I can modify the Fusion 360 post processor, but I'd like to have it as standard as I could.

                  use cnc mode to map the pwm output to rpms, and then use m3/m5?
                  https://duet3d.dozuki.com/Wiki/Gcode#Section_M453_Select_CNC_Device_Mode

                  undefined 1 Reply Last reply 1 Nov 2020, 15:15 Reply Quote 0
                  • undefined
                    FelixH @A Former User
                    last edited by 1 Nov 2020, 15:15

                    @bearer cool, thanks! I will have to read it with patience and time though... a lot of info going on. I miss more examples on the Gcode Wiki...

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      FelixH
                      last edited by 2 Nov 2020, 23:21

                      Well, before I change anything else and now that the ON/OFF control of the router works, I wanted to try the Duet-PWM-Controlled speed, according to the following diagram:

                      Screenshot 2020-11-03 at 00.12.30.png

                      I routed the (+) wire of the FAN2 of the Duet to the PWM port of the SuperPID (they share GND). I also bridged the VS with the POT ports as depicted.

                      I turn ON the router and right again it goes full blast at 30000 RPM. When I issue a M106 P2 S0 command, nothing happens. It keeps going at 30000 RPM. I tried S128 and even S255 on that command, but nothing changes.

                      Any ideas?

                      1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User
                        last edited by 3 Nov 2020, 00:08

                        The + wire of the FAN2 output is always Vfan, the switching happens on the negative side.

                        Depending on the type of input you may need a pull up resistor, like 10k between the PWM and +5v terminal on the superpid (and use the Fan2- output). You might also need to invert the output from the Duet.

                        If you measure the voltage at the PWM terminal with the wire disconnected and see 0V you'll need to add a pull up.

                        undefined 1 Reply Last reply 3 Nov 2020, 10:21 Reply Quote 0
                        • undefined
                          FelixH @A Former User
                          last edited by 3 Nov 2020, 10:21

                          @bearer thanks a lot for pointing that out! I was very confused! It works nicely now, although inverted, the higher the PWM the slower the router is. But I think I found out where to invert it. Now I have to find out how can I relate PWM and RPM, as I think the M§ command needs RPM as a R argument... I'll keep investigating

                          ? 1 Reply Last reply 3 Nov 2020, 12:12 Reply Quote 0
                          • ?
                            A Former User @FelixH
                            last edited by 3 Nov 2020, 12:12

                            @FelixH no prob! Feel free to share your relevant config for the spindle control, I'm sure others will benefit of looking for the same.

                            I'm occasionally drooling on superpid myself, but a tad pricey and not sure spindle gets sufficient cooling at low rpm?

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              FelixH
                              last edited by 3 Nov 2020, 12:39

                              I got it working quite easily actually. Now I can use the M3/M5 commands and control the RPMs by gcode, which is amazing. As soon as I can, I will post a manual or tutorial somewhere. I think it'll be worth, as I have been sourcing information from all over the place. If I can make it easier for the next one, all the better.

                              Yeah, it is not cheap, but cheaper than a spindle, with its PSU and a set of collets and what not. Also, real spindles are also heavier.

                              Regarding the cooling, the lowest RPM is 5000, which is actually quite fast, I think. I will make some tests and report back, but do not expect it any time soon, as I will be a couple of days "off-duty."

                              1 Reply Last reply Reply Quote 0
                              • undefined
                                FelixH
                                last edited by FelixH 12 Mar 2020, 16:38 3 Nov 2020, 17:17

                                So, as promised the following is what I've done to get my SuperPID working flawlessly with my Duet Wifi 2.

                                The wiring schematic is as follows (please don't mind the inaccuracy of standard symbols):

                                SUPER-PiD.png

                                The ON/OFF is accomplished using the FAN0 (-) pin to ground the RUN port on the SuperPID.
                                The router RPM of the router is controlled by the (-) pin of the FAN1.

                                On the config.g file on the Duet a file named customconfig.g is called in which customizations are done without modifying the main config.g file. On this file I added the following lines, which configure the FAN1 as the "Tool 0" pin and set the RPM for a max PWM signal (255). It also inverts the PWM signal, so that the more PWM the more RPM:

                                M106 P1 I-1 H-1 A21 ; disable FAN2 & allocate Tool 0 to pin 21
                                M563 P0 S"Spindle" ;
                                M453 S"Spindle" P21 I1 T0 R30000; , Tool 0 = Spindle, invert PWM, 30000 RPM at max PWM

                                To turn ON the router:

                                M106 P0 S255
                                

                                To turn OFF the router:

                                M107 P0
                                

                                To set the RPMs:

                                M3 S15000  ; Set the router speed at 15000 RPM (PWM aprox 128)
                                

                                References:

                                • https://forum.duet3d.com/topic/13355/cannot-turn-spindle-on-using-m3
                                • https://duet3d.dozuki.com/Wiki/Using_servos_and_controlling_unused_IO_pins
                                1 Reply Last reply Reply Quote 1
                                • undefined FelixH referenced this topic 4 Dec 2021, 10:25
                                13 out of 18
                                • First post
                                  13/18
                                  Last post
                                Unless otherwise noted, all forum content is licensed under CC-BY-SA