In this article the complete configuration of Slic3r for use with the Flashforge Dreamer is discussed.
Slic3r is a great freeware program for slicing your prints and includes numerous options to tweak print settings to your liking. However, in order to work with the Flashforge Dreamer it needs to be configured to output G-code that the dreamer understands. Also custom G-code can be added at the start and end of each program automatically, so files generated by Slic3r can be used directly on the printer without any modifications.
General settings for Flashforge Dreamer
First, a couple of basic settings need to be adjusted for Silc3r to generate compatible G-code. Create a profile under the Printer settings tab. I called the profile “Flashforge Dual”, but any name works. In the General section under Printer tab the G-code flavor should be set to Makerware (Makerbot).
Click the “set”button next to “Bed shape”. Set the bed size to 228 by 150 mm. Set the origin position to the center of the platform by entering the origin coordinates as shown in the screenshot below:
Add custom G-code
When the basic settings are done, the custom G-code can be added. I have set up the G-code in such a way that it is as close as possible to the output generated by Flashforge’s own Flasprint program. Therefore, when both Slic3r and Flashprint are used, the files look similar, making them easier to read and navigate.
Under the links below the custom G-code can be found. Click each link and copy and paste the text into the appropriate fields in Slic3r (see screenshot below)
The before and after layer change fields can be left empty.
Note that the M106 command (PLA fan on) in the start G-code is commented out with a semicolon. This is done because typically the PLA fan is disabled for at least the first layer to create better adhesion between the part and the bed. I mostly set the “disable fan for first x layers” to 1 since this provides enough adhesion, but this may vary depending on printer, bed surface, temperature, etc. The default value in Slice3r is 3 layers.
Using this in combination with the “keep fan always on” settings will cause Slic3r to insert the M-code to activate the fan after the selected amount of layers. So far, so good, however… The M codes for fan on and off used by the FF dreamer are M106 and M107 respectively. Slic3r outputs M126 and M127 for this, which are not recognized by the FF Dreamer. In order to mitigate this issue you can manually edit the generated G-code file in any text editor and replace the M126 codes by M106 and the M127 codes by M107.
A better solution is to use a post processing script in Slic3r which performs the search and replace actions automatically.
Post processing script for Fan M-codes
Slic3r accepts any executable that is able to process a text file, with the filename as the first argument. Perl was suggested as one of the options in the Slic3r online manual. Since Perl is freeware and very suitable for editing text files I went for this option. (even without having any prior experience with Perl)
When running Linux, Perl is pre-installed with the operating system, but for windows a Perl distribution has to be installed. To do this visit the following link:
On this page, click the link to download Strawberry Perl and select the 32 or 64 bit link under “recommended version” based on which version of windows you are using to install the software.
The installation process is very straightforward. The only other thing needed to write scripts is a plain text editor. I would recommend using Notepad++ for simple scripts. It recognizes the commands in Perl formats the script using color coding and it marks loops in the code. For more advanced coding there are better tools available, but probably overkill for most Slic3r post processing scripts.
This is the small script I use to replace the fan M-codes:
A plain text version of the script is available under this link:
When saving this file, make sure to change the extension from “.TXT” to “.PL”
In Slic3r the use of a post processing script can be activated by entering the file name, including the absolute path, in the “post-processing scritps” field. See example below:
I named the script “postscript1.pl”and placed it in a convenient subdirectory. Both the location and script name can be chosen freely.
The script will be executed by Slic3r every time a G-code file is generated by the user. Upon the first execution of the script windows may prompt to associate the script with a program.
Simply select the Perl interpreter and from this moment on the script will run automatically.
This setup has been working fine for me and I hope it is a good starting point for anyone who considers using Slic3r in combination with the Flashforge Dreamer. Let me know if you have any questions or remarks in the comments below.