Skip to content

Firmware

RatOS

RatOS is developed and maintained by Mikkel Schmidt (a member of Rat Rig's Beta/Dev team). It combines the power of the Klipper firmware, as well as several other open-source projects, to provide a stable and easy-to-use operating system for all your printing needs.

Official RatOS documentation

Duet - RepRap Firmware

This guide was prepared against the RepRap Firmware version 3.2.2. For an official guide from Duet you can go here which is a very good introduction.

Please read

Both this guide, as well as the provided configuration package, are designed for use with the Duet 3 Mini 5+. Modifications to the configuration will be required to use these files on other boards supported by the RepRap Firmware, such as the Duet 3 MB6HC.

Download

Bellow you will find pieces of Duet configuration files with comment. All files with a boilerplate setup for the V-Core 3 can be downloaded as a ZIP package here.

config.g

Please read

Neither the files in the package or this guide is a complete - copy and paste configuration, please read and make sure to execute operations like PID tuning mentioned bellow.

Start with setting up absolute coordinates but relative extruder moves. Here you also specify the printer name and it's CoreXY kinematic system:

G90                                     ; send absolute coordinates...
M83                                     ; ...but relative extruder moves
M550 P"V-Core 3"                        ; set printer name
M669 K1                                 ; CoreXY
G21                                     ; Set Units to Millimeters

Specify the IP address of your printer (if connected to a network) and define which network protocols should it handle. If you don't know what those are leave only HTTP enabled:

M552 S1                                 ; enable network
M586 P0 S1                              ; enable HTTP
M586 P1 S0                              ; disable FTP
M586 P2 S0                              ; disable Telnet

Here you define the direction of the motors (S) and their mode of operation (D2 for more powerfull SpreadCycle, D3 for quiet stealthChop):

Motor direction

The motor direction and the S parameter depends on many things, you may find the motors going in the wrong directions - you may need to switch the S parameter and/or swap a pair of wires leading to a motor.

M569 P0.0 S1 D3                         ; physical drive 0.0 goes forwards
M569 P0.1 S1 D3                         ; physical drive 0.1 goes forwards
M569 P0.2 S1 D3                         ; physical drive 0.2 goes forwards
M569 P0.3 S1 D3                         ; physical drive 0.3 goes forwards
M569 P0.4 S1 D3                         ; physical drive 0.4 goes forwards
M569 P0.5 S1 D3                         ; physical drive 0.5 goes forwards
M584 X0.4 Y0.3 Z0.0:0.1:0.2 E0.5        ; set drive mapping
M350 X16 Y16 Z16 E16 I1                 ; configure microstepping with interpolation

Define steps per mm of travel for X, Y and Z axis (the following are for 1.8 deg motors and a Tr8x4 leadscrew):

M92 X80.00 Y80.00 Z800.00               ; set steps per mm
M906 X1000 Y1000 Z800 I30               ; set motor currents (mA) and motor idle factor in per cent
M84 S30                                 ; Set idle timeout

Bellow is where you define what influences the maximum speed of the printer:

M566 X400.00 Y400.00 Z6.00 E120.00 P1          ; set maximum instantaneous speed changes (mm/min)
M203 X10800.00 Y10800.00 Z1000.00 E3600.00     ; set maximum speeds (mm/min)
M201 X3000.00 Y3000.00 Z100.00 E3600.00        ; set accelerations (mm/s^2)

Define where the nozzle is when hitting an endstop:

Bigger printer?

Here is where you would change the maxima for bigger V-Core 3 sizes

M208 X0 Y0 Z0 S1                               ; set axis minima
M208 X310 Y300 Z300 S0                         ; set axis maxima

Configure endstops, here the X endstop defines Xmin and the Y endstop Ymax

M574 X1 S1 P"io0.in"                           ; configure active high endstops
M574 Y2 S1 P"io1.in"                           ; configure active high endstops

Define lead screw position for true bed leveling

Bigger printer?

Those values will be different for bigger printers, take a close look how those are defined X-4.5:150:304.5 Y-4.52:305:-4.52 meaning that the first lead is at X-4.5 and -4.52, the second at X150, Y305 and so on. Naturally the first (left) lead screw position is the same for all size variants but, taking the second as an example it will land at X250, Y505 for the 500x500x500 version of V-Core 3.

M671 X-4.5:150:304.5 Y-4.52:305:-4.52 S5       ; define positions of Z leadscrews or bed levelling screws
M557 X20:280 Y20:280 P5                        ; define 5x5 mesh grid

Caution!

The following step defines settings for the heating elements, refer to Duet's documentation for guidance.

The actuall PID settings are commented out here only to show where those can be set.

M308 S0 P"temp0" Y"thermistor" T100000 B3950 A"Bed"    ; configure sensor 0 as thermistor on pin temp0
M950 H0 C"out0" T0                                     ; create bed heater output on out5 and map it to sensor 0
M307 H0 B0 S1.00                                       ; disable bang-bang mode for the bed heater and set PWM limit
M140 H0                                                ; map heated bed to heater 0
M143 H0 S110                                           ; set temperature limit for heater 0 to 110C

;; Run Bed PID Tune!! Below is an example for a 300x300 bed
;; M307 H0 A303.1 C356.7 D1.4 S1.00 V24.0 B0

Configure the hotend fan and layer fan.

Duet3 6HC users

For the older Duet3 6HC you can use the M950 F0 C"out7" Q500 and M950 F1 C"out4" Q500 ports for fans

M950 F0 C"out3" Q500                   ; create fan 0 on pin out3 and set its frequency
M106 P0 C"Hotend Fan" S0 H1 T45        ; set fan 0 name and value. Thermostatic control turned on for Hotend
M950 F1 C"out4" Q500                   ; create fan 1 on pin out4 and set its frequency
M106 P1 C"Layer Fan" S0 H-1            ; set fan 1 name and value. Thermostatic control is turned off

Define the Tool (which is the print head):

M563 P0 D0 H1 F1           ; 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

M950 H1 C"out1" T1         ; create nozzle heater output on out2 and map it to sensor 1
M307 H1 B0 S1.00           ; disable bang-bang mode for heater and set PWM limit
M143 H1 S250               ; set the maximum temperature in C for heater

Configure the chosen carriage, the example bellow is to EVA 2 / BMG with an E3D V6 hotend.

Caution!

The following step defines settings for the heating elements, refer to Duet's documentation for guidance.

The actuall PID settings are commented out here only to show where those can be set.

M92 E830          ; set extruder steps per mm, 0.9 angle/step (LDO Pancake)
M906 E800         ; set extruder motor current (mA) and idle factor in per cent

M308 S1 P"temp1" Y"thermistor" T100000 B4725 C7.060000e-8 A"Hotend"  
;; Run Heater PID Tune!! 
;; M307 H1 A751.5 C196.6 D4.7 S1.00 V23.9 B0

Z-probe setting, uncomment the lines with your probe of choice:

BLTouch

If you plan to use BLTouch you will also need to uncomment a few lines in homeall.g and homez.g

;; Inductive Probe
; M558 P5 C"!io3.in" H5 F400 T5000       ; set Z probe type to unmodulated and the dive height + speeds
; G31 P500 X-30 Y-15 Z0.20               ; set Z probe trigger value, offset and trigger height, more Z means closer to the bed
;; BLTouch
; M950 S0 C"io7.out"                     ; Create a servo pin on io7
; M558 P9 C"io7.in" H5 F240 T10800 A5    ; set Z probe type to unmodulated and the dive height + speeds
; G31 P25 X-28.00 Y-13.00 Z0.90          ; set Z probe trigger value, offset and trigger height, more Z means closer to the bed

Finally you can calibrate pressure advance, read more about it here.

; Pressure Advance
; M572 D0 S0.10

homeall.g

This file defines the sequence of actions for the printer to take on the G28 - "Home All" request. This example moves the carriage diagnonally to reach the XY endstops and homes Z in the middle of the build surface:

Bigger printer?

The following home files are prepared for the 300x300x300 variant, you will need to modify those for bigger printers to reach the endstops.

M201 X500.00 Y500.00    ; Reduce acceleration for homing moves

; BLTouch
;M280 P0 S160           ; Precautionary alarm release
;M280 P0 S90            ; Ensure the pin is raised

G91                     ; Relative positioning
G1 H2 Z5 F6000          ; Lift Z relative to current position
G1 H1 X-625 Y605 F3600  ; Move quickly to X and Y axis endstops and stop there (first pass)
G1 H1 X-625 F1800       ; Move quickly to X and Y axis endstops and stop there (first pass)
G1 H1 Y605 F1800        ; Move quickly to X and Y axis endstops and stop there (first pass)

G1 H2 X1 Y-1 F600       ; Go back a few mm

G1 H1 X-625 Y605 F360   ; Move slowly to X and Y axis endstops once more (second pass)
G1 H1 X-625 F360        ; Move slowly to X and Y axis endstops once more (second pass)
G1 H1 Y605 F360         ; Move slowly to X and Y axis endstops once more (second pass)

M201 X3000 Y3000        ; Return to full acceleration

G90                     ; Absolute positioning
G1 X150 Y150 F10000     ; Go to the center of the bed (300x300)
;G1 X200 Y200 F10000    ; Go to the center of the bed (400x400)
;G1 X250 Y250 F10000    ; Go to the center of the bed (500x500)
G30                     ; Home Z by probing the bed

G91                     ; Relative positioning
G1 Z5 F100              ; Lift Z relative to current position
G90                     ; Absolute positioning

homex.g

M201 X500.00 Y500.00    ; Reduce acceleration for homing moves

G91                     ; Relative positioning
G1 H2 Z5 F6000          ; Lift Z relative to current position

G1 H1 X-625 F3600       ; Move quickly to X endstop and stop there (first pass)
G1 H2 X1 F600           ; Go back a few mm
G1 H1 X-625 F360        ; Move slowly to X endstop once more (second pass)

M201 X3000 Y3000        ; Return to full acceleration

G1 H2 Z-5 F6000         ; Lower Z relative to current position
G90                     ; Absolute positioning

homey.g

M201 X500.00 Y500.00    ; Reduce acceleration for homing moves

G91                     ; Relative positioning
G1 H2 Z5 F6000          ; Lift Z relative to current position

G1 H1 Y605 F3600        ; Move quickly to Y endstop and stop there (first pass)
G1 H2 Y-1 F600          ; Go back a few mm
G1 H1 Y605 F360         ; Move slowly to Y endstop once more (second pass)

M201 X3000 Y3000        ; Return to full acceleration

G1 H2 Z-5 F6000         ; Lower Z relative to current position
G90                     ; Absolute positioning

homez.g

; BLTouch
;M280 P0 S160           ; Precautionary alarm release
;M280 P0 S90            ; Ensure the pin is raised

G91                     ; Relative positioning
G1 H2 Z5 F6000          ; Lift Z relative to current position

G90                     ; Absolute positioning
G1 X150 Y150 F10000     ; Go to the center of the bed (300x300)
;G1 X200 Y200 F10000    ; Go to the center of the bed (400x400)
;G1 X250 Y250 F10000    ; Go to the center of the bed (500x500)
G30                     ; Home Z by probing the bed

; Uncomment the following lines to lift Z after probing
;G91                     ; Relative positioning
;G1 Z5 F100              ; Lift Z relative to current position
;G90                     ; Absolute positioning

bed.g

; this script compensates for what the Z offset is
; so if G31 P500 X-30 Y-15 Z1.7 then first probe will be at
; X30 Y20 (when G30 P0 X0 Y5)

M561 ; clear any bed transform

G30 P0 X5 Y5 Z-99999 ; probe near a leadscrew
G30 P1 X150 Y285 Z-99999 ; probe near a leadscrew
G30 P2 X270 Y5 Z-99999 S3 ; probe near a leadscrew and calibrate 3 motors

deployprobe.g

BLTouch

Required only for BLTouch

; deployprobe.g
; Called to deploy a physical Z probe
;
M280 P0 S10                                                         ; Deploy the BLTouch pin

retractprobe.g

BLTouch

Required only for BLTouch

; retractprobe.g
; Called to retract a physical Z probe
;
M280 P0 S90                                                 ; Retract the BLTouch pin