Click to email me

X, Y & Z Calibration

With a new dual extruder, a new black framed Z motor and a lower Z end stop installed on my M2D it is now just four point bed levelling and Z probing away from being a full M2E.  The printer has M2E firmware installed, all of the printer functions have been tested and the bed has been levelled.  Now I need to develop a procedure for establishing the correct coordinate origin (0, 0, 0) relative to the bench mark established by the axes micro-switches.



Figure 1.  Initial 0,0,0 Position after M2 Modification from M2D to Dual M2E V4
(Extruder too high and not aligned with front left bed corner.)


For the really clever G code guru’s out there this is not a challenge, even without hints like: M501, G28, G1, M206, G90, G1, G91 and M500.  These dudes will have a printer calibrated and probably auto-levelled within five minutes of the Heated Bed Platform (HBP) temperature stabilizing.

I figure that I am mainly dangerous at 3D printing so I like to understand why I am about to do something, and what I need to do, before doing it.

The reason that you need to calibrate your Z axis is to ensure that at zero height the extruder nozzle is just touching the surface of the Heated Bed Platform (HBP) glass or any film that you might be printing on.  If you have modified your printer, moved the Z stop mirco-switch, changed the extruder or HBP then Z calibration will be required.  Calibration of the X and Y axes is somewhat less important except during pre-print operations such as ooze control, extruder purge and wipe.

On M2D machines Z calibration was carried out by adjusting a bolt on the Z stage that activated the micro-switch at the top of Z stage rear guide rail.  This mechanical adjustment was difficult to access and set with precision.  With an M2E the calibration is done using software offsets.

There are two applications (apps) that can apparently be used for calibration.    One is Z-Adjust and the other is Quickstart.  My understanding is that Quickstart requires a point Z probe and must proceed through bed auto levelling so I can’t use this as yet.  I played with Z-Adjust and it kind of worked, but not with a heated bed or extruder and the app did not seem to exit gracefully.

However we don’t need an app.  We can use a 3D printer host driver utility to operate the M2.  I use Pronterface which is freeware, has a reasonable GUI, and a command line for sending control codes directly to the printer.

The Pronterface command prompt is on the bottom right of the application window.  There will always be a set of equivalent G or M code commands for any Pronterface command because this is exactly what Pronterface uses to control a printer.



Figure 2.  Pronterface GUI and Command Line


With the printer on and connected I used the home command from the Pronterface GUI.  This moves each drive motor to the respective micro-switch activation position.  The equivalent G code is G28.  Like many G codes we can specify individual axes, pairs of axes or the default all three, and often other parameters such as extrusion and rate of travel.  For example G28 Y, G28 X Z, and G28.

If you’re not a G code guru then you will need a G code reference.  Note that some commands are not applicable to the M2 (think Marlin).  If you want to look at some examples of G code then you need look no further than your own models.  Open a model.g or .gcode file with a text editor and look through the code comparing the commands to what happens during a typical print initialization sequence.  Any line preceded by “ is a comment and may help you understand what the code is doing.

Before breaking anything, I measured the clearance between the HBP and the Extruder 0 nozzle tip using a ruler.  It was a little over 205 mm.  This measurement is necessary to avoid inadvertently driving the bed into the extruder nozzle.  If the distance is less than 200 mm then you will need to adjust the actuation of the Z micro-switch downward, preferably by lowering its mounting bracket on the rear Z axis guide rail if it is not already bottomed out on the M2 frame, but otherwise by gently bending the micro-switch actuator arm.

I heated the HBP and Extruder 0 to their default temperatures for PLA (70 and 215C respectively) and let them stabilize.  The HBP and extruder expand as they get hot which reduces the distance between them by about 0.13 mm on my printer at an ambient temperature of about 15C.

Some descriptions of manually zeroing the Z axis suggest using a business card or two sheets of 80 g/sq m paper (both typically about 0.20 mm thick) with a cold M2.  While this works it actually provides a Z 0 clearance of about 0.07 mm between the extruder nozzle and the HBP with the printer at operating temperature.  This clearance is not necessary as the slicer software accounts for extruded filament thickness (layer height).  Ideally Z 0 should be exactly that - no clearance between the hot extruder tip and the HBP.

    There is only one absolute bench mark on the M2.  It is the G28 home position which is determined by activation of the three axis micro-switches.  This is the only absolute position that your M2 can find all by itself repeatedly and with precision.  The only way to change the absolute bench mark is to physically move the micro-switches or change the dimensions of the X, Y and Z stages that actuate them.

    The printing co-ordinates (where your printer actually prints) are derived from the absolute bench mark.  Calibration is the process of setting the offsets between the bench mark and co-ordinate 0, 0, 0.

    The co-ordinate origin will not be at the absolute bench mark for an M2E.  The co-ordinate origin is initially defined as 0, 0, 200 in the firmware with 0 offsets.  Note that the Z 200 mm dimension is negative (upward) from the Z bench mark.

    The default coordinate dimensions for the M2E are in millimetres (mm).

Notes:  You can change the coordinate origin in the firmware but this is not necessary and you will need to modify the source code parameters before compiling, uploading and testing.  You can read the coordinate axis offsets from the absolute bench mark with the M501 command or following a printer reset.  Look for the line starting with M206 followed by the coordinate offsets; ie M206 X0 Y0 Z0.

Next I approximately centred Extruder 0 to the centre of the bed X Y axis (but not the Z axis) by eye using the Protoface jog controls because I want to be calibrating Z near the centre of the bed where I do most of my printing.  I can find this  easily on the HBP without measuring stuff – it’s about half way down the the inner right hand down-stroke on the M in the HBP ‘M2’ logo.



Figure 3.  M2 HBP Centre


The equivalent G code move command is G1 which moves to a set of specified co-ordinates.  This move can be absolute (relative to the co-ordinate origin 0, 0, 0 which we have not yet calibrated) or relative to the last actual printing position.  By default it is relative to the co-ordinate origin.  Like G28, it can be used with parameters to specify moves to individual, pairs, or all co-ordinates.  For example:  G1 X5.0, G1 Y10.21 Z10, G1 X10.1, Y100, Z100.

Then I moved the HBP up to Z = 0 using the command G1 Z0  The HBP rose 200 mm from the Z bench mark (with Extruder 0 still located near the centre of the bed).

Now, using the Pronterface jog controls, I raised the HBP until it almost touched the tip of Extruder 0 noting the distance moved (7.4 mm).  The Proterface GUI movement resolution is 0.1 mm.  For finer movements we need to use G code.  Issue a G91 command which makes movement relative to the current position, followed by sufficient  G1 Z-0.01 commands until the HBP and Extruder 0 tip just touch.  Ten were required so the total movement above Z0 was 7.50 mm.

Now we need to change the default Z0 offset to movement value.  Note that positive coordinate offsets for the Z axis are upward.  Issue the command M206 Z7.50 (replacing 7.50 with your measurement).  The M206 command changes the specified coordinate offsets in a software variable.

We can test the new Z offset, but first we need to revert to absolute movement from the home position.  Issue the command G28 Z.  Now issue the command G90 which reverts to absolute measurement from the current coordinates.

Issue the command G1 Z 0.1.  The HBP should move upward to 0.1 mm +/- 0.005 mm below the Extruder 0 tip.  This will need to be measured with feeler gauges.  Note that we could have sent the bed to Z0 with this command but if you have stuffed up then you will drive the bed into the extruder.

Note:  Feeler gauges (also called slip gauges) require you to estimate slippage of a gauge (or bundle of gauges) inserted in the gap to be measured.  Go and no go are easily determined but how much friction is the correct measurement?  While this is material, surface finish, contact area and lubricant dependant you can get an indication of what a good fit feels like using a set of vernier callipers on your feeler gauges.  The slip should be firm with no binding or locking and with practise you should be able to consistently measure within +/-0.005 mm.  In my experience folk tend to under-estimate the feel of a firm fit.  If your feeler gauges are rusted then give them to someone that you don’t like, and treat yourself to a new set reserved for your M2.  Don’t bother trying to use bits of plastic, paper or business cards as feeler gauges except for a ready estimate.  They are too soft and deflect appreciably under load, and their thickness is not well defined and quite variable.



Figure 4.  Getting the Right Feel for Feeler Gauges (0.127 mm Gauge)

If the clearance isn’t 0.1 +/- 0.005 mm then either your initial measurement of the required offset (7.50 mm) wasn’t correct, something is unstable and has moved, or your final measurement is incorrect.  Check out these options, reset the printer and repeat the procedure with a hot extruder and HBP.

Once the G1 Z0.1 command is performing with sufficient accuracy and repeatability we need to save this value to EEPROM using the M500 command.  Pronterface should respond with ‘Settings Stored”.  The Z offset should now be set correctly and will be retained on M2 reset or power down.  The printer power on prompt or the M501 command will show the new value of the offset in the line starting with M206, ie “M206 X0 Y0 Z7.5”.


We are now ready to print (well almost).  The X and Y axes should also be calibrated to their respective edges of the HBP for a single extruder M2.  For a dual extruder system set the X offset to zero.  This will provide the maximum usable bed print width.

While X and Y calibration is not critical for printing well within the confines of the bed it may affect the pre-print operations such as ooze control, purge and wipe (didn’t I say this already).  We don’t need a heated bed or extruder for this and the measurements are not critical (they can be done by eye in good lighting).  The procedure is very similar to Z axis zeroing.

Reset the printer writing down the “M206…” line X and Y parameters.  For a  new firmware install with Z calibrated these should be zero, ie: M206 X0 Y0 Z7.5.

Home the HBP using the Pronterface GUI or the G28 command.  Move the HBP to at least 3 mm below Extruder 0 using the Pronterface jog controls or G1 Z3.  The 3 mm clearance is necessary to avoid hitting the HBP glass plate retaining bull dog clips.

Now use the Pronterface jog controls to align the front left corner of the HBP directly beneath the tip of Extruder 0 noting the required offsets . For my M2 these were +5.2 mm for the X axis and +0.5 mm for the Y axis.

Set the offsets with the M206 command, but note that the sign of the entry is negative to the measured value.  So for my M2 the command was: M206 X-5.2 Y-0.5.

Test the new settings before committing these to EEPROM with G28 followed by G1 Z3.  The tip of Extruder 0 should be 3 mm directly above the front left corner of the HBP glass plate.

Commit the new offsets to EEPROM using M500 looking for the “Settings Stored” response.


We’re done.  Completing this procedure should take far less time that reading it (certainly less than 10 minutes).  Provided that the HBP or extruder are not adjusted (or otherwise disturbed) and you stick with more of less the same HBP and extruder temperature settings then the initial calibration should be stable and recalibration should not be required.

When using unheated masking tape or heated Kapton film on the bed the Z 0 will rise.  The new calibration only needs to be done once.  The new or old M206 values can be changed from the command line or incorporated in the in the model’s G code through your slicer program (eg Simplify 3D) scripting.  Just include M203 Xx.xx Yy.yy and Zz.zz right at the beginning of the printer initialization.

[Turtles are Here] [Site Map] [750Z Housing] [Construction] [A20 Housing] [Drawings] [Galapagos] [Data Logger] [Making PCBs] [PCB Drill] [CD Welder] [Current Monitor] [Proportional Controller] [Lock In Amplifier] [NAD C 520] [Kenwood Tape Deck] [Tape to Computer] [Reflow Oven] [Designed to Fail] [M2 3D Printer] [Assembly] [Prints] [Objects de-Art] [Lab Gear] [Surface Finish] [Blocked Nozzle] [M2 Upgrades] [Flexible Prints] [Print Problems] [Extruder Failure] [X, Y & Z Calibration] [Coil Winders] [Changing a Light Bulb] [Squash Racquet Repair] [Dive Photos] [Sand Casting] [Oxy-MAPP] [Lathe Maintenance] [Thermal Adhesive] [M73 Compass Repair] [Calcium Block for Turtles] [Infinite R Network] [ST7820 LCD] [Links] [Contact Me]