SuperPID Spindle Controller with Duet WiFi v2.x
-
thanks for the clarification
-
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.
-
@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 -
@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...
-
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:
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?
-
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.
-
@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
-
@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?
-
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."
-
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):
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:
-