Duet 2/3 for CNC vs other controllers



  • Hi

    I have 3 project at the moment

    1. A Railcore inspired printer running Duet 3
    2. A small diode laser running duet 2 wifi
    3. A CNC Where I did plan to use a Pokeys57CNC controller + Mach4

    My question is - should I use Duet 2/3 on my CNC?

    What software?FB_IMG_1582311458423.jpg FB_IMG_1582311447512.jpg



  • Fusion 360 for CAD/CAM and straight to duet.
    (I moved from LinuxCNC + G540 to Duet3, and while LinuxCNC beats the Duet3 hands down for things like tooling and work offsets, probing and macros, RRF3 is chatching up and I wouldn't go back to LinuxCNC unless someone made a CAN controller that worked with Duet3 expansion boards, then I might consider it. Parallell port is a thing of the past and the other options is pricy or s%¤#&y



  • OK, strong opinions here... CNC setups (and I've run every one of these):

    Mach = "so last millenium, dude". Ick. Anything but that.

    TinyG + Chillipeppr = OK, except development stopped (on TinyG), so you have to live with certain bugs.

    CNCjs = Really designed to run from the web... can run "Electron" so it is all self contained on a PC. OK-ish when running Electron. A bit bloated (electron's fault).

    Duet 2 = OK. DWC UI is very not-oriented to CNC work. Other UIs available, but it is all a little bit awkward, Duet is really 3D Print centric.

    Duet 3 = I haven't tried it.

    PlanetCNC = What I'm running now.

    Very happy with PlanetCNC imbedded board, plus a Pi for User Interface. Run a Pi 3B (NOT plus) or a Pi 4. Pi 3B+ has subtle USB problems and PlanetCNC connects that way. VERY stable with their board + Pi4.



  • Another opinion here...

    Hardware-wise the Duet should be capable enough of running a small CNC.

    Software-wise, meh. On the controller side things like circle interpolation by splitting in 0,2mm or so segments are not even close to good enough for milling metal or hard plastic, it misses G64 mode where corners are rounded but speed is kept constant as much as possible, etcetera.

    On the UI side I miss a decent CNC-oriented UI where I can easily probe and touchoff workpiece coordinates and work with coordinate systems, jogging with a MPG/handwheels, the option to smack in a few parameters and mill a hole or flatten a surface, a preview, etcetera.

    Price difference between Duet and a regular CNC-controller is not that large either, and imho quite insignificant once you calculate all the costs to operate a CNC. The machine is either not cheap to build or you will find yourself building another one in a year or two making it a buy cheap - buy twice exercise, and once you have all the tooling required to comfortably mill the price has doubled. The price difference for the electronics drowns in this.

    The largest difference is that Duet has builtin stepper drives, a CNC-controller needs external ones. Which is not that bad; something like Leadshine DM runs the steppers far better than the drivers on the Duet2. Cannot speak for Duet3, but I do not expect those to be 'Leadshine DM / Gecko / etc' level either.



  • I have DM 856 drivers for the cnc buil!
    FB_IMG_1582319371755.jpg FB_IMG_1582319312884.jpg


  • administrators

    @DaBit said in Duet 2/3 for CNC vs other controllers:

    On the controller side things like circle interpolation by splitting in 0,2mm or so segments are not even close to good enough for milling metal or hard plastic...

    RRF was changed a few versions ago so as to use smaller segments than that when moving slowly, specifically at the request of CNC users. If it's still a problem, I'm sure we can fix it.

    The largest difference is that Duet has builtin stepper drives, a CNC-controller needs external ones. Which is not that bad; something like Leadshine DM runs the steppers far better than the drivers on the Duet2.

    In what way(s) do those drivers run the motors "far better"? Assuming you are not just referring to maximum voltage and current.



  • @dc42 said in Duet 2/3 for CNC vs other controllers:

    RRF was changed a few versions ago so as to use smaller segments than that when moving slowly, specifically at the request of CNC users. If it's still a problem, I'm sure we can fix it.

    In metals and hard plastics such as POM deviations and banding far below 'fingernail-detectable' are already visible. In reality this means that the segments must be short enough to become blended into a continuous curve by the mechanical lowpass action of the motion system.

    My fairly heavy (gantry+Z weights 125kg or so) LinuxCNC-driven mill has a cutoff at ~20Hz (I actually ran sine sweeps through the motion system), but interpolating at less than 500Hz becomes visible. I am running at 7kHz 'servo-thread' which does the interpolation, but the servo thread being that high has another reason.

    Therefore I would say that a fresh linear segment must be generated every 2ms or faster.

    For good surface finish and decent endmill life there is also not such a thing as 'slow milling'. Endmills are like babies; you have to feed them enough otherwise they start crying.
    Regarding cutting speed: there is a heavily disproportional relation between cutting force and cutting speed; at higher speeds relatively little force is required to shear off a chip. For aluminium, at 1m/min cutter speed it takes force X to shear off a chip, at 200m/min it takes 5X or so. Numbers are fictional but not that far off, real graphs can be googled.

    Regarding feed: the chips carry away the heat. If you feed too little, the cutter rubs, a welded edge builds up, and cutter life is low. And even though the bulk of the cutter itself might not become very hot, that is not the case for the actual cutting edge.

    Also, carbide cutters hate shocks. Thus, it is necessary to keep the speed constant as much as possible, and in the process window. Consistent force, consistent loading, consistent deflection, consistent shiny mirrorlike finish.

    In what way(s) do those drivers run the motors "far better"? Assuming you are not just referring to maximum voltage and current.

    More silent, less vibrations, less torque dropoff at higher RPM, higher sustainable RPM.

    That really has to be experienced, some things cannot be captured in words well. If you never did so, I can highly recommend to grab a genuine Leadshine DM442 or so off Ebay, make sure you (auto)tune it with the motor mounted, and try it. There is some magic inside that TI DSP they use.

    I once built my own drives using a dsPIC33F, nice PI phase current control, 80kHz PWM rate, phase advance to keep a 90-degree relation between winding current and rotor electrical position, notch filters to cope with midband resonance, morphing to fullstep operation, blah.
    They were decent, but not as good as Leadshine DM drives.


  • administrators

    @DaBit, thanks for the feedback.

    For good surface finish and decent endmill life there is also not such a thing as 'slow milling'.

    When I said that RRF reduced the segment size at slow speeds, I meant slow in comparison to 3D printer speeds. I wasn't trying to suggest that you should need to slow down the milling speed to get small segments.

    Also, carbide cutters hate shocks. Thus, it is necessary to keep the speed constant as much as possible, and in the process window. Consistent force, consistent loading, consistent deflection, consistent shiny mirrorlike finish.

    I don't see any reason why RRF wouldn't maintaining a constant speed at CNC milling speeds. The only times when it can't is (1) when cornering and the combination of speed and sharpness of the corner would exceed the jerk limit, and (2) when there is a large number of consecutive insanely short segments in the incoming GCode, although I've not had any reports of that happening for a couple of years.

    More silent, less vibrations,

    What speeds are we talking about here?

    less torque dropoff at higher RPM, higher sustainable RPM.

    That comes with allowing higher voltage. Does the stepper motor RPM get that high in CNC machines that higher voltage is needed? I guess it might if you are use fine-pitch screw drive, with a consequently high steps/mm.

    That really has to be experienced, some things cannot be captured in words well. If you never did so, I can highly recommend to grab a genuine Leadshine DM442 or so off Ebay, make sure you (auto)tune it with the motor mounted, and try it. There is some magic inside that TI DSP they use.

    Interesting, does the auto tuning detect the mid-band resonance and somehow dampen it?



  • @dc42 said in Duet 2/3 for CNC vs other controllers:

    When I said that RRF reduced the segment size at slow speeds, I meant slow in comparison to 3D printer speeds.

    Recent router-type CNC-mills built from aluminium profiles built at the cnczone.nl forum do 12m/min (200mm/s) rapids and milling in softer materials at 3-6m/min (50-100mm/s) with accelerations between, say, 500mm/s^2 and 2000mm/s^2.

    IMHO that is comparable to 3D printer speeds.

    Personally I do rapids at 20m/min (333mm/min), milling of aluminium up to 15m/min (250mm/s), steel up to 4m/min, wood milling speed is limited by the amount of debris I can process. Acceleration is limited to 4000mm/s^2 otherwise the machine starts walking around. But I am running servos (old -10..10V types, hence the high LinuxCNC servo frequency; I do the positioning in LinuxCNC) on the X and Y axes, so not completely fair. On the other hand, the price of those keep dropping with 100-200W types already at or below 150 euros, so they are becoming a viable option even for low-end CNC mills.

    I don't see any reason why RRF wouldn't maintaining a constant speed at CNC milling speeds. The only time when it can't is when cornering and the combination of speed and sharpness of the corner would exceed the jerk limit.

    If circle interpolation (G2/G3) is good enough I think it should be able to keep the speed constant.

    However, I am not sure the 3D-printer-style jerk is good for CNC-milling. At the moment the motion 'jerks' the load on the cutter changes.
    LinuxCNC inserts a tangent arc between linear segments at an angle with a radius that does not violate a maximum deviation and acceleration limit. Of course, if deviation is low and the corner is sharp the machine has to slow down. And if you don't set a maximum path deviation a square ends up as a circle.

    What speeds are we talking about here?

    NEMA23 motors: up to 1500rpm or so. Not much torque left at that point though.
    NEMA34 drops off much quicker.

    That comes with allowing higher voltage. Does the stepper motor RPM get that high in CNC machines that higher voltage is needed? I guess it might if you are use fine-pitch screw drive, with a consequently high steps/mm.

    48-75V is quite normal for 2-3Nm holding torque NEMA23's

    Interesting, does the auto tuning detect the mid-band resonance and somehow dampen it?

    Autotuning at least measures motor inductance and resistance and uses that to optimize the (assumed PI) current control loops.
    I am quite certain they use some form of viscous damping; the NEMA23 steppers on my 3D printer suffer noticeably from midband resonance when driven by the Duet2 which they don't when driven from Leadshine drives.

    But for detecting and migitating resonance it is probably more effective to look at the phase current/voltage waveforms dynamically. Resonance affects BEMF, fairly easy to measure. But then again you need to know the inductance and resistance of the windings to counter that with the correct phase, hence the tuning.

    Hardware-wise those drives consists of 2 H-bridges with gate drivers and current measurement, a TI C5000 DSP doing the heavy lifting, a flyback supply for the logic and some optoisolators for the step/dir/enable/fault signals. And some switches and an RS232 port to setup the drive. Really not that much, all the intelligence is in software. Which is why you should get genuine drives; the same hardware with 'TI's appnote' in the controller won't work as well and Ebay/Ali is flooded with those.



  • @DaBit thank you for an interesting reflection on what I assume has been your journey into low cost CNC and the motion control limitations and issues. There is an ongoing shift away from 'industrial' closed loop AC servo drives for light duty machines because of cost. We see Leadshine respond to that with various hybrids of stepper and servo. These are quite good ideas - combine the low cost of laminated pole stepper motors and the ability to avoid a backlash-inducing gearhead or reduction gearing, with refined drives and 4000 tic/rev position feedback. Add step/direction interfacing which still dominates the low end of CNC and automation. And provide local fault monitoring for overtemperature/rotor blocking/undervoltage. This avoids servo tuning, the cost of high bandwidth encoder counting/decoding at the motion controller (Duet card), resonance-free motion, class-leading cost/axis and (it is claimed by Leadshine) sometimes also faster settling times in point to point motion.

    @dc42 If Duet 3 is headed into CNC motion control, the codebase will evolve over time, but D I/O optoisolation (via optional CNC-specific tool boards) and CNC compatible signal interfaces and - in time - axis position registers with 6 MHz input channel bandwidth will have to appear. If the ambition is to go beyond hobby-level machines.

    What I'd like to see in the near term is a refined step/dir interface for CNC drives and +/- 10Vdc optoisolated D I/O, including example integrations of a few popular drives from Gecko, Leadshine and the like. Implementing this as a compact CAN connected 2-axis toolboard would be a good cost-containment strategy, not least because of the beneficial effect on wiring and connectorisation costs which are frequently substantial.


  • administrators

    @Tony-Owens said in Duet 2/3 for CNC vs other controllers:

    What I'd like to see in the near term is a refined step/dir interface for CNC drives and +/- 10Vdc optoisolated D I/O

    Why 10V? All the external drivers I've seen say that 5V is sufficient. Are there higher end ones that need 10V? And don't these drivers all have optoisolators built into them already?



  • @dc42 said in Duet 2/3 for CNC vs other controllers:

    @Tony-Owens said in Duet 2/3 for CNC vs other controllers:

    What I'd like to see in the near term is a refined step/dir interface for CNC drives and +/- 10Vdc optoisolated D I/O

    Why 10V? All the external drivers I've seen say that 5V is sufficient. Are there higher end ones that need 10V? And don't these drivers all have optoisolators built into them already?

    I'm driving Gecko with 3.3V. They are driving Nema23s at 70V



  • @DaBit thank you for an interesting reflection on what I assume has been your journey into low cost CNC and the motion control limitations and issues.

    Personally I converted a BF20 (G0704) mill to CNC, designed and built my own CNC-mill, converted an Emco lathe to CNC and designed&built my 3D printer. On top of that I have helped out many people with machines varying in size, 'professional-ness' and control.

    I started out with LinuxCNC, and sticked with it. The flexibility offered to make things work the way I want them to work is unparallelled. The 'smart PC, dumb hardware' concept is powerful, especially when combined with the ease of LinuxCNC HAL.

    On my CNC-machine I am running a mix of -10..10V analog servo's and steppers, 1um resolution linear scales for compensation of positioning errors and a Danfoss VLT5008 inverter controlled over RS485, a small compensation for the angle between Z and Y not being exactly 90 degrees, etcetera. No way I could have done all that with Mach3/4, EdingCNC, PlanetCNC, or Duet.

    User interface is a second thing. In LinuxCNC it is very easy to add a panel for control of your vision camera, probe, flux capacitor, whatever.

    There is an ongoing shift away from 'industrial' closed loop AC servo drives for light duty machines because of cost. We see Leadshine respond to that with various hybrids of stepper and servo. These are quite good ideas - combine the low cost of laminated pole stepper motors and the ability to avoid a backlash-inducing gearhead or reduction gearing, with refined drives and 4000 tic/rev position feedback. Add step/direction interfacing which still dominates the low end of CNC and automation.

    My personal opinion is that step/dir is a less than optimal choice for servo control. A servo driven by step/dir is always running with a positioning error since it is always behind. A missed step (no communication channel is error-free) is never corrected. Actually, the control has no idea at all what the actuators are doing.

    With my (analog-driven, torque-mode) servo's I can feed-forward acceleration and speed. The trajectory planner knows that it wants to accelerate or decelerate an axis, which can be translated into an instantaneous request for extra torque. Makes accurately following the programmed path so much easier. Keeping the stepper-driven Z position synchronous with the servo-driven XY within 10um was a royal pain in the ass; stepper motors need to build up a load angle for a given torque, and you cannot send a multi-MHz stepping pulse train into the average drive to quickly build up load angle.
    Closed-loop steppers (those were not available at that time anyway) do not solve this; many of them function as open-loop drives as long as the positioning error is smaller than 2 steps or so.



  • @dc42 You are right David. I was thinking about analog industrial DAQ signal levels for some reason, not digital signals. Automation digital I/O signals were traditionally 24Vdc PNP in Europe, designed to interface to current-sinking controllers (tool board or Duet), because 24Vdc is the common power supply for most low voltage control gear.
    I know that CMOS has pushed down the required logic levels of I/O signalling in some equipment.
    In any case, what would be best would be to:

    1. avoid the need for voltage level-shifting by the user of the tool board
    2. provide I/O protection (of the controller, not the driver)
    3. avoid the need for providing filtration or snubbing capacitors etc
    4. to stick with the bootlace ferrules and screw terminals that are still common for field wiring in the industrial controls industry.
      Obviously what I'm getting at here is the difference in mentality around issues of reliability and availability in the CNC and automation world compared with consumtronics gear. In a situation where a machine is 'printing money' for the user, installation and maintenance has to be slight and slick!


  • @DaBit Your comments about the limitations of open-loop drives of whatever sort, and the consequences of a mis-sent step (EMI/RFI?) are absolutely true and limit what cheap CNC/automation systems can do. Proper servo's are obviously more ideal in highly dynamic applications. But they have a cost and complexity premium, and for a large class of apps are unnecessary.
    I'm very impressed at the range of machine projects you have been involved with. When it comes to flexibility and capability I'm sure LinuxCNC is the best approach short of high end motion controllers (Trio, Galil, Delta Tau) and proprietary CNC packaged systems from Siemens and Fanuc



  • If you are going to use external motor drives of whatever sort I don't see much benefit in using a Duet. Duet cannot interface things as inverter drives and 24VDC-fed proximity switches conveniently, and it lacks serious EMI protection on the inputs.
    A $200 Mesa 7i76E is a very capable and robust I/O board for use with LinuxCNC and step/dir drives, Eding/UCCNC/PlanetCNC/Mach3/Mach4 hardware is priced similar or less. Hard to compete with that, and the software is designed from day one to control CNC machines.
    Sure, those need a PC to run, but you need one to run a Duet also. CNC-machining is a bit more work than level bed-load filament-preheat-print. Which is the exact reason why I am quite happy with my 3D printer; so little work to create a part.

    As an all-in-one package for the lower end CNC-mills it is useful, although I don't think that DWC is the most ideal UI and there is still no convenient connection to a motor speed regulator or inverter.
    In that case, you can pick the surrounding components so they work well with Duet. Use 3d-printer endswitches and probes instead of the usual 24V stuff, for example. In that case, not much need for additional 24V-capable I/O and 0-10V/4-20mA inputs.



  • @DaBit said in Duet 2/3 for CNC vs other controllers:

    A $200 Mesa 7i76E is a very capable and robust I/O board for use with LinuxCNC and step/dir drives, Eding/UCCNC/PlanetCNC/Mach3/Mach4 hardware is priced similar or less. Hard to compete with that, and the software is designed from day one to control CNC machines.
    Sure, those need a PC to run,

    Actually, PlanetCNC doesn't need a PC (and would not work with Mach or LinuxCNC or anything where the parser and motion planner is in the PC). Since the parser, motion planner, etc, is on the board, it just needs something to run a UI. That can be Windows, Linux, or Raspberry Pi. The Pi in particular can be fanless and with the right screen/keyboard/mouse (or emulation, like a touchscreen) it makes a great HMI in a home or small business shop setting. Good balance of function v price.



  • @Danal ...have you tried the Ooznest user interface on the Duet?... it's CNC oriented. I found that, and because the framework they made it with is my day job, I'll be playing with it as my next cnc update, super looking forward to it.



  • I have not. Next time I mess with CNC, I will give it a look

    Thanks!


Log in to reply