Duet 2 Wifi for CNC Router Machine?

Pros Cons
> Good quality controller with fuses and lots of terminals.

> Drivers have advanced features including stall-guard and interpolation

> Good support and forum

> Easy to programme using System Directory and Macros

> Ability to set up dual axis homing – used to square machine.

> Programmable input triggers

> M291 can be used as a safety feature to add second click before executing macro.

> Requires external PWM to analogue converter for frequency drive RPM controller.

> No programmable spindle enable pin although reported in next firmware version.

> Web interface does not cater to CNC use.

> Macros or commands in the web interface load into series and perform one after the other – which doesn’t feel safe.

> Resume button doesn’t behave as expected if running interpolated G-code.

This is the latest machine that I’ve built. It’s a slightly newer design and I’m actually using valchromat for the plates. I’ve also moved to reprap and in particular the duet 2 controller which I was sent by Ooznest to try out.

So this is what the board looks like. It’s the Wifi version and there’s several fuses which is a good sign. And there’s lots of terminals.

I spent some time getting to know the controller – testing out the connections, learning how to programme it and working out its limitations. I decided it was good enough to keep going with but there’s room for improvement. I’ll talk a little more about that later after I’ve showed off my new-fangled CNC machine.

The machine uses SFU16 ballscrews which are a size up from the previous machine but I’m still using the same MGN12 linear rails as before. That said I’m getting some quite impressive speeds. I’m managing over 2000mm/min with an acceleration of 100mm/sec. And just to compare this with the old machine which runs at 900mm/min with 40mm/sec acceleration.

I’ve set it up with the pen tool to do some drawings. It’s a quieter way to testing the machine without cutting anything. I also like drawings with the CNC machine and hope to do more of this.

I’m using a bigger enclosure for the duet, with programmable buttons. The first moves to the stationary probe location, and the second moves to the datum position. The others are the resume job, pause job and hard stop. All of the buttons have programmable triggers apart from the hard stop which bridges the reset pins on the expansion header. There’s also an emergency stop or off button which kills the power to the entire enclosure.

The duet is under here. I’ve got larger air fans and a fan on top to keep everything cool. I’m running everything through an opto isolated series of relay modules. This thing over here is a PWM to 0-10v analogue converter.

Lets go back to voiceover mode, so you can hear me. There’s still a bit of development needs to cater the duet for CNC use. For example I have to use the analogue converter to change the 0-24v pwm from the Duet to a 0-10v signal that the frequency drive can interpret into RPM spindle speed. There’s also as-of-yet no spindle-enable signal on the controller, but I’m assured this will be implemented in the next firmware update.

And that’s another thing worth mentioning. The forum is responsive, and I do get the impression that the firmware will evolve in line with its users requirements. So the more CNC users get on board – the better it might become.

I’ve been playing around with my Duet 2 Wifi for a couple of months now, and it has won me over. There are some cons but I’ll start with the positives. The controller is easy to program. You have a system directory and in particular .g files which you can programme with gcode from the duet g-code library. Not everything is enabled but it’s getting there slowly. You can write an unlimited number of macros to perform simple tasks like moving to your datum position or perform a probe cycles. I started by re-writing all the homing cycles and that was the first real win for me, because I was able to setup dual axis homing.

On this latest machine I’ve added a second y axis proximity sensor which is used while homing.  Having two limits on this axis allows me to fine adjust the squareness of the Y axis to the X axis. This is a great feature for hobby or semi pro users as we’re not relying on a rigid gantry – which normally ads cost of the machine. It also means if something goes wrong – you’re just a homing cycle away from squaring the machine.

The sensor at the far end is my main Y limit. The Y axis uses two drivers on the duet which are mapped so under normal operation if I move along that axis the two drivers perform together. But while homing I utilise a M584 Set Drive Mapping command to separate the drives to independent limit triggers. In the GUI you can see a U drive appears during the homing Cycle which is the second Y axis motor, which disappears at the the homing cycle is completed.

The duet controller is versatile. For example, you can programme different actions in case you ram your machine into any of the limits. While mines are set to hard stop you could have them re-home. That’s feature may not be necessary if you use soft limits which set the maximum travel – but it’s reassuring to know you can set that up.

There’s some other functionality which is great – including the M291 command which displays a message and give you the option to respond. You can use this command like a safety feature to prevent a macro running without a second click, or with movement keys enabled to jog the machine head before setting the work coordinate datum position for example.

You have a lot of versatility in programming, and if you can spend a little time you’ll probably get you head around it and having it doing what you need. You can also programme several input triggers which can reference trigger#.g macros files in the System Directory. I’ve already mention these but now I’ll show you them in action. I have one button which moves to the probe location at the front of the machine, and another which moves to the machine coordinates X0 Y0 Z-1.

Note the M291 command being used to create a second click before the action occurs when I pressed the external trigger buttons.

The board is great and the TMC2660 drivers have some great features including the ability to set a lower holding current to the motors while the machine is idle – which prevent motor heat build-up. There’s also a stall-guard feature which could detect voltage spikes and perform an appropriate action – like a hard stop if your cutting job goes wrong and a tool slips out for example. I’ve still not played around with this feature yet but in theory it’s available.

On this machine I’m using 3amp motors which are being run at the maximum 2.4amp supplied from the controller. This is 80% of the max current and with a lower micro-stepping of 16 or 8 I’ve maintained a good torque.

Overall it’s a really impressive bit of electronics but it still feels like it’s designed for additive printing, and CNC machining was an afterthought. There’s a plethora of commands not recognised by the Reprap firmware, and I don’t think the guys programming the board have much hands-on experience with machinists – lucky them.

 

You can’t use commands like G38 for probing cycles and the G30 alternative can’t perform two staged two speed cycles. And the normally output of gcode from a CNC-CAM software can’t be read by the board, and there’s no standardised post processor for CNC use on the duet – so you may have to write one if you move to this controller. Spindle control for example from most CNC-CAM software is written with the spindle speed first then the M3 command to turn the spindle on, afterwards – so S2100M3. But this has to be edited to M3S2100 before running the file on the Duet.

There’s a few other issues as well. I’ve noticed that when I export g-code with interpolation curves or arcs, the resume button doesn’t work in the way that it should (after a pause). One way to get around that is to export g-code from your cam file without the interpolation, but again I’ve mentioned this in the forum and one of the admin programmer is looking into this.

So this is the new machine. This is the new enclosure and I’m using Duet. I hope you found that interesting. What I’ll do is provide a link to an accompanying article that I’ll write the prose and cons in a little bit more detail and if there’s anything I’ve missed in this video I’ll add it on there.

I’m also gearing up to move to another room in the studio complex. As you may know from watching previous videos this room suffers from some leaks and some damp issues and I’ve had enough and I think it’s time to move. But the room is a lot smaller and I still have to shift a lot of stuff upstairs once the place is cleared – so this maybe the last video that I film in this space unless I decided to film the move itself and I’m not sure if I’ve got the appetite to do that. Anyway thanks again for watching, and you’ll catch me in whenever.

The web interface needs some more work as well – with the option to remove widgets containing information for additive printing when used for CNC. I’d really like to see machine position displayed alongside the active work coordinate system.

Leave a Reply