Duet 3 DC motor control & Tacho Feedback?
-
Hello,
I found this snapmaker CNC tool 2nd hand and I want to use it on a small CNC mill.
I'll be using a Duet 3.
The motor itself is supposedly 50W at 24v, and I cannot find any more details online, so far.
There's a daughter board nearby with the power and other connections (possibly CAN-based?):
- PWM (guessing speed control)
- DIR (not sure how this would be handled by duet..)
- FG (Frequency Generation - possibly a hall sensor?)
- NC (I'm assuming "no connection" on this one)
In principle, do you think I can control this motor directly from the board (power, speed control and feedback?)
I see some docs which recommend using a flyback diode.
Some also recommend a not sharing ground connection between duet and the motor.
Any advice is appreciated!
-
-
@HebigT Which Duet 3 are you using?
I had a Google around, but there's really very little info on this spindle as far as I can see. The best info seems to be in the snapmaker forums, ie https://forum.snapmaker.com/search?q=cnc %23snapmaker-20
I found this thread where someone had take the module apart, and has some information: https://forum.snapmaker.com/t/cnc-spindle-not-running/24696
Someone replied:The FG pin is the frequency generator internal to the motor that tells the machine how fast the spindle is actually going and is irrelevant to what you need.
So the FG pin is the tacho, but you'll need to put an oscilloscope on it to check the voltage and signal, I would guess, once you get the spindle turning. If it's within specs, you could set up a dummy fan and connect this to a the dummy fan's tacho input. While the Duet can accept a tacho input, it would need to conform to the Intel PC fan specification, which expects 2 Pulses Per Revolution (PPR) from the tacho, and the RPM reading calculated assumes that.
The PWM pin should set the spindle speed. The thread above talks a lot about 5V and 3.3V traces on the board; try 3.3V PWM, then 5V if it doesn't work. Try using the Laser/Servo/VFD pin, which provides a 5V PWM signal. All other PWM signals switch on the ground side, so you need a circuit to pull them up to whatever voltage you need to drive the PWM signal. Also try different PWM frequencies (Q parameter in M950).
Again, you'll have to play around with the Direction pin. I guess it's either high or low. So leaving it disconnected should get it spinning one way. Applying a voltage would, I imagine, make it spin the other way. Though it's also possible it is an enable pin, so needs a voltage to work.
For testing, you could set up a PWM pin to drive the motor only. Use M950 to create an output (use the Laser/Servo/VFD pin) and control it with M42. See https://docs.duet3d.com/User_manual/Connecting_hardware/Motors_servos#connecting-dc-motors
For actual configuration, see M950 and M453. There's also this page: https://docs.duet3d.com/User_manual/Machine_configuration/Configuration_CNC
Ian