Installing Marlin 1.1.9 on your CR-10S with mesh bed leveling, thermal protection, better menu layout and FINALLY Power Resume

This is an update to our previous articles about making your own version or Marlin 1.1.6/ 1.1.7/1.1.8. You will also find in the zip file below Creality’s original firmware but I have gone ahead and enable the very important setting of thermal protection. So if you want to keep their power resume feature but still run the older Marlin firmware then you can go right ahead.

Finally!!!!

When Creality released their firmware the guys over at Marlin were able to get a look inside and have integrated their power resume into the firmware and with this one it is now enabled.

Before we start: This is for the CR-10S and not the CR-10. Don’t use this firmware or follow these instructions for the CR-10. It is a different board and uses different settings. The older CR-10 uses a MELZI board which has less memory so in order to get it to work you will have to remove a lot of options to get everything to fit.

The firmware for the CR-10S is based on Marlin http://marlinfw.org which is an open source project and as such means you can modify the source code as you want. While this article will be long and involved, I will get right to the point and just give you the .hex file and you can go ahead and just install it and close out this page. This version has mesh bed leveling, baby stepping and EEPROM storage enabled.

Inside the zip is a file called instructions.pdf on how to flash your firmware.

 CR-10S 1.1.9 Firmware Source Code and Hex Files

However, if you’re still reading this then we will go ahead and get moving. Let’s install and configure the software and give you a quick lesson on what we will be doing.

  1. You will need to download and install the Arduino IDE. https://www.arduino.cc/en/Main/Software
  2. Next you will need to download and install the U8glib library. https://bintray.com/olikraus/u8glib/download_file?file_path=u8glib_arduino_v1.18.1.zip and then from inside Arduino go to sketch>include library>add zip library and select the zip file. This is a library used to run the LCD display.
  3. A preference we should setup inside of Arduino is to show line numbers. This will help us guide our way through the code and I will be referring to line numbers and the variable names for version 1.1.9. If you are reading this and using a different firmware version then line numbers may have changed but most likely the variable names will be the same. Now in the Arduino software go to File>Preferences and put a check mark in the box next to Display Line Number.
  4. Finally you need to download the 1.1.9 firmware http://marlinfw.org/meta/download/ and unzip the folder. Don’t rename the folder or move the files around inside it. You can put it anywhere you like to work on it. Go into the folders till you find Marlin.ino and open that file from inside Arduino IDE. It will open the full project and put all the files into separate tabs along the top.

Now we are ready to get to work modifying things. Most of the work we will be doing will be in Configuration.h but we will be touching a few other ones. I will call those out later on. In Arduino if a line is “commented” this means that the instructions on that line are ignored. Marlin is well written and most of what we be doing is uncommenting an option or changing a value of something. To uncomment a line you just remove the two forward slashes // at the beginning of the line. To comment out a line you will just and // at the start of the line.

 

Configurations.h

This is where most of the work is done. It has all the basic settings in this one file.

 

Line 119: #define BAUDRATE 115200

This is the speed that it communicates over USB. It could be one of the faster speeds but honestly this is enough.

Line 127: #define MOTHERBOARD BOARD_RAMPS_14_EFB

There are many boards that support Marlin and this is one of them. It is based off the very popular board RAMPS. It should already be set to this but I just wanted to draw your attention to this line.

Line 132: #define CUSTOM_MACHINE_NAME "CR-10S"

Uncomment then change the name between the quotes. When your machine starts up this is the name that is displayed in the bottom left of the screen. It can be anything you want between the quotes, even Printer McPrintface if you like.

Line 145: #define DEFAULT_NOMINAL_FILAMENT_DIA 1.75  

Here we set what size filament will be used in the machine.

Line 306: #define TEMP_SENSOR_0 1

This sets the type of sensor used for measuring the hotend temperature. For the stock hotend you will use “1” and for an E3Dv6 hotend you will use “5” 

Line 311: #define TEMP_SENSOR_BED 1

This sets the bed sensor for the stock bed.

Line 346: #define HEATER_0_MAXTEMP 250

This is the limit for how hot your hotend will go. For the stock hotend you should set it for 250 and for an E3Dv6 hotend you can set it to 300.

Line 351: #define BED_MAXTEMP 120

This is the limit for how hot your bed will go. In this case we can set it to 120 but honestly you will be lucky to ever go above 80c.

Line 476: #define THERMAL_PROTECTION_HOTENDS

Line 477: #define THERMAL_PROTECTION_BED

These two lines are what protects your machine from thermal runaway. While they are already uncommented I wanted to still point them out so you know to pay attention to them.

Line 601: #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 93 }

This is the amount of steps your printer has to use to move a specific distance. Things like drivers, motors, gearing, screws can change these numbers but the ones above are good for a stock CR-10S. These can be tuned later from the control screen thanks to the EEPROM settings we will be enabling later.

Line 608: #define DEFAULT_MAX_FEEDRATE          { 300, 300, 5, 25 }

This is the fastest the machine will move in all directions.

Line 626:  #define DEFAULT_ACCELERATION          500

Acceleration is the rate of change of speed.  It is defined in mm/s^2.  Your printer slows down when changing direction and then speeds back up again in straight lines.  This line is the acceleration the printer will make suring printing moves.  575 is fairly slow, but for a printer like the CR10S with a big moving bed, it will help prevent ringing.  

Line 627: #define DEFAULT_RETRACT_ACCELERATION  500

This is the acceleration applied to your extruder retraction.  You want this as high as it can go before the filament starts stripping out to help prevent strining.

Line 628: #define DEFAULT_TRAVEL_ACCELERATION   1000

This is the acceleration of your printer when it is not printing.  Since it is not printing at the time, it can be a little higher since you won't be able to see the ringing.  If it is too high, you could see skipped steps and layer shifts.

Line 841: #define INVERT_X_DIR false

Line 842: #define INVERT_Y_DIR false

Line 843: #define INVERT_Z_DIR true

These 3 line define the direction of each axis. If your machine moves in the opposite direction of what you expect then change it to true or false.

Line 872: #define X_BED_SIZE 300

Line 873: #define Y_BED_SIZE 300

Line 881: #define Z_MAX_POS 400

This is where we set the actual bed size of your printer and the Z height.

Line 920: Uncomment #define FILAMENT_RUNOUT_SENSOR

This will enable the filament sensor.

Line 923: #define FIL_RUNOUT_INVERTING true

Here we are changing the way the switch on the filament sensor works.

Line 970: Uncomment #define MESH_BED_LEVELING

This is the fun part. No probe, no hardware. This allows you to level the bed at multiple points manually and it will create a 3D mesh of the surface to allow you to print on an uneven bed.  It will use the manual bed leveling as defined here

Line 1013: #define GRID_MAX_POINTS_X 3

We are setting this to 3 which means it will have you level 3 times along the X axis and 3 times along the Y axis for a total of 9 points. If you set this to 5 then it would mean you have to adjust level 25 times on the bed. 3 is a really good number for this. It should already be set to this but I just wanted to draw your attention to this line.

Line 1092: Uncomment #define LCD_BED_LEVELING

This adds the option to run mesh bed leveling to the LCD screen.

Line 1100:  Uncomment #define LEVEL_BED_CORNERS

This adds the option to level the corners of your bed before running mesh leveling.

Line 1216: Uncomment #define EEPROM_SETTINGS

This allows you to adjust things like offsets and steps and store them.

Line 1217: Uncomment #define DISABLE_M503

This is a command that shows the settings as they were set in the firmware and not the ones you changed in the EEPROM. We are disabling this to save some memory.

Line 1248: #define PREHEAT_1_TEMP_HOTEND 205

Line 1249: #define PREHEAT_1_TEMP_BED     60

Line 1250: #define PREHEAT_1_FAN_SPEED     0

Line 1252: #define PREHEAT_2_TEMP_HOTEND 250

Line 1253: #define PREHEAT_2_TEMP_BED     80

Line 1254: #define PREHEAT_2_FAN_SPEED     0

The lines 1248-1254 set the temps and fan speeds for the menu items to preheat for PLA and ABS.

Line 1267: Uncomment #define NOZZLE_PARK_FEATURE

This is required for the pause feature and is used to establish where to park the nozzle

Line 1419: Uncomment #define SDSUPPORT

This enables the SD card slot so you can print from SD.

Line 1453: Uncomment #define ENCODER_PULSES_PER_STEP 1

Leave this at 1 for the CR-10S

Line 1459: Uncomment #define ENCODER_STEPS_PER_MENU_ITEM 5

This is how far the knob needs to turn to move between menu items. Make this number lower if it is too sensitive and higher if it is not.

Line 1499: Uncomment #define SPEAKER

This will let the machine beep and make sounds.

Line 1649: Uncomment #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

This enables the LCD screen. When we first installed U8Glib library, it was for this option.

 

Configuration_adv.h

This is where the more advance settings are configured. If you don’t find what you’re looking for in the configuration.h file then odds are it will be here.

 

Line 591: Uncomment #define POWER_LOSS_RECOVERY

This is what everyone has been waiting for. Power loss recovery. While it is a neat feature you may want to leave it disabled. It will constantly write to your SD card the current state of the print and that can wear out your SD card much faster than expected.

Line 593: Uncomment #define POWER_LOSS_PIN

This sets the pin to detect power loss

Line 594: Uncomment #define POWER_LOSS_STATE

This is the state of pin indicating power loss.

Line 742: Uncomment #define BABYSTEPPING

Baby stepping allows you to adjust the Z axis while printing to help get the perfect 1st layer.

Line 746: #define BABYSTEP_MULTIPLICATOR 5

This is how much your Z axis will move per rotation on the knob. I find 5 is a good number but if you want finer control then lower this number. IF you want it to move more per click then increase this number.

Line 748: Uncomment #define DOUBLECLICK_FOR_Z_BABYSTEPPING

This makes it so if you want to adjust baby stepping then you can press the control knob two times quickly and you will enter baby step mode.

Line 793: Comment out // #define ARC_SUPPORT

Not really used since most slicers don’t do this function by default. If we disable it then we save even more memory.

Line 976: Uncomment #define ADVANCED_PAUSE_FEATURE

This is for the filament runout sensor. It will home the hotend and unload the filament from the nozzle. Then once you load more filament it will wait till it’s extruding before beginning the print.

Pins_RAMPS.h

This file is where the board pins are configured. Each pin on a board has to be addressed for all the features in the other files to know where to go. We will be using the RAMPS 1.4 board that we configured in the configuration.h file and modifying some of the pins to change it over to work with the Creality board.

 

Line 74: #define X_MAX_PIN -1

We are changing this one value to disable the X_MAX_PIN which conflicts with the filament sensor.

Line 282: #define FIL_RUNOUT_PIN      2

We are changing this one value from 4 to 2 so we are using the right pin for the filament sensor.

Line 427: #define SD_DETECT_PIN -1

We are changing this one value to disable the SD_DETECT_PIN  which is not used on the Creality board.

Line 439: #define SD_DETECT_PIN     -1

We are changing this one value to disable the SD_DETECT_PIN which is not used on the Creality board.You will noticed that I changed this on an earlier line. I am doing it twice just in case someone is using the older LCD board but wants to use this firmware as well.

 

 

All done! Save your work.

Wow, you really have been sticking with me this whole time and you have modified everything and you are ready to build your firmware and install it. Kudos for sticking with me this whole time.

  1. Select Tools>Board>Arduino/Genuino Mega or Mega 2560 and then Tools>Processor>ATMega2560 (Mega 2560) and then select the COM port for your printer. Did I mention that you should have already plugged your printer into your computer?
  2. Now we want to verify and compile the code. You can do this by clicking on the checkmark icon in the tool bar or by going to Sketch>Verify/Compile
  3. If you got no errors then congratulations and now you are ready to upload the firmware. Go to Sketch>Upload or click on the icon in the toolbar that is an arrow pointing to the right.
  4. Now you are all set and good to go, enjoy your new firmware. Let us know what you think and if you think we should do anything more.



David Randolph
David Randolph

Author

I have a background in film and television engineering and IT with over 9 years with 3D printing and laser cutting. I've fought robots and even has a Guinness world record for worlds largest video game controller. My nerd cred is strong.



Leave a comment

Comments will be approved before showing up.