config.g:
; Configuration file for Duet WiFi (firmware version 3)
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool v3.2.3 on Tue Apr 20 2021 01:19:12 GMT-0600 (Mountain Daylight Time)
; Monkeyed with by SupraGuy because obviously I know better than the configuration tool, lol!
; General preferences
G90 ; send absolute coordinates...
M83 ; ...but relative extruder moves
M550 P"MPCNC Primo" ; set printer name
; Network
M552 S1 ; enable network
M586 P0 S1 ; enable HTTP
M586 P1 S0 ; disable FTP
M586 P2 S0 ; disable Telnet
; Drives
M669 K0 ; explicitly set Cartesian kinematics, even if I should not need to
M569 P0 S0 ; physical drive 0 goes backwards (oops, made the connector the wrong way)
M569 P1 S1 ; physical drive 1 goes forwards
M569 P2 S1 ; physical drive 2 goes forwards
M569 P3 S0 ; physical drive 3 goes backwards
M569 P4 S1 ; physical drive 4 goes forwards
M584 X0:3 Y1:4 Z2 ; set drive mapping: X on drives 0 and 3, Y on 1 and 4, Z on 2
M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation
M92 X100.00 Y100.00 Z400.00 ; set steps per mm
M566 X900.00 Y900.00 Z60.00 ; set maximum instantaneous speed changes (mm/min)
M203 X3000.0 Y3000.0 Z180.00 ; set maximum speeds (mm/min) 5 centimeters per second, lol
M201 X250.00 Y250.00 Z20.00 ; set accelerations (mm/s^2)
M906 X1200 Y1200 Z1200 I75 ; set motor currents (mA) and motor idle factor in per cent. Idle is high to keep it in place when I change tools.
M84 S30 ; Set idle timeout
; Axis Limits
M208 X0 Y0 Z-12.5 S1 ; set axis minima (I want to lower Z to -2.5 when I can get tool change sussed)
M208 X635 Y940 Z90 S0 ; set axis maxima (25 by 37 inches)
; Endstops
M574 X1 S1 P"^xstop+^e0stop" ; configure active-high endstop for low end on X via pin ^xstop+^e0stop with pullup resistors enabled
M574 Y1 S1 P"^ystop+^e1stop" ; configure active-high endstop for low end on Y via pin ^ystop+^e1stop
; Z-Probe
M558 P5 C"!^zprobe.in" H5 F120 T6000 ; set Z probe type to switch and the dive height + speeds
G31 P850 X0 Y0 Z0.5 ; set Z probe trigger value, offset and trigger height
M557 X15:615 Y15:915 S100 ; define mesh grid
; Heaters
M140 H-1 ; disable heated bed (overrides default heater mapping)
M308 S2 Y"drivers" A"DRIVERS" ; configure sensor 2 as temperature warning and overheat flags on the TMC2660 on Duet
M308 S3 Y"mcu-temp" A"MCU" ; configure sensor 3 as thermistor on pin e1temp for left stepper
; Fans
M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency
M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off
M950 F1 C"fan1" Q500 ; create fan 1 on pin fan1 and set its frequency
M106 P1 S1 H T45 ; set fan 1 value. Thermostatic control is turned on
M950 F2 C"fan2" Q500 ; create fan 2 on pin fan2 and set its frequency
M106 P2 H2:3 L0.15 X1 B0.3 T25:60 ; set fan 2 value. Thermostatic control is turned on Should cool the driver chips if the MCU temp exceeds 25 degrees or thermostatic trigger on the drivers goes off
; Tools
M453 C"exp.heater3" Q100 ; Set CNC Mode spindle on heater 3, frequency 100Hz not that it's connected.
; Custom settings are not defined
M575 P1 S1 B57600 ; Enable PanelDUE at 57600 BPS
G54 ; Select Workspace Coordinate 1 for DWC CNC mode display
homeall.g:
; homeall.g
; called to home all axes
;
; generated by RepRapFirmware Configuration Tool v3.2.3 on Tue Apr 20 2021 01:19:12 GMT-0600 (Mountain Daylight Time)
G91 ; relative positioning
G1 H2 Z5 F6000 ; lift Z relative to current position
G1 H1 X-635 Y-945 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 H2 X10 Y10 F6000 ; go back a few mm
G1 H1 X-20 Y-20 F360 ; move slowly to X and Y axis endstops once more (second pass)
G1 H1 Z-95 F360 ; move Z down stopping at the endstop
G90 ; absolute positioning
G92 Z0.5 ; set Z position to axis minimum (you may want to adjust this)
; Uncomment the following lines to lift Z after probing
G91 ; relative positioning
G1 Z5 F100 ; lift Z relative to current position
G90 ; absolute positioning
pause.g:
; pause.g
; called when a print from SD card is paused
;
; generated by RepRapFirmware Configuration Tool v3.2.3 on Tue Apr 20 2021 01:19:13 GMT-0600 (Mountain Daylight Time)
;M83 ; relative extruder moves
;G1 E-10 F3600 ; retract 10mm of filament
;G91 ; relative positioning
G1 Z65 F360 ; lift Z above work
;G90 ; absolute positioning
G1 X0 Y0 F6000 ; go to X=0 Y=0
resume.g:
; resume.g
; called before a print from SD card is resumed
;
; generated by RepRapFirmware Configuration Tool v3.2.3 on Tue Apr 20 2021 01:19:13 GMT-0600 (Mountain Daylight Time)
; Monkeyed with by SupraGuy after carving a gouge in a nice piece of poplar
; G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move
G1 R1 X0 Y0 ; go back to the last print move
M400 ; Wait for move to finish
G1 R1 Z5 ; Go to 5mm above last move
As far as setting the max Z height… What I got was to home your machine upwards. Makes sense, I guess, set the machine limits in the soft stops, and it also means that if you then use Z-5 in your pause.g file, it will go to 5mm below the homed height, which ought to be as safe as it gets. I can see a number of good reasons to do this, but don’t want to run another home switch through my freshly re-wired machine to set up another Z homing switch, which also does not have a mounting provision already in place, and is rather difficult to set up on a Primo in the first place, due to the fact that nothing at the top of the core gets closer together as the Z axis goes up, only more distant. I suppose that I could put a screw into one of the Z tubes and trigger when it reaches the top. I’ll need to think on a good solution.
I also have some macros which are useful. Need these more because of the PanelDue, the DWC CNC version already has functionality like this:
ProbeWork.g:
; Probe the work, and set the workspace Z coordinate
M291 P"Attach Z Probe" R"Probe Work" S3 Z1 ; Display message with Z jog buttons
G30 S-1 ; Probe the work, (report machine position)
G10 L20 Z0.5 ; Set workspace position to 0.5mm
M400 ; Wait for save to finish
G00 Z5 F450 ; Move 5mm above work piece
ZeroWorkspace.g:
; Set the workspace X and Y to the current machine coordinates
G10 L20 X0.0000 Y0.0000
I have a couple of other macros for dealing with workspace setup, too. The biggest one that I want to get working is a tool change routine that adjusts the tool offset so that the machine coordinates get updated for the current tool. Not a problem with separate files for separate tools, but one of the very nice things with the Duet is the ability to set up the different workspaces and just stamp cuts out, and that tends to mean not walking the machine out of its usable work area.