Upgrading the Mini Kossel to Duet Electronics Part 4: the Z probe

In earlier posts in this series, I described how to install and connect Duet electronics on a Mini Kossel, how to install and configure the firmware, and how to calibrate the printer. In this post I cover using a Z probe.

Z probe types

My fork of RepRapFirmware currently supports the following types of Z probe:

  • Type 1: Any probe that produces an analog signal that increases as the head nears the bed. This includes an unmodulated IR sensor – although don’t recommend these, because of their sensitivity to ambient infrared light. Better is my own infrared sensor, which not only modulates the IR but uses dual infrared beams so as to be mostly insensitive to the reflectivity of the bed. It could also be used with FSRs in the bed supports, wired in a potential divider configuration so as to provide a voltage that increases as the load on the bed increases.
  • Type 2: a simple modulated infrared sensor. The Duet will output a modulation signal to turn the IR emitter on and off.
  • Type 3: as type 1 but the control signal is driven low instead of high. This allows you to have two different Z probes and to switch between them.
  • Type 4: a microswitch wired to the E0 endstop pins of the Duet. The switch should be closed when the Z probe is deployed but not touching he bed, and open when the probe is deployed and pressed against the bed. For safety, when the probe is not deployed, it should be open.

The type of Z probe is defined by the P parameter in the M558 command in config.g. The config.g file in my repository uses P4, which is suitable for the original microswitch Z probe on the Mini Kossel. If you are using a different type of Z probe instead, replace P4 by P1 or whatever is appropriate, and connect it according to the installation instructions.

You should set the Z probe X and Y offsets to zero in the G31 command in config.g. This is because when using the Z probe for delta calibration, the position of the head matters more than the position of the probe. The P parameter in the G31 command is the trigger threshold, and should be set to 500, for both my IR probe and a switch. If you are using a different sort of IR probe, you may need to use a different threshold.

Before using the Z probe, you must set the homed height parameter in the M665 command in config.h to be within a few mm of the correct value. To do this, home the printer, then command it to a suitable height, for example send G1 X0 Y0 Z20. Measure the height of the nozzle above the bed. If it is not close to the height you chose (20mm in this example), adjust the H parameter in the M665 command accordingly.

Calibrating the Z probe

You can view the output of the probe in the web interface, or by sending G31 without any parameters via the USB port. The Z probe reading is a value between 0 and 1023. If it is a switch, the reading should be 0 when the probe is deployed but not touching the bed, and 1000 when it is either not deployed, or deployed and touching the bed sufficiently to activate the switch.

To test the Z probe, home the printer, lower the nozzle until it just grips a sheet of paper between it and the bed, then send G92 Z0 to define that point as Z=0. Raise the head a few mm and deploy the probe manually if necessary. Check that the Z probe reading is lower than the threshold you configured in your G31 command. Then lower the head further in small increments. Before the nozzle touches the bed (or just after if you are using FSRs in the bed supports), the reading should increase to above the threshold. Make a note of the Z height at which this happened. Then put this figure in the Z parameter of the G31 command in config.g.

Tuning the Z probe deployment and retraction routines

If you have the standard Mini Kossel mechanical Z probe, then you may need to adjust the locations used for probe deployment and retraction. These are contained in files sys/deployprobe.g and sys/retractprobe.g on the SD card. If you do not already have these on the SD card, you can upload them using the “Upload config file” button in the Settings tab of the web interface.

2015-02-05 16.57.06To test probe deployment, home the printer and then run this command:

M98 Pdeployprobe.g

The head will move close to the Z tower and then past the Z tower belt to deploy the probe. If necessary, edit the contents of deployprobe.g to adjust the starting location and the amount of movement.

With the probe deployed, run command:

M98 Pretractprobe.g

This should move the probe over the post and push it down to retract it. Depending on the position of the post in your build, you may need to adjust the position and/or the height that the head moves down to.

Auto calibration

4-factor fast auto calibration (endstops + delta radius) is supported starting at version 1.00f of my RepRapFirmware fork. 7-factor auto calibration (endstops, tower positions and diagonal rod length) is supported from version 1.04c onwards. To run it, simply heat the bed and hot end to operating temperature, and ‘print’ the appropriate auto-calibration gcode file. I provide a selection in my repository. I suggest you use either bed10-6.g (10-point probing for 6-factor calibration), or bed10-7.g (10-point probing for 7-factor calibration).

If your printer is not a Mini Kossel, you will need to edit your chosen auto calibration file, to change the probe coordinates to appropriate values for the size of the bed on your machine.

When you run the auto calibration file, it first clears any bed compensation and homes the printer. Then it deploys the probe. It does a dummy probe at the centre first, because I have found that the mechanical probe gives a less accurate reading on the first probe after deployment (you may wish to remove this if you are using a different type of probe). It probes a number of points, depending on which file you selected. It then does two Newton-Raphson iterations of a least-squares minimization process, prints the parameters it found (look in the Message tab if you are using the web interface), and retracts the probe.

You can read more about how the auto calibration works and how to tune it for your printer here.

Tidying up

Having chosen the auto calibration file you want to use and edited the coordinates to suit your printer, copy it to /sys/bed.g on the SD card. It will then be run in response to a G32 command.

2015-01-30 16.01.21Setting the height at the start of a print

I also provide a file called setheight.gcode in the /gcodes folder. This deploys the probe, does a single probe to determine an accurate height, then retracts the probe. For accurate results, heat the bed and hot end to operating temperature first.

You may wish to incorporate the contents of setheight.gcode in the start gcode of your slicing program. Or you can run G32 auto calibration whenever you use your printer, as I do.

A note on extruder mot0r current

I had a recurring problem on my Mini Kossel, where the extruder drive would sometimes stop feeding filament. On inspection, I found that it had chewed through the filament. I tried various settings of the clamping screws on the extruder drive, to no avail. I never had this problem on my Ormerod, so I was starting to wonder whether it was a feature of the extruder design on the Mini Kossel.

Then it occurred to me that on the Ormerod, I hear the extruder motor skipping steps when it can’t push the filament hard enough; but I never heard this on the Mini Kossel. It dawned on me that the Mini Kossel has a longer and more powerful extruder drive motor than the Ormerod, and the key is to reduce the stepper motor current, so that the motor skips steps before the extruder chews through the filament. I have turned the extruder stepper motor current down to 500mA, and all is now well.

This entry was posted in 3D printing and tagged , , . Bookmark the permalink.

15 Responses to Upgrading the Mini Kossel to Duet Electronics Part 4: the Z probe

  1. Bill Hall says:

    David, I cant thank you enough for the help you have provided here and on Github in your repository. I have spent quite some time calibrating my mini kossel and it would have been impossible without your assistance. I have learned a lot about the workings of my machine doing this, if I can assist you with any testing or contribute in any way then do drop me a line and I’ll do my best to help….

  2. Nigel says:

    I get a reading of 1 instead of zero 0 from your DC42 IR sensor board added to my release 1 Kossel Mini upgraded to Duet 0.8.5 electronics from the home position. Near the bed I get 540.

  3. pilotgary says:

    Hi David,
    I am replacing the RAMPs 1.4 on my CherryPi IIIs with a DUET v0.85. Currently I’m using an inductive probe for autocalibration. Are there any special steps I need to consider to use the inductive probe with the DUET?

  4. Maurice Glynne says:

    “Imitation is the greatest form of flattery”.
    I am going to follow your lead and go from an Ormerod 2 to your large Delta design.
    Can i use the IR sensor from the Ormerod 2 as per the above, as I have 2 of them lying around and they were quite expensive?

    • davidcrocker says:

      The problem with using the Ormerod sensor is that it is too large to fit close to the nozzle, and fitting it close to the nozzle is very important on a delta. Have you tried selling your spare Ormerod sensors on the Ormerod forum? I am about to make some more because I have a waiting list for them.


    Taken the sensible tablets and ordered your IR sensor. (Will try to sell my Ormerod one)
    BTW the stepper motor you recommend for the ‘big Delta’ extruder (JK42HS34-1334) is now out of stock at Etang. BUT it is 12V ? Can a 12V stepper motor be run off the Duet once the PSU is 24V?
    Please can you recommend an alternative,assuming my Ormerod Nema 17 would be no use.

    • davidcrocker says:

      You can use the Nema 17 stepper from the Ormerod for the extruder. When using constant current drivers (as all 3D printer electronics do), the voltage rating of the stepper is largely irrelevant, because the driver adjusts the average voltage to achieve the required current. The voltage required to drive the stepper motor increases with speed, which is why I needed to go to 24V power after installing the 0.9deg motors.


    In your upgrade notes you mention a ‘stack of washers to stand the carriage wheels off from the carriage trucks’ but I cannot find a mention of this in the original ‘build a big delta’ blog. Does this advise still stand if I am using the Robotdigg metal carriages and what is the idea behind this ‘spacer’?


    Looks like the printed carriage mounts that the Delrin V-rollers attach to has been modified in Release 3 of the Mini Kossel by Think3dPrint3d so in IMHO and in my build the ‘spacer’ is no longer needed. i will send DC a picture which perhaps he can post to illustrate this.

    • davidcrocker says:

      T3P3 changed to 2020 extrusion in their R3 Mini Kossel, and their carruage truck has a cutout on the back to leave room for the extrusion. This means that you should be able to use their carriage truck design instead of mine, and no spacers.

  8. David Parry says:

    I have one of your ir sensors which I have had fitted but not used for a while on a mini Kossel.
    I have PEI on the glass with the back of the PEI painted black as per your instructions.
    I have had to re install the software and thought I would start to use the sensor but it will not trigger with black objects but does with white (say paper or print object if white). Is it something I’m doing or is is it faulty.

  9. David Parry says:

    Hi David,
    Its V1.1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s