Repository for CNC Config's and Macro's
Hello everyone, I was hoping I could start a thread where we could begin to gather some CNC specific configs and custom macros from all the experienced Duet CNC users. I've seen @dc42 's repository he created for the 3d printer side of things in the past and just wanted to see if there was interested in creating the same thing on the CNC side?
I'm just beginning my Duet 3 CNC build here, using a MB6HC with 3.2b2 loaded and have it controlling a 1000x1500 Workbee Leadscrew kit. I also have a couple 3d printer builds with Duet hardware so the initial config wasn't too bad. I'm getting to the spindle control stage to where I'm starting to ponder which macros I want to start to build. I've been reading through all the various posts on here and often times users mention creating macros to "perform this" or to "stop this" and thought it may be beneficial to get these great ideas all listed in one place?
I don't have much to contribute other than my config for the workbee at this time, but will include it to get the ball rolling. As users add their info I'll try and keep this post updated with a sort of
"Table of Contents"
- Workbee CNC 1050 Config.g
Otherwise, if this repository already exists somewhere and I've just completely overlooked it, I will happily bow out and this thread can be removed!
Workbee CNC 1000 x 1500 Leadscrew Kit
-Dual Y motors with dual endstops
; Configuration file for Duet 3 (firmware version 3) ; executed by the firmware on start-up ; ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"1050-Workbee" ; set printer name ;DUAL Y M584 X0.0 Y0.1:0.2 Z0.3 U0.2 P3 ; Drives M569 P0.0 S0 ; physical drive 0.0 goes forwards M569 P0.1 S0 ; physical drive 0.1 goes forwards M569 P0.2 S0 ; physical drive 0.2 goes forwards M569 P0.3 S0 ; physical drive 0.3 goes forwards M350 X16 Y16 U16 Z16 I1 ; configure microstepping with interpolation M92 X400.00 Y400.00 U400.00 Z400.00 ; set steps per mm M566 X300.00 Y300.00 U300.00 Z300.00 ; set maximum instantaneous speed changes (mm/min) M203 X3000.00 Y3000.00 U3000.00 Z3000.00 ; set maximum speeds (mm/min) M201 X150.00 Y150.00 U150.00 Z150.00 ; set accelerations (mm/s^2) M906 X2400 Y2400 U2400 Z2400 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z0 U0 S1 ; set axis minima M208 X1000 Y1500 U1500 Z60 S0 ; set axis maxima ; Endstops M574 X1 S1 P"^io6.in" ; configure active-high endstop for low end on X via pin !^io0.in M574 Y1 S1 P"^io1.in" ; configure active-high endstop for low end on Y via pin !^io1.in M574 U1 S1 P"^io2.in" ; configure active-high endstop for low end on Y via pin !^io1.in M574 Z2 S1 P"!io3.in" ; configure active-high endstop for high end on Z via pin !io3.in ; Z-Probe M558 P8 C"!io7.in" H10 F120 T3000 ; Z probe connected to E0 endstop input G31 Z1.5 ;M558 P0 H5 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed ;M557 X15:215 Y15:195 U15:195 S20 ; define mesh grid ; Heaters ; Fans ; Tools M563 P0 F0 ; define tool 0 G10 P0 X0 Y0 U0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; CNC M950 F8 C"nil" ; free up fan out 8 M950 F7 C"nil" ; free up fan out 7 m950 P3 C"out8" ; define Coolant Pump Relay M453 C"out9+!io4.out+out7" R24000 T0 ;configure CNC mode and set PWM+ON/FWD+REV R sets max spindle RPM G54 ;Use Workspace coordinate system M564 S0 H0 ;Allow movement without homing (without axis maxima) M575 P1 S1 B57600 ;Configure paneldue output for CNC Pendant Use ; MISC Outputs ;m950 p0 C"!io4.out" ; define VFD Run-FWD ;m950 p1 C"!io5.out" ; define VFD REV ; Custom settings are not defined
Feel free to submit your configs and macros to the official repository as well.
Arcnsparks last edited by
Sure, that sounds good. If anything gets posted here, I'll do a fork and can start adding there. Would it be possible to have a dedicated CNC folder in the root to fork from?
dbruce.ae05 last edited by
@Arcnsparks Do you have a macro for zeroing both y-axes to zero out racking each time you home the machine?
@dbruce-ae05 I don't use a specific Macro for that I just have my homey.g file setup as shown below and then use the home buttons in the DWC.
; homey.g ; called to home the Y axis ; G91 ; relative positioning ; split Y motor control to Y and U ; for it to work we have to show U (param P4) in the UI M584 Y0.2 U0.1 P4 G1 H1 Z5 F6000 ; lift Z relative to current position G1 H1 Y-1005 U-1005 F1800 ; move quickly to Y axis endstop and stop there (first pass) G1 H2 Y5 U5 F6000 ; go back a few mm G1 H1 Y-1005 U-1005 F360 ; move slowly to Y axis endstop once more (second pass) G1 H1 Z-5 F6000 ; lower Z again M584 Y0.2:0.1 P3 ; back to combined axes and hidden U G90 ; absolute positioning
dbruce.ae05 last edited by
@Arcnsparks I tried to implement this, but I'm not having any luck. I split the axes (x axis in my case) to X & U, and try to home. But the X0 motor doesn't stop when the end stop is hit. No matter which end stop is hit first, X1 keeps going, and X0 stops. Any ideas?
Yveske last edited by
No need for splitting and recombining (Duet3 6HC firmware 3.2), just assign 2 motors to Y and check 2 endstops
;DUAL Y M584 X0.0 Y0.1:0.2 Z0.3 ; Drives M569 P0.0 S0 ; physical drive 0.0 direction (0 = backwards, 1 = forwards (default 1)) M569 P0.1 S0 ; physical drive 0.1 direction (0 = backwards, 1 = forwards (default 1)) M569 P0.2 S0 ; physical drive 0.2 direction (0 = backwards, 1 = forwards (default 1)) M569 P0.3 S1 ; physical drive 0.3 direction (0 = backwards, 1 = forwards (default 1)) ; Endstops M574 X1 S1 P"!io0.in" ; configure active-high endstop for low end on X via pin io0.in M574 Y1 S1 P"!io1.in+!io2.in" ; configure active-high endstop for low end on Y via pin io1.in M574 Z2 S1 P"!io3.in" ; configure active-high endstop for high end on Z via pin io3.in
o_lampe last edited by
It would be interesting to have a setup, where the printer pauses when one Y-motor starts skipping steps.(not during homing)
I ruined my DIY shapeoko CNC, because the motors didn't stop, DWC only spitting out tons of warnings. (just great!)
chimaeragh last edited by chimaeragh
Here is my config for the Ooznest 1000x1500 Workbee CNC.
This version has normally closed limit switches (these have the LEDs light up on the Duet2 board when not closed).
Reprap firmware version 3.2.2.
Everything works including emergency stop which is configured in the customconfig.g file.
; Configuration file for Duet WiFi (firmware version 3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.2.2 on Sat Jan 23 2021 03:57:18 GMT+0000 (Greenwich Mean Time) ; General preferences M453 ; CNC Mode M550 P"Workbee CNC" ; set printer name G90 ; send absolute coordinates... ;M83 ; ...but relative extruder moves ; Network M552 S2 ; enable Adhoc network M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0 S0 ; physical drive 0 goes forwards M569 P1 S1 ; physical drive 1 goes forwards M569 P2 S0 ; physical drive 2 goes forwards M569 P3 S1 ; physical drive 3 goes forwards M584 X0 Y1:3 Z2 ; set drive mapping M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation M92 X400.00 Y400.00 Z400.00 ; set steps per mm M566 X500.00 Y500.00 Z500.00 ; set maximum instantaneous speed changes (mm/min) M203 X2500.00 Y2500.00 Z2500.00 ; set maximum speeds (mm/min) M201 X150.00 Y150.00 Z150.00 ; set accelerations (mm/s^2) M906 X2400 Y2400 Z2400 I100 ; set motor currents (mA) ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X800 Y1270 Z94 S0 ; set axis maxima ; Endstops M574 X1 S1 P"!xstop" ; configure active-low endstop for low end on X via pin xstop M574 Y1 S1 P"!ystop" ; configure active-low endstop for low end on Y via pin ystop M574 Z1 S1 P"!zstop" ; configure active-low endstop for low end on Z via pin zstop ; Z-Probe M558 P0 H5 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed ; Heaters M140 H-1 ; disable heated bed (overrides default heater mapping) ; Tools ;M563 P0 D0 F0 ; define tool 0 ;G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets ;G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; Miscellaneous M140 H-1 ; Disable heated bed M564 S1 H1 ; Disable jog commands when not homed M911 S21 R24 P"G91 G1 Z3 F1000" ; set voltage thresholds and actions to run on power loss M501 ; load saved parameters from non-volatile memory M98 P"customconfig.g" ; Execute custom config settings
And customconfig.g for emergency stop
; ADD ANY CUSTOM SETTINGS BELOW ;M564 S1 H0 ; Enable jog commands when not homed M950 J1 C"e1stop" ; Assign Pin1 to e1stop M581 P1 T0 S1 R0 ; Enable Emergency Stop Normally Closed M582 T0
o_lampe last edited by o_lampe
Try M98 P"customconfig.g"
AFAIK there have to be "" around the filename...
//edit It depends on your FW:
1 In RRF_2.x and earlier, string can be enclosed in quotes if required, see Quoted Strings for details. In RRF_3, quotation marks around the filename are mandatory.
chimaeragh last edited by