4
$\begingroup$

I have various G-code files stored at SDCard attached to my Prusa i3 MK2S printer. They are either for ABS, PLA or SBS. The more files I had on the SD card, the more I was running into trouble of finding for which material is which G-code.

To tackle the situation I created folders ABS, PLA and SBS and put new files into those directories.


Is there any better method of finding, backwards from G-code, which material settings were intended to be used?

If so, is there a way to read temperature settings from G-code by Prusa i3 firmware without printing the actual model?

$\endgroup$
1
  • 1
    $\begingroup$ Not an answer, but sort of related and a good idea: Best Practices - Labeling GCode Files. Use a filename format such as {Machine+State}_{FileName}_{YYYYMMDD-TTTT}_{FileID}.gcode, for example, UM2+PLA8_NozzleMag_20160911-1520_ym9450.gcode $\endgroup$
    – Greenonline
    Jun 4, 2018 at 20:04

1 Answer 1

3
$\begingroup$

Good question as I also ran into some files not remembering for which purpose or which material I printed these. The online G-code visualizers do not display the temperature or the correct filament width, so basically that won't help you (unless you modify the open source programs...). Reading from firmware would not be possible without adding a new feature, as far as I know, this is not implemented in Marlin Firmware or in Prusa firmware (which is based on Marlin).

When using a printer server like OctoPrint, you can store your G-code files in a folder structure that you can define yourself; so basically create a directory structure based on the material type, brand, etc.

However, it is relatively easy to write a small program in Python to read a file and interpret the lines (even if you're not a programmer). There are lots of tutorials and examples to find to open files read the file e.g. line by line and detect strings to identify the settings for G-codes M104/M109 (hot end temperature) and M140/M190 (bed temperature). Usually you slice your models with a specific set of bed and hot end temperature (which you know), so basically you can find out which material was meant to be printed with the G-code file. You could even let the program sort the files for you by moving them into separate folders.

I'll add it to my list of things I'd like to do some rainy day! :)

Note that some printers use different, or even custom G-codes to control bed temperature; e.g. when reading Ultimaker 3 G-code files you cannot see the bed temperature!

$\endgroup$
2
  • 3
    $\begingroup$ You could also add comment line to the generated GCode, usually it begins with ; symbol. The comment can be inserted in slicer as a startcode. $\endgroup$
    – jnovacho
    Jun 4, 2018 at 11:59
  • 1
    $\begingroup$ @jnovacho Good point you raise, but if you have never done that, you are stuck with the files you have. It is a good idea to insert a comment based on material settings in new files! $\endgroup$
    – 0scar
    Jun 4, 2018 at 12:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .