With the release of the 1.21 firmware all the missing functionality for CNC, at least what I consider mandatory, is available, so I could finally ditch the good old GRBL. The machine is a 750*750mm WorkBee, screw driven, with 3.0A steppers, home switches and limits on all axis. There are several notable differences from the standard WorkBee that influence the configuration scripts:
- home switch on the slave Y axis to allow aligning the gantry, not available by default;
- limit switches are not available so far in the default configuration, so a lot more wiring is needed;
- the Z axis is longer to allow deeper reach for a special setup.
The controller is a Duet3D Ethernet, rev 1.02, updated to firmware 1.21.
For now the steppers have been limited to 2A. Tomorrow I intend to make fan mounts to insure that the drivers are properly cooled. That should allow going up to 2.4A as per the Duet3D documentation, or even more if the limit is removed at a later time.
The connections are pretty straightforward - X, left-Y and Z connected to the corresponding axis and right-Y connected to E0. Home and limit switches are NC, connected in series for each axis, the series connection being done close to the controller. All cables are shielded, with the shield connected to ground on the controller side and left floating at the stepper/switch.
There is also a tool height probe, also based on a NC switch, connected to the PROBE connector.
With the above said, this is the config.g file (produced by RRF configuration tool and then edited):
[[language]]
; General preferences
M111 S0 ; Debugging off
M453 ; CNC mode
G21 ; Work in millimetres
G90 ; Send absolute coordinates...
M83 ; ...but relative extruder moves
M555 P2 ; Set firmware compatibility to look like Marlin
; Automatic saving after power loss is not enabled
; Endstops
M558 P5 H5 F100 T2500 ; Set Z probe type to switch and the dive height + speeds
G31 P600 X0 Y0 Z39.55 ; Set Z probe trigger value, offset and trigger height
M557 X15:530 Y15:500 S20 ; Define mesh grid
; Drives & Axis
;
; Define axis X on drive 0, axis Y on drives 1 and 3, axis Z on drive 2 and dummy axis U on drive 9
; Show only axis X, Y and Z
M584 X0 Y1:3 Z2 U9 E4:5:6 P3
;
; Set stepper drives parameters for all the used ones
M569 P0 S1 ; Drive 0 goes forwards
M569 P1 S0 ; Drive 1 goes backwards
M569 P2 S1 ; Drive 2 goes forwards
M569 P3 S0 ; Drive 3 goes backwards
M350 X16 Y16 Z16 U16 ; Configure microstepping with interpolation
M906 X2000 Y2000 Z2000 U2000 I30 ; Set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeout
;
; Set axis dynamic parameters
M92 X400 Y400 Z400 U400 ; Set steps per mm
M566 X400 Y400 Z12 U400 ; Set maximum instantaneous speed changes (mm/min)
M203 X2500 Y2500 Z2500 U2500 ; Set maximum speeds (mm/min)
M201 X150 Y150 Z150 U150 ; Set accelerations (mm/s^2)
;
; Set axis travel distances
M208 X0 Y0 Z0 U0 S1 ; Set axis minima
M208 X545 Y515 Z200 U515 S0 ; Set axis maxima
;
; Set axis endstops
M574 X1 Y1 Z2 U1 S1 ; Set active high endstops
M581 X Y Z U S1 T0 C0 ; Enable endstop triggers while machining
; Heaters
M140 H-1 ; Disable heated bed
; Tools
; Network
M550 PWorkBee ; Set machine name
M540 PBE:EF:DE:AD:FE:ED ; Set MAC address
M552 P192.168.1.200 S1 ; Enable network and set IP address
M553 P255.255.255.0 ; Set netmask
M554 P192.168.1.254 ; Set gateway
M586 P0 S1 ; Enable HTTP
M586 P1 S0 ; Disable FTP
M586 P2 S0 ; Disable Telnet
; Fans
M106 P0 S0.3 I0 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
M106 P1 S1 I0 F500 H T45 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned on
M106 P2 S1 I0 F500 H T45 ; Set fan 2 value, PWM signal inversion and frequency. Thermostatic control is turned on
; Custom settings are not configured
; Miscellaneous
M501 ; Load saved parameters from non-volatile memory
; Change to workplace coordinates set 1
G54
homez.g
[[language]]
M581 Z S-1 T0 C0 ; disable trigger for endstop Z
G91 ; relative mode
G1 S1 Z300 F1000 ; move Z towards the switch until it triggers
G0 Z-5 ; move Z back 5mm
G1 S1 Z10 F100 ; move Z slowly towards the switch until it triggers
G0 Z-1 ; move Z back 1mm
G90 ; back to absolute mode
G92 Z200 ; reset the Z coordinate
M581 Z S1 T0 C0 ; enable trigger for endstop Z
homex.g
[[language]]
M581 X S-1 T0 C0 ; disable trigger for endstop X
G91 ; relative positioning
G1 S1 X-1500 F1000 ; move quickly to X axis endstop and stop there (first pass)
G0 X5 ; go back a few mm
G1 S1 X-100 F100 ; move slowly to X axis endstop once more (second pass)
G0 X1 ; go back a few mm
G90 ; absolute positioning
G92 X0 ; reset the X coordinate
M581 X S1 T0 C0 ; enable trigger for endstop X
homey.g - The special line with "G0 Y0.09" is needed in my setup to fully align the gantry. No matter how much I try, there is no way to precisely place the homing switch on the slave Y axis and there might be other small mechanical differences. The offset could be applied either to Y or U axis, depending on the actual situation - the X axis must be parallel to the front beam of the machine frame and the offset can only be positive.
[[language]]
M581 Y U S-1 T0 C0 ; disable trigger for endstops Y and U
M584 Y1 U3 P4 ; separate Y and U axis for aligning them independently
G91 ; relative positioning
G1 S1 Y-1500 U-1500 F1000 ; move quickly to Y and U axis endstops and stop there (first pass)
G0 Y5 U5 ; go back a few mm
G1 S1 Y-10 U-10 F100 ; move slowly to Y axis endstop once more (second pass)
G0 Y0.09 ; fully align gantry
M584 Y1:3 U9 P3 ; combine again the master and slave Y axis
G0 Y1 ; go back a few mm
G90 ; absolute positioning
G92 Y0 ; reset the Y coordinate
M581 Y U S1 T0 C0 ; enable trigger for endstops Y and U
homeall.g - Partially rely on the other homing scripts in order to reduce the number of files to edit if some parameters change.
[[language]]
; first home the Z axis
M98 Phomez.g
;
M581 X Y U S-1 T0 C0 ; disable trigger for endstops X, Y and U
M584 Y1 U3 P4 ; separate Y and U axis for aligning them independently
G91 ; relative positioning
G1 S1 X-550 Y-520 U-520 F1000 ; move quickly to X, Y and U axis endstops and stop there (first pass)
G0 X5 Y5 U5 ; go back a few mm
G1 S1 X-550 Y-520 U-520 F100 ; move slowly to X, Y and U axis endstops once more (second pass)
M584 Y1:3 U9 P3 ; combine again the master and slave Y axis
G0 X1 Y1 ; go back a few mm
G90 ; absolute positioning
G92 X0 ; reset the X coordinate
M581 X Y U S1 T0 C0 ; enable trigger for endstops X, Y and U
;
; redo Y axis homing for fully aligning the gantry
M98 Phomey.g