So you’ve had your 3D printer for some time now. You’ve leveled the bed and fiddled with your slicer settings, but now you want to go the extra mile. It’s time to get into the G-code and tweak the very code that tells your motors how to move.

Calibrating your 3D printer ensures that every print will turn out the same, every time. While you may need to invest a little time fine-tuning the first layer, stepper motors, and filament settings, it’s sure to pay off in terms of print quality. With just a few adjustments, you can optimize your printer’s abilities.

In this article, we will dive into the code and calibrate our settings to get ever more perfect prints. Let’s get started!

Back to Contents

1
3D Printer Calibration / How to Calibrate Your 3D Printer

Dialing in the First Layer

A good first layer
A good first layer (Source: sjack1209 via Reddit)

As the foundation, a good first layer is crucial to achieving a beautiful print. If your nozzle is too close to the bed, your first layer will be squished and possibly destroyed, meaning you’ll have to scrap it. On the other hand, if your nozzle is too far away from the bed, your print will lack adhesion and likely fail.

You can improve your first layer by tuning the Z offset. This is a value that essentially tells your printer how far to move the Z-axis from the Z endstops – in other words, from the bed.

The goal, in a nutshell, is for your first layer to stick perfectly to the bed. If you see that your first layer is squished or the nozzle is digging into it, you should increase the Z offset. On the other hand, if your first layer is peeling up from the bed, you’ll want to lower the Z offset.

Back to Contents

Advertisement
Advertisement
Advertisement
2
3D Printer Calibration / How to Calibrate Your 3D Printer

Calibrating the Stepper Motors

A calibration cube
A calibration cube (Source: Noah Halford via All3DP)

3D printers use stepper motors, which rotate in small steps in order to move axes or the extruder a certain distance. For example, if one rotation is 100 steps, then the motor must rotate 50 steps to turn half of a rotation. This allows for precise rotation control.

For a 3D printer, calibrating your stepper motors involves determining the relationships between steps and distance. To calibrate the extruder, you’ll need to make sure that your 3D printer is extruding the right amount. To do this, you’ll have to send a few G-code commands to your printer.

Step 1: Prepare Your Values

In this step, we’ll compare your printer’s settings with how it actually prints. If there’s a discrepancy, we’ll do a few calculations to correct it.

  1. First, retrieve your printer’s settings by sending the command M503. Part of the output should look like the following: Steps per unit: M92 X100.00 Y100.00 Z400.00 E140.00
  2. Take note of these values. The first three correspond to the number of steps that the stepper motors take to move one millimeter in the X, Y, and Z directions, respectively. We aren’t concerned with those at the moment, but we’ll need them later.  Right now, we care about the last value, which is the number of steps that the extruder motor takes per millimeter of extruded filament. We’ll call this number A.
  3. Next, insert some filament and make a mark about 50 mm above the top of the extruder. Measure the exact value with calipers and write it down. Let’s call this number B.
  4. Next, extrude 10 mm of filament and again measure the distance from the top of the extruder to the marked point. If we call this value C, then B – C is the amount of filament that was extruded.
Break out those calipers!
Break out those calipers! (Source: shguevara via Reddit)

Number Crunching

If B – C = 10 mm, then the extruder is already calibrated correctly! If not, we need to update the extruder’s steps per millimeter.

Compute the value D = 10*A / (B – C). This is the new number of steps per millimeter for the extruder. For best results, it may help to repeat the process for measuring D multiple times, and then take the average. This will also help to offset small measurement errors.

Step 2: Calibrate Your 3D Printer Extruder

To carry out the calibration, you need to tell the printer the new value:

  1. Send the command M92 E[D] to the printer. While this command tells the printer the new value, it does not actually save it.
  2. Send the command M500 to save the new value.

Now, the extruder should be calibrated correctly.

Example

Let’s suppose that before our test extrusion, we measured the distance between the marked point and the top of the extrusion to be 53.10 mm, and after the test extrusion, we measured the distance to be 42.80 mm. Then B-C = 10.30 mm.

If the original number of steps per millimeter for the extruder was 140, then we would calculate 10*140/10.30 = 135.92, and send the command M92 E135.92.

Tips

In this case (and later, when you calibrate the axes), do not expect your results to be perfect. There’s bound to be variation after you confirm that your calibration is correct, but as long as you are pretty close (within a few percent) to the desired value, your printer should be well-calibrated.

Step 3: Calibrate Your 3D Printer Axes

Image of:
A calibration cube is the obvious choice for a test print (Source: dtackgrounded via Reddit)

After calibrating the extruder, it’s also important to calibrate the axes of the printer. Calibrating the axes is similar to calibrating the extruder, but requires that you actually print something.

Please keep in mind that calibrating the extruder should always be done before the axes because the former can affect the size of printed objects. As the axes calibration involves measuring prints, you want to make sure the extruder is adjusted beforehand.

For the axes calibration, you can print a small cube, for example. Either design one yourself in the CAD software of your choice, such as OpenSCAD, or check out the models in The Best 3D Printer Calibration Cubes in 2024.

How to Do It

After the cube has finished printing, measure each dimension. For each axis, repeat the computation you did for the extruder, D = 10*A / (B – C), but replace the variables as follows:

  • (B – C) with your measurement
  • The number 10 with the target value of that measurement
  • A with the M92 value for that axis (i.e. the values you noted in Step 1 after sending the command M503)

Then, send the appropriate M92 commands to the printer, again replacing E with the letter corresponding to the axis you need to set.

Example

Suppose our cube is supposed to be 20 mm on each side, but we measure 20.30 mm in the X-direction. If our M92 value for X was set to 100.00, then we would update this value by sending our printer the command M92 X98.52 because 20*100 / 20.30 = 98.52.

Tips

As with the extruder, it helps to make multiple measurements and take their average. In this case, however, you don’t need to print multiple objects. You can simply measure the cube at different positions (along the same axis).

Back to Contents

Advertisement
Advertisement
Advertisement
3
3D Printer Calibration / How to Calibrate Your 3D Printer

Fine-Tuning Filament Settings

Image of: 3. Fine-Tuning Filament Settings
Measuring the filament diameter (Source: Noah Halford via All3DP)

Every roll of filament is different. Plastics from different manufacturers, and even different colors of the same material, have different properties.

In order to get the best prints possible, you’ll need to fine-tune your filament settings. Usually, you can get good prints just by using the settings recommended by the manufacturer.

For best results, however, you should follow these steps every time you open a new roll of filament.

Step 1: Measure Your Filament

The diameter of a roll of filament often differs from the diameter reported by the manufacturer by up to a few percent. The tolerance in diameter is usually printed on the spool. So, it’s important to use calipers to measure the true diameter of the filament:

  1. Measure your filament at a few (at least three) places along the spool.
  2. Take the average of your measurements.
  3. Enter this result as the filament diameter in your slicer.

Getting this number right is important because it helps to ensure that your printer will extrude the right amount of filament.

Step 2: Find the Right Print Temperature

This temperature tower is printed in bright orange PLA
Get the temperature right! (Source: SouthwesternAppliedPhysics via Thingiverse)

You can find the right temperature to print by printing a “temperature tower”. There are many different options available online, but the basic idea is the same for all of them. They are separated into blocks at different heights, and each block should be printed at a different temperature. By analyzing the blocks after printing, you can determine the best temperature to print your material.

However, printing a temperature tower can require a little bit of work. If your slicer does not allow you to print with different temperatures at different heights, you’ll have to manually edit your G-code before printing. This requires inserting G-code commands to set the extruder temperature. Such commands begin with M104.

How to Do It

  1. First, determine the height of each block. Call this number H, so that the different blocks start at height 0, H, 2H, 3H, and so on.
  2. Then, open your G-code file in the editor of your choice. You want to look for commands that tell your printer how to move, which begin with G1. Your G-code file will contain an enormous number of these.
  3. Find the first G-code command of the form G1 Z[H]. (It may also contain X and Y movements.)
  4. Before this line, insert the line M104 S[T] where T is the temperature of the block that begins at height H.
  5. Repeat this for each block, with the appropriate temperature.
  6. Once you’re done, print the updated G-code file.

Example

If the blocks have heights of 1 cm (10 mm), and the temperatures go from 185 °C to 220 °C in increments of 5 °C, then you should find the first command containing G1 Z10 (the first command that brings the hot end to a height of 10 mm). Immediately before this line, you should set the hot end to 190 °C by inserting the line M104 S190.

Final Steps

Once you have printed a temperature tower, examining the different blocks will allow you to determine the best temperature for printing your material. Simply pick the temperature that looks the best. Set this as the printing temperature in your slicer, and you’re ready to go!

Back to Contents

Advertisement
Advertisement
Advertisement
3D Printer Calibration / How to Calibrate Your 3D Printer

A Little More Torture

A good, though imperfect, Benchy
A good, though imperfect, Benchy (Source: Noah Halford via All3DP)

We’ve described the top ways to calibrate your printer’s settings and some slicer settings for your filament. However, there are also plenty of other settings you can change to improve your prints. In order to get an overview of what a printer is good and not so good at doing, people often use “torture tests”. Printing and perfecting such prints can help with problematic areas, such as bridges and overhangs. They’re also helpful for diagnosing a variety of problems.

While the most popular torture test is the 3DBenchy (usually just called a “Benchy”), you can find plenty of others by searching for tests on your favorite STL site. We won’t go into detail here because every torture test is a little different, but most come with instructions on how to diagnose problems and points of failure.

Back to Contents

Advertisement
Advertisement

License: The text of "How to Calibrate Your 3D Printer: A Step-By-Step Guide" by All3DP is licensed under a Creative Commons Attribution 4.0 International License.

Stay informed with notifications from All3DP.

You get a notification when a new article is published.

You can’t subscribe to updates from All3DP. Learn more… Subscribe to updates

You can’t subscribe to updates from All3DP. Learn more…

Topics
Advertisement