Updating RepRap Firmware config.g file

From RepRap
Revision as of 09:31, 18 March 2016 by PRZ (talk | contribs) (First sentence more generic)
Jump to: navigation, search

The 'config.g' file

To configure a board using RepRap Firmware, notably the Duet for a given machine, you have only to edit a file named 'config.g', located on the SD card in the /sys directory. This file is read and executed at startup, but the configuration can be modified later, either by executing a macro or entering commands in the web interface. These configuration modifications will be lost at next startup.

All configuration parameters are entered via 'G' and 'M' parameters, so the reprap firmware G-Code set is relatively extended. A config.g file could be reexecuted via the 'M999' command or an emergency stop.

It shall be noted that a malformed file may hang your board, and this apply to all macros executed by the 'config.g' file.

The first configuration, which shall define name, password and net configuration, will probably be done while writing the file on the SD card, as it is not wise to start a machine with an unverified file, except if you can independently supply logic and power on your board.

Any text editor could be used for modification.

After uploading the file in the SD card, inserting it in the board (while power is shutdown), restarting and connecting to the board, you have other solutions to modify the config.g file without removing the SD card.

Updating 'config.g'

For the updating of the config.g file, you have three solutions if your board connect properly:

  • Using the incorporated editor in the web interface, but that doesn't work with all browsers, notably not with Microsoft browsers.
    That editor is accessed in the "settings" tab, sub-panel "configuration file".
  • Editing file on your PC/device and uploading with the web interface. In the tab "Settings", there is a button "Upload File(s)", which allow to upload printer system files from your pc. The 'config.g' file will automatically be uploaded in the /sys directory as other system files, while web interface files (model.js and viewmodel.js, formerly interface.js) will be uploaded in /www/js directory. It allow having an up-to date copy on your PC of the printer system files.
  • Editing the config.g file on your PC and uploading it via FTP. Same advantage as web uploading for tracking the printer updates, with a bit more flexibility.
    To log in FTP, you shall use the machine name as defined in the config.g file, for the user name any name e.g. 'whatever' and the password as defined in the config.g file (the leading 'P' indicates parameter and is not part of the name nor password). Beware to upload in the /sys directory.

You could be simultaneously be logged in FTP and in http (web interface). If you have difficulties to connect directly in FTP, connect first with the web interface, this helps FTP connection.

To upload/download to the SD card via FTP, you need a FTP client program (NOT a FTP server) and there is a wide choice for all systems. On Windows, you could use the FTP function of the file viewer 'Total Commander', FileZilla or WinSCP. On Linux, there is a default ftp client named 'ftp'. On a MAC you can use CyberDuck or FileZilla.

How to configure Duet

There are a few links which may help to configure your board

How do I know that my config.g have been properly executed

Without a LED and if you do not succeed in connecting your board, you can check that the config.g is properly executed by making 'music' with your steppers.

You shall execute a file (or inserting commands it in the config.g file itself), as the last command of your config.g.

It is possible to make sound using motors. The frequency is the step frequency, so moving at a defined speed give a note. However, the frequency for a given speed depends from the step/mm ratio and each sound file shall be adapted for a given step/mm ratio. As most printers driven by a duet haven’t any local screen nor diagnostic LED, the sound may indicate proper startup.

You may call a separate macro as the last command of your config file, e.g.

M98 P/macros/startmusic.g ; call a sound file to acknowledge the startup 

You could create a music file by using this converter: http://en.homeconstructor.de/converter-convert-music-in-g-code.html On a delta printer, you shall move in Z only, to have all your motor running simultaneously with the effector speed equal to the carriage speed. On a Cartesian printer, you can use whatever axis, provided the step/mm is accurate. It is wise to limit the travel, so the converter will make back and forth travel within the defined range. The file provided by the converter shall be modified:

  • Replace all G01 by G1
  • Comments shall be prefixed by “;”
  • add "G92 X0 Y0 Z0" at the beginning of the code, to define the origin as current position, as you have not yet homed the machine
  • add "G91" to set absolute moves.

A better control on a delta may be to move each carriage independently, hence checking driver and stepper independently. A movement on 'XYZ' columns instead of 'XYZ' user space is done while adding S2 parameter to the G1 command. Unfortunately, this does only work in relative mode, so you shall convert the file from absolute to relative. Use a spreadsheet program to help conversion.

Example for 100 step/mm

100 step/mm -> example 16 teeth GT2-2, micro-step 1/16, 1.8° stepper Z travel up total 8mm. Works ok for 200 step/mm (same with 0.9° steppers)

8 first notes of French children song 'Quand on fait des crêpes'

; en.homeconstructor.de  MIDI-converter version: 2.5 
; File: crepes.mid  ;Breaks disabled ;Steps per millimeter for Z-axis: 100
G21 ; units are mm - supersedes former value, may not be needed
G90 ; Absolute positioning - supersedes former value, shall be the default except for extruder
G94 ; feed rate in units/minute, shall be the default
G92 X0 Y0 Z0; set origin to current position, required as machine is not homed
G1 Z1.23600000 F197.76000000
G1 Z1.60312500 F176.22000000
G1 Z2.42712500 F197.76000000
G1 Z3.30012500 F209.52000000
G1 Z4.28012500 F235.20000000
G1 Z5.10412500 F197.76000000
G1 Z6.41212500 F156.96000000
G1 Z7.64812500 F197.76000000
M84; shut down motors

for 87 steps/mm (like Fisher delta)sound shall be

G1 Z1.42068966 F227.31034483
G1 Z1.84267241 F202.55172414
G1 Z2.78979885 F227.31034483
G1 Z3.79324713 F240.82758621
G1 Z4.91968391 F270.34482759
G1 Z5.86681034 F227.31034483
G1 Z7.37025862 F180.41379310
G1 Z8.79094828 F227.31034483