Categories
3D Printing

Configuring Marlin 2.0 for an Ender 3/Pro and BLTouch

Setting up Marlin is fiddly at the best of times. Having to revise your configurations every update certainly doesn’t help. This is a no nonsense, simple guide (and note to self) to configuring Marlin 2.0 for the Ender 3/Pro with BLTouch ABL sensor. I’m using an SKR v1.4 Turbo. The same applies for the original Creality Melzi 1.X.X boards, just be sure to save as much space as possible!

The Template

Firstly, you’ll need the Marlin firmware with the appropriate template settings.

  1. Start by downloading the latest stable release of Marlin from here.
  2. Extract the zip.
  3. Copy the 4 files from config/examples/Creality/Ender-3 to the Marlin/ folder, overwriting the 2 already there.

Configuration.h

Open the new Marlin/Configuration.h file using a text editor suitable for code, like Sublime Text or Notepad++. We’ll customise our configuration now:

  1. Change STRING_CONFIG_H_AUTHOR to clearly differentiate the configuration from the default
  2. Disable SHOW_BOOTSCREEN and SHOW_CUSTOM_BOOTSCREEN to save space by commenting out the lines (prefix them with # )
  3. Ensure you have the correct BAUDRATE. The original Ender 3 was configured to 115200 by Creality, but the newer Ender 3 Pro (and newer Creality motherboards) default to 250000. You may be fine with 250000 on an older Ender 3.
  4. Change CUSTOM_MACHINE_NAME to represent your printer, e.g. "Ender 3 Pro"
  5. If you’re using a BLTouch ABL sensor:
    1. Uncomment #define BLTOUCH
    2. #define SERVO0_PIN 27 is not required to set up your BLTouch in Marlin 2.x, as it’s defined in the pins folder by default
    3. You’ll need to customise the offset between Probe and Extruder. In Marlin 1.x, this was done with X, Y and Z_PROBE_OFFSET_FROM_EXTRUDER. In Marlin 2.x, they’re now combined in NOZZLE_TO_PROBE_OFFSET. Instructions are in the comments. Using the Creality BLTouch Kit bracket, mine is { -43, -9, 0 }. It’s safer to leave Z as 0 here are calibrate this yourself later.
    4. To keep the probe away from the edge of the bed, increase MIN_PROBE_EDGE to 20
    5. You can increase XY_PROBE_SPEED to 10000 to speed up probing slightly
    6. Uncomment #define AUTO_BED_LEVELING_BILINEAR to enable bilinear ABL
    7. By default, bilinear ABL uses a 3×3 grid. You can change this by editing GRID_MAX_POINTS_X under EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR). Mine is set to 5, for a 5×5 grid
    8. Uncomment #define LCD_BED_LEVELING to add bed leveling menu items
  6. If your bed is non-standard, you’ll need to adjust the size and/or travel limits to make sure Marlin knows this. I use bulldog clips to secure a glass bed. To ensure the nozzle stays clear of the clips, I’ve changed the following: Y_BED_SIZE from 235 to 199, X_MIN_POS from 0 to -2, Y_MIN_POS from 0 to -24.
  7. Uncomment Z_SAFE_HOMING. This prevents your Z homing from occuring without prior X and Y homing. Without this, you may accidentally miss the bed when homing Z.
  8. To increase the homing speed, increase HOMING_FEEDRATE_XY from (20*60) to (40*60) and HOMING_FEEDRATE_Z from (4*60) to (8*60).
  9. If you want to use PID to efficiently heat your bed, uncomment #define PIDTEMPBED. You’ll need to calibrate this later.
  10. If you’re using a “silent” Creality board v1.1.4 or v1.1.5, you’re using TMC2208 drivers in standalone mode. Uncomment X, Y, Z and E0_DRIVER_TYPE and set them to TMC2208_STANDALONE.
  11. To save space, uncomment #define SLIM_LCD_MENUS. This will remove many menu items that you won’t need if controlling using a PC or OctoPrint.
  12. To save space:
    1. Comment out #define SPEAKER. This will stop fully disable the speaker.
    2. If you won’t be printing from SD card, comment out #define SDSUPPORTand #define POWER_LOSS_RECOVERY. If you are still using an SD card, it’s time to look into OctoPi.
    3. If you can do without scrolling long file names on the display, comment out #define SCROLL_LONG_FILENAMES.
  13. Save the file and close the file.

Configuration_adv.h

Open the new Marlin/Configuration_adv.h file in your chosen text editor.

  1. If you’re using a BLTouch:
    1. Uncomment #define BLTOUCH_DELAY and change from 500 to 200. This reduces the pause after each individual probe.
    2. Babystepping allows the nozzle to move a tiny amount without changing the recorded coordinates for the hotend. This is usually used for calibrating your Z Offset for a perfect first layer. You can increase BABYSTEP_MULTIPLICATOR_Z and _XY to 10 for faster motion.
    3. Uncomment BABYSTEP_ZPROBE_OFFSET and #define BABYSTEP_ZPROBE_GFX_OVERLAY
  2. If you want to use Linear Advance to increase your print quality at higher speeds, uncomment #define LIN_ADVANCE and set LIN_ADVANCE_K from 0.22 to 0, which will enable the feature but turn it off. Your GCODE will need to specify the K value, which you’ll calibrate later. You need different K values for different filament types. Note that LinearsAdvance is not compatible with the TMC2208 stepper driver in Standalone mode (using StealthChop), so will not worth with Creality “silent” boards v1.1.4 and v1.1.5.
  3. To save space, comment out #define ARC_SUPPORT. This feature is used by other types of CNC machines, but usually not 3D printers.
  4. If you want to display progress and time remaining from another system with the M73 command, such as OctoPrint, uncomment LCD_SET_PROGRESS_MANUALLY. If your system will also send the M73 R parameter to update the time remaining, uncomment USE_M73_REMAINING_TIME.
  5. Marlin watches the rate of temperature increase for hotend and bed. If it’s too slow, it will trigger an error and halt your print. If you have the windows open for ventilation and it’s cold out, this can be a problem. Increase WATCH_BED_TEMP_PERIOD a little if you have this issue.
  6. Save your changes and close the file.

To The Printer!

  1. Take a copy of your M503 output to save your current printer settings. You’ll need to put some of these back later.
  2. Open Marlin/Marlin.ino with the Arduino IDE and write the new firmware to your printer.
  3. Run M502 to set all settings to those specified in your firmware files, then M500 to store these settings in the EEPROM.
  4. Depending on your configuration, you’ll now want to calibrate your Z-Probe Offset, PID for Hotend and Heated Bed and Linear Advance, or set them from your previous values.
Categories
3D Printing

How to set your 3D Printer Z-Probe Offset

Getting your Z-probe offset right is really important. It tells your printer what the physical difference is between your probe and the print nozzle.

Get it wrong, and you’ll either start printing in midair (bad) or hit the print bed with the nozzle (very bad),

Setting your Z-Probe Offset is easily done in OctoPrint or similar with a few Marlin commands and a piece of paper. If, like me, you’re forever modifying your printer, having a straightforward reference guide for this process will come in handy…

  1. Reset your Z-Probe Offset with M851 Z0
  2. Save this to the EEPROM using M500
  3. Set EEPROM values as your Active Parameters using M501
  4. Confirm the value of the Z-Probe Offset using M503
  5. Use G28 to auto-home. This will move up slightly after the Z-Probe is triggered
  6. Use G1 F60 Z0 to move back to Z0
  7. Unlock the soft Z limit to enable movement below Z0 using M211 S0
  8. Heat the nozzle to the temperature you’ll usually print at using M109 S<temp>, for example M109 S190, as the measurements may be different due to the metal expanding
  9. Put a piece of paper underneath the nozzle, and move Z down until the paper can only just be moved
  10. Check the Z position on the printer screen, and subtract another 0.1 from this value to account for the thickness of the paper. This will be your new Z-Probe Offset value
  11. Set the nozzle temperature back to 0 with M104 S0
  12. Set your new Z-Probe Offset using M851 Z<newValue>, for example M851 Z-2.2
  13. Re-enable the soft movement limits using M211 S1
  14. Save the new Z-Probe Offset to your EEPROM using M500
  15. Set EEPROM values as your Active Parameters using M501
  16. Confirm the value of the Z-Probe Offset using M503
  17. Use G28 to auto-home again
  18. Use G1 F60 Z0 to move to the new Z0, which should place the nozzle should be fractionally above the build plate
Categories
3D Printing

Semi-Automatic Bed Leveling

If you have a digital bed leveling sensor like the BLTouch on your 3D printer, you can use it to manually level your bed to near perfect, and leave the sensor to pick up any remaining slack during your prints. The following instructions are for Marlin firmware.

  1. Set the bed temperature to your usual print setting, using M190. For example, M190 S50
  2. Use G28 to auto-home. This ensures the print head is where the printer thinks it is.
  3. Start auto bed leveling with G29. This will return a matrix of measurements in the console.
  4. Review the measurements. You want each to be as close to 0 as possible.
  5. Level your bed manually by making small adjustments and running G29 again to check on progress. Remember that every adjustment you make affects the entire bed, not just that corner.

If you’re finding your bed isn’t perfect, because of the middle values, even though your corners are level, your bed may be warped. This is often caused by the 4 point leveling system forcing the points closer together than the bed would like, so it’s also worth looking into 3-point leveling solutions – expect to pay about $15 on AliExpress.

If you’re comfortable writing GCode scripts, you could use G30 to manually probe each point exactly above your leveling screws,

Categories
3D Printing

Optimise your 3D Printer Extruder by calculating your E steps

E steps tell your firmware how many steps your extruder stepper motor needs to move to extrude one millimetre of filament.

On a cheap 3D printer, like the Ender 3, this will not be factory calibrated based on your individual motor, and even if it were you’ll need a value to enter when configuring your own Marlin firmware upgrade, so best to work out your own value.

As extruder mechanisms put pressure on the filament, the teeth dig into the filament itself (in order to grip and move it). The amount the teeth dig in will vary depending on the filament, so you may potentially find the E steps value needs to be changed when you change your filament, but you’ll likely get away without changing this value often once calibrated.

The process is pretty straightforward, though easier if you have a metal rule instead of a plastic ruler.

  1. Retract your filament so only a few centimetres are going through your extruder. This will avoid wasting filament.
  2. Check for any over or under extrusion:
    1. Measure 120mm along the filament from where it enters the extruder and mark this position with a pen or pencil.
    2. Disable cold extrusion prevention using M302 P1
    3. Set your extruder to relative mode using G91
    4. Extrude 100mm of filament using G1 E100 F100
      • You may need to do this twice as G1 E50 F100 as 100 may be rejected as being too long for a single command
    5. Measure the remaining distance along the filament from where it enters the extruder to where you marked 120mm earlier to get your remaining distance
    6. 120mm – [remaining distance] = actual extrusion length
  3. Calculate your new E steps value
    1. Use M503 to report current eeprom settings
    2. Note the current E steps value at the end of the line beginning with M92.
    3. 100mm/[actual extrusion length] * [current E steps value] = new E steps value
  4. Test it
    1. Use M92 E[new E steps value] to set the corrected value
    2. Repeat step 2 above. The extrusion length should now be exactly 100mm.
  5. Save it
    1. Enable cold extrusion prevention using M302 P0
    1. Use M500 to save your settings to the eeprom
    2. Use M501 to load the printer to use eeprom settings, and confirm you see the new value in the returned report