Kategorien
Allgemeine Beiträge

Install Marlin 1.1.9 at your Creality Ender-5

swarkn

Stefans Schwerpunkte liegen im Umfeld von Betriebssystemen, serverbasierten Diensten und im weitesten Sinne in allgemeiner technischer Infrastruktur. Tagsüber mit strategischen IT-Themen beschäftigt, tackert er Nachts doch mal gerne ins schwarze Loch.
swarkn

This is a consolidated tutorial about how to configure, compile and install Marlin 1.1.9 at your Creality Ender-5. I thought that this tutorial might be interessting for others not speaking the german language, so I decided to switch language for this topic.

Warning

I absolutely will take no responsibility for any damage that will arrise as a direct or indirect result by following the instructions in this tutorial! Everything you do, will be done at your own risk and under your own responsibility!

Step-by-Step list

If you would like to follow all steps to install Marlin 1.1.9 at your Creality Ender-5, you need to follow this procedure:

  • Get an ISP USB interface for your Creality Ender-5
  • Download and install a proper bootloader (this is optional)
  • Download the latest Marlin 1.1.x source code from github
  • Configure, Compile and Upload Marlin 1.1.x to your Ender-5
  • Reset EEPROM configuration and do a manual bed leveling

Download and install a proper bootloader

This step is completely optional if you decide to install Marlin 1.1.x with its own bootcode. How ever, the common method out there in the webs is to install a proper bootloader at first and then upload Marlin 1.1.x afterwards by using the bootloaders serial interface (e.g. with OctoPrint). This is a very handy feature, because you do not need to always update your 3D printers firmware over it’s ISP interface.

However, an ISP USB interface is initially needed to upload at least the bootloader. You’ll find ISP USB interfaces for Creality 3D printers on AMAZON or ebay, usually bundled with an automatic bed leveling probe.

The bootloader I use is OptiBoot. Absolutely common and widely spread. Make yourself an easy life by choosing a preconfigured and precompiled bootloader image from MCUdude’s git repository. I used this one here.

Please follow the manual for your ISP USB interface on how to upload the bootloader (same as uploading a complete firmware). Please be aware, that the correct values „Fuse&Lock/Config bits“ for your Ender-5 typically are: „D6 DC FD“. If this differs, something went wrong with your board, the ISP or is not in line with your printer modell. Please check the ISP’s manual for details to be sure, that everything will work as expected.

Download the latest Marlin 1.1.x source code from github

Just download the latest Marlin 1.1.x source code from the projects github repository. The branch is called „bugfix-1.1.x“ and will include security bugfixes for at least some time left. Marlin 1 is announced to be discontinued in the future and Marlin 2 will not compile for your standard Ender-5 board.

Download and extract the source code onto your harddrive in an dedicated folder.

Configure, Compile and Upload Marlin 1.1.x to your Ender-5

Configuration

Also make yourself an easy ride here and choose on of the best configurations I found in the webs for Marlin 1.1.x for your Creality Ender-5 and use firestrife23’s configuration files at github. You can just download the files

  • Configuration.h
  • Configuration_adv.h

and replace the existing ones from the Marlin source code you just downloaded with them.

However, I did my own additions to his configuration, which can be found here as a fork at my github account. I basically added the following features:

  • Manual bed leveling (without a probe)
  • Nozzle park and printing pause feature (to replace fillament while printing)

I also changed the Z-JERK value to get smoother outlines for my 3D prints.

If you want to follow my configuration, than you could spare yourself some time and download my precompiled firmware here:

If you choose to update your Creality Ender-5 without a bootloader, you need to use the Marlin.ino.with_bootloader.sanguino.hex file to flash your printer.

Compile

To compile the source code, simply install a new board to your Arduino IDE by adding this link to the board configuration settings:

https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json

After that, you can update your board list and choose this board settings for your Creality Ender-5:

Installing Marlin 1.1.9 at your Creality Ender-5
Arduino IDE Board Settings

Open up Marlin.ino with your Arduino IDE. To compile and export the hex-files, simply choose „Sketch/Export compiled binary“. You will find the compiled binaries inside your source codes directory.

You you happen to use my configuration, you might get an error message which simply means, that you are running out of the build targets (Sanguino) flash memory. The build needs to be optimized.

To get the build done, create a file called „platform.local.txt“ into you corresponding Arduino IDE hardware folder. Mine is „%APPDATA%\Local\Arduino15\packages\Sanguino\hardware\avr\1.0.3“. Copy/Past these line into the newly created file:

compiler.c.extra_flags=-fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues
compiler.cpp.extra_flags=-fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues
compiler.c.elf.extra_flags=-Wl,--relax

This will optimize your binary output to fit into your boards flash memory.

Upload

This is important: if you want to update your firmware with a bootloader from above (MCUdude) installed, you need to use Marlin.ino.sanguino.hex for your printer. As mentioned above, I used OctoPrint with OctoPi and it’s plugin „Firmware updater“. After installing avrdude with

sudo apt-get update
sudo apt-get install avrdude

on my OctoPi’s ssh console and setting the plugin parameters to the following, everything works as expected:

Installing Marlin 1.1.9 at your Creality Ender-5
Plugin Settings

Upload the file without bootcode: Marlin.ino.sanguino.hex

After flashing, the printer should boot into the new firmware and OctoPrint will state with:

Congratulations! You just flashed your Creality Ender-5 with your own firmware.

Reset EEPROM configuration and do a manual bed leveling

You might have noticed, that I put the commands M502 and M500 into the „Post flash gcode“ section of the plugins configuration page. These commands will reset the EEPROM configuration to factory defaults and save the new configuration into EEPROM.

Now, at your printers LCD menue, you will be able to do a manual bed leveling (which was missing since Creality put out 1.1.6.1-1.1.6.3):

Prepare\Bed leveling\Level bed

Please don’t forget to store your settings, after the manual bed leveling is finished.

Finished!

So hopefully this was a little bit helpful for you guys. I know, this is not the best detailed tutorial and more or less just a consolidation of other very good post I found myself useful while striving through the webs. But it might hopefully give you a hint into the right direction.

Please leave a comment if I missed something critical or if you want me to add some useful information. Thank you! 🙂

-Stefan aka. swarkn

pinterest
Kategorien
Allgemeine Beiträge Projekte & Langläufer

Arduino MAX485 Library

swarkn

Stefans Schwerpunkte liegen im Umfeld von Betriebssystemen, serverbasierten Diensten und im weitesten Sinne in allgemeiner technischer Infrastruktur. Tagsüber mit strategischen IT-Themen beschäftigt, tackert er Nachts doch mal gerne ins schwarze Loch.
swarkn

Hallo zusammen,

EDIT (05.05.2015): Projektseite mit mehr Details erstellt.

vor ein paar Tagen habe ich euch in meinem Blogpost über das „TTL to RS-485 module“ berichtet. Nun möchte ich euch gerne zeigen, wie Ihr damit über einfachste Methoden eine Kommunikation zwischen zwei Arduinos aufbauen könnt. Dazu habe ich eine „Arduino MAX485 Library“ (s. github) geschrieben, die euch dabei helfen kann.

Zu allererst stellt folgende Verdrahtung her:

Arduino MAX485 LibraryDas passt alles super auf ein Breadboard. Keine Angst wegen der fehlenden Widerstände. Auf diese Entfernung spielt das keine Rolle. Wenn ihr wie ich die großen TTL to RS-485 Module habt, kein Problem. Ich habe mir mit einem Testboard (s. Titelbild) ausgeholfen. Hier die Verdrahtung in tabellarischer Form:

Arduino LinksMAX485 Links
VIN5V
GNDGND
D8Pin2 (RE)
D9Pin3 (DE)
D10Pin1 (RO)
D11Pin4 (DI)
MAX485 LinksMAX485 Rechts
Pin8 (VCC)5V
Pin7 (B)Pin7 (B)
Pin6 (A)Pin6 (A)
Pin5 (GND)GND

Der rechte MAX485 muss natürlich analog des linken MAX485 aber mit dem rechten Arduino verbunden werden. Damit ist der Testaufbau beendet.

Verwenden der Arduino MAX485 Library

Ladet jetzt die MAX485 Bibliothek von uns aus github herunter. Diese eignet sich übrigens hervorragend, um eigene kleine anwendungsspezifische Protokolle zu schreiben. Extrahiert die ZIP-Datei in euren libraries-Ordner. Es müsste sich nun ein „MAX485-master“ Ordner darin befinden. Benennt diesen einfach in „MAX485“ um. Jetzt seid ihr startklar.

Programmiert den linken Arduino mit dem „EIA-485_Master“ Sketch. Den rechten Arduino programmiert ihr mit dem „EIA-485_Slave2USB“ Sketch.

Um die Funktion des Testaufbaus zu verfolgen, belasst den rechten Arduino via USB am PC verbunden und öffnet die serielle Konsole des USB-Ports. Die Ausgabe sollte ungefähr so aussehen:

Arduino MAX485 Library

Unter Umständen kann – wie auf dem Screenshot zu sehen – die Übertragung gerade bei den ersten Bytes nicht fehlerfrei verlaufen. Ein Grund, weswegen man sich bei eigenen Protokollentwicklungen sicher das ein oder andere zum Thema Error-Detection einfallen lassen muss.

Ich hoffe ihr findet den Artikel und meine einfache Arduino MAX485 Library irgendwie hilfreich. 🙂

Viel Spaß dabei,
Swarkn

pinterest