Updating RepRap Firmware config.g file

From RepRap
Revision as of 13:25, 9 March 2016 by PRZ (talk | contribs) (The 'config.g' file: add precision.)
Jump to: navigation, search

The 'config.g' file

To configure a Duet board 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 two 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 "configuration" window, sub-panel "configuration file".
  • Editing the config.g file and uploading it via FTP. This have the advantage that you always have an up to date copy of your configuration file in your computer.

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) 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.

Beware to upload in the /sys directory.

There are many FTP client available depending your system. 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 file itself). 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 S1
  • Comments shall be prefixed by “;”
  • add "G92 X0 Y0 Z0" at the beginning of the code, to define the origin as current, as you have not 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.