Configuring RepRapFirmware for a Cartesian printer

From RepRap
Revision as of 16:00, 8 August 2015 by Dc42 (talk | contribs)
Jump to: navigation, search

RepRapFirmware is configured at run-time by means of files in the /sys folder of the SD card. You do not have to recompile RepRapFirmware to configure it. You must have an SD card in the on-board socket to use RepRapFirmware, it cannot operate correctly without one.

Main configuration file

The main configuration file is sys/config.g. This file is read when RepRapFirmware starts up. It is typically organised into sections along the following lines.

Prologue and communications section

Example:

M111 S0                             ; Debug off
M550 PMyOrmerod                     ; Machine name (can be anything you like)
M551 Preprap                        ; Machine password (currently not used)
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED ; MAC Address
M552 P0.0.0.0                       ; IP address (0 = use DHCP)
M554 P192.168.1.1                   ; Gateway (not used yet)
M553 P255.255.255.0                 ; Netmask
M555 P2                             ; Set output to look like Marlin

The machine name is used as a basis for the netbios name, so in the above example if your router supports netbios then you can attach to the web interface by typing "MyOrmerod/" into your browser. The password is used when connecting via FTP. If you have more than one Duet on your network, you must given them all different MAC addresses.

Movement section

Example:

M569 P0 S1                          ; Drive 0 goes forwards (change to S0 to reverse it)
M569 P1 S0                          ; Drive 1 goes backwards
M569 P2 S1                          ; Drive 2 goes forwards
M569 P3 S1                          ; Drive 3 goes forwards
M569 P4 S1                          ; Drive 4 goes forwards
M574 X0 Y1 Z0 S1		    ; set homing switch configuration (Y homing switch only, at low end, active high)
M906 X800 Y1000 Z800 E800           ; Set motor currents (mA)
M201 X800 Y800 Z15 E1000            ; Accelerations (mm/s^2)
M203 X15000 Y15000 Z100 E3600       ; Maximum speeds (mm/min)
M566 X600 Y600 Z30 E20              ; Maximum jerk speeds mm/minute
M208 X200 Y200 Z200                 ; set axis maxima and high homing switch positions (adjust to suit your machine)
M208 X-8 Y0 Z-0.5 S1                ; set axis minima and low homing switch positions (adjust to make X=0 and Y=0 the edges of the bed)
G21                                 ; Work in millimetres
G90                                 ; Send absolute coordinates...
M83                                 ; ...but relative extruder moves

The M569 commands are optional, drives go forward by default.

The XYZ parameters to the M574 command are 0 if there is no homing switch for the axis, 1 if there is a low-end homing switch, and 2 if there is a high-end homing switch. S1 indicates active high inputs (e.g. normally-closed switches), while S2 indicates active low inputs.

The M208 command with parameter S0 or no S parameter defines the maximum coordinate of each axis. These are also the coordinates at which the head is assumed to be when a high-end homing switch is triggered. The M208 command with S1 parameter sets the minimum axis coordinates and low-end homing switch positions similarly.

The M906 command is required. Without it, motor currents will remain at zero. It also takes an optional I parameter, which is the percentage of normal current used to hold the motors in position when the motors have been idle for 30 seconds, default 30%.

Z probe section

The M558 command enables the Z probe, defines which axes (if any) it it used to home, and the dive height. The G31 command defines the probe threshold and the X, Y and Z offsets of the probe relative to the tip of the nozzle. Here is an example:

M558 P1 X0 Y0 Z1 H3        ; smart IR Z probe, used for homing Z axis only, dive height 3mm
G31 P500 X11.0 Y0.5 Z1.65  ; set threshold and offsets

The P parameter of the M558 command specifies the type of Z probe, as follows:

P0 - no Z probe installed

P1 - analog sensor feeding the AD10 pin on the expansion connector (also brought out as the S pin on the 4-pin Z probe connector on the Duet Shield and on the Duet 0.8.5). Suitable for an unmodulated IR sensor (not recommended), smart IR sensor, and many other types. Pin D52 on the Duet is driven high.

P2 - simple modulated IR sensor. RepRapFirmware generates a modulation signal on pin D52 (also brought out as the T pin on the 4-pin Z probe connector on the Duet shield and Duet 0.8.5) for use by the sensor.

P3 - as P1 but pin D52 is driven low instead of high. Allows a compatible Z probe to be switched to a different mode.

P4 - microswitch (normally-closed by default) connected to the E0 endstop connector, or anything that emulates one.

The XYZ parameters in the M558 command define which axes the Z probe is used to home (0 = Z probe not used to home this axis, 1 = Z probe used). By default, RepRapFirmware uses the Z probe to home the X and Y axes. On a delta printer, you must use X0 Y0 Z0.

The H parameter defines the Z probe dive height, which is the height above the trigger height from which probing starts. The default is 3mm. You may wish to increase it during initial calibration.

The G31 command sets the Z probe offset, trigger height and threshold. It must come after the M558 command, because you can have multiple Z probe types with different G31 parameters. The P parameter sets the threshold. For a smart IR probe such as my own differential IR height sensor, use 500. For a switch I also suggest 500, although a lower value may provide faster triggering if the switch has intermittant contact when first triggered..

The Z parameter sets the trigger height (the nozzle height above the bed at which the Z probe output exceeds the threshold). For a Z probe which relies on the nozzle pushing the bed down, the trigger height will be negative.

There are also optional X and Y parameters to define the horizontal offset of the Z probe from the nozzle. On a delta printer these should be left at zero, because the calibration routine needs to know where the nozzle has been placed, not where the probe is.

Heater and thermistor section

To be completed.

Tool definition section

To be completed.

Epilogue

To be completed.

Homing files

To be completed.

Bed probing file

To be completed.

Tool change files

To be completed.