SuperPID Spindle Controller with Duet WiFi v2.x
-
Hi @bitminter have you done any progress?
an update on my part, which is not very promising.
A couple of days ago I finally had time to get on the SuperPID implementation. What I did first was to modify my Dewalt 611 (european version, that is) router. So far so good, I've been able to implement the IR "encoder".
I setup the board with the "easy" connection. That is I implement a switch between the GND of the SuperPID and the RUN port (see pictures below). Again, so far so good. I can turn the router ON and OFF and I can control the speed with the potentiometer. Great.
The problem arises when I want to be able to turn in ON and OFF via Duet. That is with Gcode commands generated with the Fusion 360 Post-Processor. To do that, I built a small mechanical relay. The coil side of the relay is connected to FAN0 of the Duet (still running RRF 2 from the folks at Ooznest). I put the fan jumpers on the 5v position since the relay is a 5v one.
I tested it without router and it works as expected:M106 S0 P255 ; turns relay ON M107 S0 ; turns relay OFF
I can hear the relay switching On and OFF as I send the macros. No problem.
A rough schematic of the setup would be as follows (not actual standard symbols, sorry):
When I plug the router is when the problem shows up. The router begins switching ON and OFF without any human input. After a couple of seconds of powering everything up, the router starts to spin. After a couple of minutes it stops and it keeps the loop. It doesn't matter if I send the M107 S0 command. I also measured the voltage on the coil side of the relay (the Duet fan "port") and is consistent with my Gcode commands, but the router has a mind on its own.
I also tried to connect both GNDs (red on my diagram) but it doesn't have any effect. Finally, a capacitor between the coil terminals does not have any effect either.Maybe somebody more knowledgeable than myself can help out?
Thanks in advance!
-
I use the PID, although not with Duet. In my gcode it uses M3 to start and M5 to stop. This is from aspire.
-
@GeorgeM thanks for your input. Could you eleborate? I only known of PID regarding the heater's calibration...
-
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.
-
@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...
-
@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.
-
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:
-