Upgrading an Anycubic Kossel to Marlin 1.6.6, Auto Calibrate, and Universal Bed Leveling

The October 10, V1.1.6, release of Marlin contains significant changes to bed leveling. In particular, the new “Universal Bed Leveling” is FANTASTIC for any Kossel/Delta printers that do not already have it.

I recently converted (upgraded?) an Anycubic Kossel Linear (not Plus) to Marlin 1.6.6 and Auto Calibrate (G33) + UBL (G29)

I believe they may be shipping with leveling now; I bought in Aug 2017 and my printer came from the factory with manual bed leveling.  And manual calibration (rod length), which was a real pain.

Three basic steps:

1) Print a leveling probe. I used www.thingiverse.com/thing:1976680, which fits the Anycubic pretty well, plus a microswitch I already had.


On almost every Ramps board, plug this into Z-Min.

Note: Most endstops are wired “normally closed” and most firmware expects them to be this way.  Broken wires will “open” that, and be a more obvious problem.

However, you probably want your probe to be plugged in when in use and unplugged when not.  I used Radio-Control servo extensions, because I had them already.  Whatever you use, consider wiring the Z-Probe micro switch to be “normally open” so nothing will freak out when it is removed.  This also means you must invert Z-Min in the firmware (the files I attached below already have this).

Your choice, it can work either way.  I prefer unplugging and therefore went the “normally open” route.

2) Upgrade your firmware. This is too variable per printer to describe here. Just be sure you get on the Oct 10, V1.1.6, or later release of Marlin.


For Anycubic specifically, the firmware I received with the printer had mods to more than just configuration.h and configuration_adv.h… however, I was able to use the new release and remove all of those mods, through a careful combination of things in the two config files.

Therefore, you can use all the Marlin files directly from github, and use my configuration.h and configuration_adv.h.

These will work perfectly for the Linear, non-plus. They may need slight adjustment for other flavors.

3) After the upgrade, use these commands to calibrate and level your printer:

After you’ve upgraded, anytime you want to level, do the following, via Pronterface, or the Terminal in Octoprint, or whatever.

These commands should work on almost any Delta/Kossel printer running Marlin 1.1.6.

M502        ;Loads all settings from configuration.h (not EEPROM) into memory.
M851 Z-18.8 ;Distance from your nozzle to your microswitch on the probe.
              ;Above number is for MY printer... you will have to figure this out for yours.
              ;Go ahead and use an estimate, we'll correct it after the first round of probing.
M500        ;Write everything that we reset and set above, to EEPROM
M501        ;Load from EEPROM (just to be sure)
G28         ;Home the machine.
G29 D       ;Disable bed leveling (so next command will be 'clean')
  ------ Physically Attach Your Probe ------
G33 P3      ;Auto Calibrate. This probes a bunch of places on the bed. Takes two to four minutes.
M500        ;Write probe results to EEPROM.

At this point, the printer has figured out how “Tall” it is (max_z), figured out a few things about the bed, and figured out how to correct for the towers being slightly out of alignment (they ALWAYS are)… but we are not done.

Next step is to use “Universal Bed Leveling”. The new, cool, stuff.

AFTER you do the G33 stuff, everything in the code block  above,  do this:

 ------ Physically Attach Your Probe ------ 
G28        ; Home the machine. 
G29 P1     ; Universal Bed Level. This will probe a bunch of places on the bed. Takes two to four minutes. 
G29 P3     ; Calculate the remaining grid/matrix. Just do it. 
G29 S1     ; Saves the resulting grid to EEPROM, in slot 1
G29 F 10.0 ; This "Fades out" the effects of Universal Bed Leveling, all gone at 10mm
G29 A      ; Activate Universal Bed Leveling. 
M500       ; Write everything we did above to EEPROM.

Now we are done! Remove the probe and print.

By the way, a G26 prints a “Test Pattern” that is built into the firmware.  That pattern is intentionally very sensitive to Layer Zero thickness.

My printer produces the best Layer Zero prints it has EVER produced, after using the above. My printer holds calibration for several days; if I suspect it is off, I can rerun the above in about four to seven minutes total. And its ready to go. And I did NOT touch those dang screws. (Anycubic owners will get this.)

Can you tell I am really, truly, loving this?

Oh, and here is how to figure out the M851 Z-18.8 number:

1) Run everything, both parts, above. Use a bigger number than is the actual distance between your probe microswitch and your nozzle. For my probe, I started with 23.

DO NOT PRINT after this, until we get the real number.

2) Gradually work the head down to the build plate by issuing G1 commands, like this:

G1 Z10
G1 Z5
G1 Z3
G1 Z2.9

Keep reducing the number while looking at the nozzle. Once it touches down (you can use the “paper drag test” if you wish”) note the number. You may want to raise it, like G1 Z10, and lower it to your final nubmer a couple of times. Just to be sure.

Once you have that final number, subtract it from whatever “estimated, and too big” number you put in M851.

Example: If your M851 Z-20, and your final command to touch down was G1 Z2.2, then in the future you would use M851 Z-17.8.

Note that changing this (via LCD menu or M851 and M500) does notchange anything until you re-run a G33 and G29. Fortunately, these are fast, about 8 minutes on my printer.

5 Replies to “Upgrading an Anycubic Kossel to Marlin 1.6.6, Auto Calibrate, and Universal Bed Leveling”

  1. So I have Marlin 1.1.6, i’m running your config files, but for some reason when I get to running G29 D the printer kind of starts freaking out. When I do G33 P3 it just shakes at the very top of the rails for a few seconds, and then stops. I don’t know enough about 3d printers, especially delta printers, to figure out how to troubleshoot this myself.

    1. This normally means the controller thinks the “probe” microswitch is triggered. You can change the hardware (kinda tricky, it is a small printed circuit inside the Anycubic supplied probe), or reverse JUST the Z-Probe in the Marlin config, and re-upload. See if this helps.

    1. Yes, they MAY need slight tweaks, I haven’t tried them yet with 1.1.7.

      I would do the following: Get 1.1.7, copy the configuration.h and configuration_adv.h from the “examples delta” directory, then match-merge them with the examples given here.

      If and when I do that, I will post on this blog.

      1. They did some changes in recent Marlin release so the configuration files cannot be directly replaced. You have to find and change the parameters in the config manually, as I did (Macro #error will tell you this)

        However I am still struggling to find all the parameters to set. I was printing for a few months but then I realized the print scale was slightly off (Diameter rods problem). I figured out the correct value but now I have the usual convex/concave problem so I have to fiddle with Delta Radius.

        What’s strange is that it seems to be off (concave or convex) only in the X axis. UBL does not help with this. I checked the mechanical properties (dimension of the linear guide to the top) and it’s fine

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.