Well technically the firmware on the Ender 3 is Marlin. just a customized version of it, but I wanted the full Marlin firmware on the Ender 3. And because I can't seem to stop getting into deeper problems with this, I am trying Marlin 2.0 which is not quite released yet.
To load up Marlin on the Ender 3, I had to do two things (really only one thing if I wanted to use a pre-compiled image):
- Burn the bootloader since the Ender 3 does not have a bootloader from the factory.
- compile and load an image of Marlin 2.0
The bootloader is just needed to load other firmware on the motherboard, and the Arduino IDE can take care of it with some work. Some jumper wires however are required. The following are good guides to burning the bootloader:
https://matterhackers.dozuki.com/Guide/Flashing+the+Bootloader+on+a+Creality+CR-10/62
https://www.youtube.com/watch?v=27RDXtKjrCI
Part 1 is pretty straightforward, and I could have stopped there and just used a pre-compiled binary for the Ender3, but I wanted to compile a version from Marlin2.0 using the Arduino IDE.
To get started I used the configuration.h from Blinkii (https://www.thingiverse.com/thing:2981891) who was kind enough to upload a working image of Marlin 2.0 for the Ender 3, and his configuration files for Marlin 2.0.
==========================================================================================
Update - I removed some bogus info due to my lack of understanding of PID - the following is correct to the best of my current knowledge:
To tune PID for the heated bed, I used the info here:
https://www.youtube.com/watch?v=6gr-XOJ_1Fo
That is basically running this GCode from the Octoprint terminal:
M303 E-1 C8 S90
E-1 specifies the heated bed
C8 = run the calibration for 8 cycles
S90 = use 90deg C as the target bed temp
That will then run for a bit and if you have Octoprint, it will show the temp going up. On the terminal it helps to suppress the temp messages, but I noticed that I had to uncheck that to see the results. When it was done I had this:
Recv: Kp: 866.45 Ki: 170.59 Kd: 1100.17
Which I then set using this:
M304 P866.45 I170.59 D1100.17
Then M500 to save the settings to EEPROM, and M501 to confirm they are correctly saved. This calibration routine is custom to each printer so don't just pop these in, does not work that way. A similar calibration routine can be run on the hot-end, but the parameters are different. In the linked video, E303 E0 S200 C8, he used to calibrate and M301 was used to save them, with M500 to save the settings and M501 to view are the same.
The same values can be entered directly into the Marlin configuration.h by searching for these and changing the values, below are mine:
//Default Bed PID
#define DEFAULT_bedKp 866.45
#define DEFAULT_bedKi 170.59
#define DEFAULT_bedKd 1100.17
As an aside, I found that in TH3D's Marlin flavor which I am now trying out, these are in configuration_backend.h which it says not to edit so probably, though I did it and then re-ran the calibration utility anyway.
Getting back to the Blinkii Marlin 2.0 configuration.h files, I also changed this line in configuration.h to English (en) since the file from thingiverse was set for German (de):
#define LCD_LANGUAGE en
Once I had the configuration.h and configuration_adv.h settings the way I wanted them for my printer, I had to compile them with the Arduino IDE which is easier than it sounds. I did have a few errors however.
This error popped up when attempting to compile Marlin 2.0 using Arduino IDE 1.8.5:
Arduino: 1.8.5 (Windows 7), Board: "Sanguino, ATmega1284 or ATmega1284P (16 MHz)"
sketch\src\lcd\dogm\u8g_dev_ssd1306_sh1106_128x64_I2C.cpp:72:20: fatal error: U8glib.h: No such file or directory
#include <U8glib.h>
^
compilation terminated.
exit status 1
Error compiling for board Sanguino.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I did two things to get around this:
1. Followed the instructions here to change my build.path=c:\temp (or something short like that)
https://www.v1engineering.com/forum/topic/avr-gcc-exe-the-filename-or-extension-is-too-long/#post-56045
2. And then I just installed the missing library from the Arudino Library manager ( Sketch > Include Library > Manage Libraries > search for "U8glib" and I think it was the 1.19.1 version bu Oliver that I used.
Then Marlin 2.0 was able to compile. I had the Arduino IDE configured to complie for a Sanguino / "ATmega 1284 or ATmega 1284P (16 MHz)" and then plugged in the board for the Ender 3 and uploaded the sketch. I also exported the binary in case I need it later. I almost forgot that the Sanguino board profile is not available by default - it needs to be installed maually in the Arduino IDE - just follow step 6 here or heck just follow that guide, it is really good.
Thanks to Marlin I can now get my extruder calibrated and it is starting to look better, I am just a few steps from hopefully getting it dialed in. Unfortunately the damn think bucked a bit when I was printing a test cube and tore up the build tac. This is one stubborn machine.