Upgraded controller to Duet3 6HC (Macros!)

Hi folks.

I bought a torquier NEMA17 for my Z axis and of course the old controller board (ex 3D printer) wasn’t able to supply it with enough current. After doing some research I decided to replace all the electronics with a Duet 3 6HC which is overkill, but will definitely last and if I ever scrap the CNC machine will make a great 3D printer board. The board runs RepRepFirmware, which is pretty cool because new versions have a bunch of new CNC-related features and everything is configured with G-Code, even stepper current and kinematics. It’s awesome. You will wind up having to write your own macros for basically everything, but it is nice being able to write a G-Code file to define the behaviour for basically every button in the UI. It is also a little annoying having to write your own G-Code file for every button in the UI.

I’'ve made a start but if anyone else is using RRF I’d be interested in seeing your macros.

Let’s see…

First off, I should say that I use work coordinates, so my config.g has G54 at the end, to switch to the first set of workspace coordinates. This allows me to enable soft limits, since I don’t manipulate the machine coordinates for jobs. Not necessary, but I find it useful.

; Workspace_0.g
; Make the current machine position the workspace origin
G10 L20 X0.00 Y0.00
; Workspace_Z.g
; Set current position as workspace Z origin
G10 L20 Z0.00
; Probe_Work.g
; Use touch plate to determine work top
M291 P"Attach Probe" R"Probe Work" S3 Z1 ; Display message with jog buttons
G30 S-1 ; Probe to touchplate, report position.
M400
G10 L20 Z0.50
M400
G00 Z5 F450
; Set_CNC_mode.g
M453
G54
; Set_Laser_mode.g
M452 C"e1heat" R1000 F500 ;Laser Mode on pin e1heat max power=1000, 500Hz PWM
; Autosquare.g
; Careful to lift Z first! Home to switches and go back to workspace origin
G28 X Y
G0 X0 Y0
; Level_Screws.g
; LR back to level with probes
M561 ; Clear any bed transform
if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
   G28
G53 ; Machine Coordinates
G0 X25 Y75
G30 P0 X25 Y75 H0 Z-200
G30 P1 X1030 Y75 H0 Z-200 S2 ; adjust Z motor levels
G54 ; Workspace Coordinates

(This last obviously for LowRider, not Primo.)

The LR and Primo both run on Duet 2 wifi boards. The MP3DPv4 runs on a Duet 3 6HC. If it had been in stock though I would have used the mini 5 and the extra 2 channel expansion. Would have been cheaper, easier to wire, and still left dual extruders as an option. The mini 5 is still a possibility for the Primo and LR3 if I decide I need the Duet 3 features, but I’m pretty happy with the Duet 2 Wifi boards.

Edit: I should also note that I have PanelDue LCDs on my machines, and do almost everything local to the machine from them. Makes the macros easy to access.

Thanks @SupraGuy that’s awesome. I like the Z probe macro. Looking at the GCode dictionary on the Duet3d docs site it doesn’t seem like there’s a way to probe any other axis :frowning:

G38.2 and variants G38.3 ans G38.4 work in RRF. I don’t knkw what the diffeewnce is between G38.2 and G38.3 actually, both probe towards the work piece and stop on contact. G38.4 moves away from the workpiece and triggers at loss of contact.

https://docs.duet3d.com/User_manual/Reference/Gcodes#G38.2