Unable to control Spindle with Duet 2 WiFi
-
@wschuller
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? -
@wschuller can you post an output of M115 so we can see which firmware version you are running?
-
@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.
-
@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.
-
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!
-
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.
-
@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.
-
@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
-
@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.
-
@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.
-
@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.
-
@JoergS5 thanks for the link. I am using the GREEN PWM Converter shown.
-
@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.
-
@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!!!
-
@JoergS5 do you mean the PSU supplied with the spindle has bad grounding or do mean the actual spindle motor itself?
-
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.
-
@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.
-
@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.
-
@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!).
-
-
@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.