3D printing guides: Setting up auto bed tramming leveling tilt compensation!

Learn how to set up automatic bed tramming on your 3D printer, as seen on the new Printrbots!

Setting up auto bed tramming leveling tilt compensation!

I’m Tom and today i’m going to show you how to set up automatic bed leveling or automatic bed tramming on your printer. Now, people are still figuring out how to exactly call this procedure since neither leveling nor tramming are technically 100% correct, but because tramming is a bit closer to what we’re doing here, that’s what i’m going to call it for the rest of this video. And what exactly are we trying to do here, you might ask? Easy. We are going to replace the z-endstop with a sensor that detects # if and how much the printbed is tilted in any direction, so if one of the adjustment screws is off by a tiny or a larger bit, the printer’s firmware can then automatically tilt the printed model accordingly to compensate for that. Which gives you a perfect first layer and good adhesion without ever having to manually adjust and tram the printbed ever again. / After the initial setup, that is. In fact, Printbot trusts this process so much that they don’t even provide a way to adjust the printbed at all on their newer printers.

So let’s get started! You will need the following things: One, a 3D printer, obviously. Two, an inductive sensor. There are other ways for probing the surface of the printbed, but these sensors are really the most reliable and most straightforward way to do it. The sensor i’ll be using is the exact same model that Printrbot uses as far as i know, and in fact, you can even order one from # them. Or from the links in this video’s description. Three, a way to mount said sensor to your printhead, as close as possible to the hotend, but not touching it of course. You can use anything that you can screw the sensor onto, i used a 3D printed part as the easy way out, but as always, don’t use PLA to print parts that will be sitting close to a heated bed or close to the hotend. That stuff will melt. Four, an aluminum printbed. Now, this is the one big catch when using these inductive sensors, because they simply can’t sense glass, acrylic glass, Tufnol or heater PCBs. These sensors are rated for a 4mm sensing distance onto a thick slab of iron, but since aluminum is less inductive, you need to bring it closer to the sensor to trigger it. And no, putting a thin aluminum sheet under a glass bed does not work. I tried. If you have a heated bed, aluminum is superior to glass anyways, as it makes for a more evenly heated surface and has no risk of shattering.

You will also need two resistors, with the larger one having roughly 1.5 times the resistance of the smaller one. So for example 10kOhm and 15kOhm. Or 22kOhm and 15kOhm, you know, just somewhere in that ballpark. You will also need a readily configured version of your printer’s firmware, i will be showing you how to set up Marlin for this task.

So, first of all, we will be preparing the sensor for use with your electronics. The two resistors are there to reduce the output voltage from 12V to 5V, since the sensor will need to run off of 12V, but your electronics / need 5V signals. If you look onto the side of your sensor, you’ll usually see a short wiring info, in this case brown for the input voltage, black for the output and blue for ground. Yours might differ. So to reduce the output voltage, we are going to create a simple voltage divider. [draw voltage divider] So here’s your printer’s 12V supply, the z endstop signal input and the 0V or ground plane. Connect 12V from your printer to the # input voltage … input of your sensor, connect ground to ground, then connect the larger resistor from the sensor’s output to the endstop input and the smaller resistor from the endstop input to ground. That’s it! If you want to, can check if the output voltage is really 5V with a multimeter, but if you used the right resistors, you should be golden here. In my case, it read 3.3V, but anything above 3V is ok. Now, i soldered the resistors directly to the wires and sealed everything up in shrinkwrap, but you can also make a little circuit board and do it that way. You will also need to wire a connector to just the signal line. Or you can also use the the ground connection from there, and use a two-pin connector.

Next up, you can remove your current z-endstop and unplug it from your electronics. Then mount the sensor to your carriage, connect the 12V and 0V lines and plug in the endstop connector to your z minus endstop input. Yes, i am showing this glorified version on a bare RAMBo, as this is what the electronics compartment of my printer looks like. Not much to see there, right?

Up next, firmware. As previously stated, you need to have your firmware all set up for regular use already, so let’s open up your config file and get hacking. In the configuratihun you will need to double-check the following sett#ings: You will need to disable the endstop pullup for the Z-sensor, so depending on whether or not your current endstops are using the pullup resistors, you should make sure that endstop pullup z min is commented out here or here, but you can simply just comment out both spots. By the way, you turn a line into a comment and hence / disable that line by adding a double forward slash in front of # that line. Next, you will need to set the z min endstop inverting setting to true, since the output of the sensor we’re using here is high when it#s not triggered and low when it # is. Then, you will need to make sure that you are homing to minimum on your z axis, this is the default setting on most printers, but for example my Mendel90 homes to the top of the axis to keep the hotend and printbed from doing the touchy-touchy thing when things should go wrong. Also, check that your z min pos is set to zero.

Next up, we will start messing with the actual auto leveling or auto tramming or auto bed tilt correction setting. Right up top, enable bed tramming altogether by uncommenting this line, and then choose which type of tramming your printer should do. The text accompanying this part explains pretty nicely what the grid and 3 point modes do. I will be using the grid, but for example Printrbot uses the three point method, so that choice is up to you. So for setting up the grid, all you need to do is tell it which area of the printbed it can probe. Just keep in mind that you are telling it the spots that the sensor will lower onto, and the firmware will try to reach those spots / while ignoring the physical dimensions of the printer. So if i tried to probe the very rear of my bed, the carriage would slam all the way to the front while trying to reach that spot with the sensor. So limit that area to regions that your sensor can actually reach. Also make sure that you’re not jamming into any screws or binder clips and keep a bit of a distance to them since that would influence the sensor’s reading.


Next important setting: Offset from extruder. This tells the firmware at what spot relative to the nozzle / your sensor is sitting. Since mine is sitting 75mms in front of the hotend, i’ll enter 0, -75, 0 here. These values don’t need to be super accurate, but should be somewhere in the right ballpark. We’ll calibrate the Z offset later, so we’re going to set that to 0 for now. For the other settings, negative values mean that your sensor is sitting closer to the minimum position of each axis, so the front and left sides of your bed, while positive values mean that the sensor is further # away from the minimums.

I also changed all these # raise values down here to 1mm, but the defaults work just as well, they’re just a little slower.

There is one more setting you’ll need to adjust, and that is found over on in the configuration adv file, particularly, you need to enable endstops only for homing, otherwise you won’t be able to adjust the offset of the sensor properly.

And that is it! You can hit upload and enjoy all that autoleveling goodness being pumped onto your Arduino / or whatever motherboard you are using.

So, let’s jump over to our printer host and try things out! But wait, before that, you should of course have installed that alumium print bed top if you have been using glass or any other non-inductive surface before. I already # smeared a thin coat of glue stick onto my aluminum plate, but again, you can use any topping you want as long as it isn’t too thick. So Kapton or painter’s tape work, but not a thick sheet of tufnol. I personally just stick to glue stick (haha), since i find that just works really well for almost anything that i’m printing.

So in the host, first of all, you’ll want to check that the firmware is reading the endstop correctly, you can do that by sending M119 and checking if the z min endstop shows up untriggered correctly. Then hold a metal object to it while sending another M119 and make sure that it now says # triggered. Next, check that the sensor is actually at about the right height relative to the hotend, which is about a millimeter above the bed when the nozzle is just touching the bed’s surface. The sensor should trigger and light up in that position. If it does not, adjust its height until it does.

Now, for the fine-tuning there are three ways to do it. One is by using a G92 command, which lets you temporarily set a position offset independently of the probe, so you’d have to add that right after the G28Z, so the # home command # in your start gcode. The other option is going back into your firmware config and adjusting the probe offset that we simply set to 0 before. And lastly, you can also adjust the height of your bed probe, but that will tap the hotend onto the bed each time the bed is probed.

In my case, i’ll show you how to do it # properly through the firmware’s offset settings. So to figure out the right offset value, you’ll want to home Z, which now moves to the center of the bed, then send a G29 to run through the autotramming procedure. Then grab a piece of copy paper and slide that under the preheated hotend and send a G92 Z10, which tells the printer / to assume that the printhead is now actually 10mm above the bed’s surface. Then move the Z axis down in increments of 0.1mm until the tip of the hotend just touches the surface of the paper. If you kept track of how often you clicked the move button, you now know your offset, but you can also send M114 to see how much length of the 10mm on Z you have used up to # get down this far. The offset you’ll get should be around or less than one millimeter. Enter that into the z probe offset from extruder as a negative value since the trigger point of the probe is actually # closer to the bed’s surface than the tip of your hotend. Then reupload the firmware and you’ll be able to move the hotend down all the way after running the autoleveling procedure.

Now there’s only one more thing left to do, and that is to add the autotramming procedure to the start gcode of your slicer. And for that, all you will need to do is / open up your slicer, look for the G28 aka # home command and add a G29 right after that line. And you’re done!

You should have now successfully set up automatic bed tramming surface tilt compensation leveling on your printer! Of course, you’ll still need to fine-tune the height offset depending on how the first layers of your prints turn out, for which you can use the z offset setting in your slicer.

And that’s it! No more manually fiddling around with the adjustment screws of your printbed. Let me know in the comments below how this worked out / for you, and please leave a like on this video and share it with your 3D printing buddys if you # did actually like it. But wait, there’s one more thing that i would like to point out to you -again- and that’s Taulman’s Toolbox kickstarter for six new and awesome types of filament that each have unique and spectacular new properties. So go check that out and support them, i put a link to that in the description.

So, that’s it for today, as always, thanks for sticking around this long and watching this video all the way to the end. Appreciate it.


These inductive sensors are supposed to have transistor outputs, and therefore should traditionally be hooked up in a different way than i’m showing in the video. However, the internal circuitry of these sensors is set up in a way that would damage our electronics if connected like that, so using the voltage divider is the better choice in the end.

So for 12V, using a pair of identical 10k (or 15k) resistors instead of one 10k and one 15k should give voltages closer to 5V (check with a multimeter), but the mentioned 10k and 15k combo works well, too.
8.1k and 22k for 24V.

Inductive sensor from ebay

Inductive sensor from Printrbot

Taulman Toolbox Kickstarter

As seen in the video: These folks will make rubber heated bed to your specs (“Contact Now”)


You can support me without spending a single penny!