SD card Structure

File Structure

On the microSD card there are four different folders: gcodes, macros, sys and www. These folders contain all the information the Duet board needs to operate properly. Below is a list of the folders and their purpose.

  • gcodes: This folder contains .gcode files that can be run by the Duet. If you upload print files through the Duet Web Console or via a microSD card they should be placed in this folder.

  • macros: Any macro files that you create should be located in this folder. Macros are .gcode files that can be executed to perform a repetetive task more quickly.

  • sys: Configuration files of the printer. Contains important .gcode files such as config.g which are executed on startup. You will need to change files in this folder regularly.

  • www: Holds all files necessary for the operation of the Duet Web Console. It is recommended not to mess with the files here unless you are familiar with web development.

Sys Organization

As mentioned before, the sys/ folder contains all sorts of system files. The most important file is config.g. This file is executed on the start-up of the Duet Maestro board in order to configure the Crane settings. If you wanted to add a command to the start-up sequence, you should insert it in config.g. If you take a look at the config.g file you will see the following:

; Configuration file for Duet Maestro (firmware version 2.02RC2 or newer)
; executed by the firmware on start-up
; Created by PrintM3D
; for the Crane Bowden
;

M98 Pgeneral.g                   ; Call General Configuration Module
M98 Pnetwork.g                   ; Call Network Module
M98 Pmotion.g                    ; Call Kinematics/Motor Module
M98 Pthermal.g                   ; Call Heater/Fan/Sensing Module
M98 Ptools.g                     ; Call Toolhead Module

Configuration Files:

; general.g
; Created by PrintM3D
; for the Crane Bowden
;
; The file sets initial movement phases and sets compatibility to RRFW.
;
; Logging Settings
;
;M929 P"eventlog.txt" S1  	     ; Uncomment This Line to Enable Event Logging
;
; General preferences
G90                              ; Send absolute coordinates...
M83                              ; Set relative extruder moves
M555 P1                          ; Set firmware compatibility Mode to RRFW
M501

"Everything is gcode."

gcode

G90

Sets coordinates to absolute relative to the origin of the machine.

M83

Sets extrusion values as relative positions.

M555 P1

Sets firmware so as it's input and output is similar to other established firmware. In this case the P argument is 1, for RepRap_firmware.

M501

This allows the stored parameters to be loaded at startup. It can also revert parameters to stored values after experimenting with them.

Other Files

In the sys folder you will find many other files which handle other important aspects of the printer. Observe the list below for an explanation of the different files.

  • config.g: This file is called upon the boot-up of the Duet board. Place G-code commands here in order for them to be executed on start-up. This file calls multiple machine files listed above with the M98 command.

  • homex.g, homey.g, homez.g and homeall.g: These files operate the homing procedure. Follow Homing the Printer for more help on homing the printer, and Adjusting Homing Macros in order to adjust the homing macros.

  • pause.g this M25 will pause your print at it's current position.

  • stop.g when the firmware finishes the moves left in it's buffer, the macro M0 stop.g is called this will lift z axis to make clearance for your print, move the bed forward so the print can be removed, then will turn off the heaters, motors, and any part cooling fan that is in use.

  • start.g M23 will select your file and M24 will set your printer to start printing the selected file.

  • resume.g M24 this will resume a print that was previously paused. It will resume printing from the point at which it was paused. Use M23 to restart the print from the beginning.

  • bed.g is executed when a G32 is called. This command is more widely explained in our Bed Leveling Guide.

  • sleep.g when the printer has shut down and all the motors and heaters are turned off, sleep.g M1 can be send which will wake it up again.

Going deeper:

If you would like to learn more about gcode and it's various commands, we recommend starting HERE.

Last updated