Upgrading the Mini Kossel to Duet Electronics Part 3: Calibration

In the third part of this mini-series, I will cover final commissioning of the Mini Kossel with Duet electronics. If you followed the instructions in Part 2 then you will know that all the motors, endstop switches, heaters and thermistors are working. But you will only have tested direct motor moves. Now it is time to do delta moves. Before proceeding, make sure you have loaded a version of the Duet firmware no earlier than 0.80k-delta-dc42. This is the first version that includes working code for continuous delta moves. Other delta printer firmwares such as Marlin and Smoothieware break each linear move up into a sequence of short moves, and then assume that a short linear move in XYZ space can be approximated by moving each of the tower carriages linearly between the start and end positions. In contrast, my fork of RepRapFirmware leaves long linear moves intact, and calculates the timing of every step individually using the equations of motion for a delta printer. Make sure that the versions of config.g and homedelta.g in the /sys folder of the SD card are up to date.

Adjusting the delta parameters

If you are using the Duet with a Mini Kossel kit supplied by Think3DPrint3D and complete with a heated bed, then you can use the sample config.g file for the Mini Kossel in my repository mostly as-is. I already described in Part 2 how to adjust the M305 commands to get the correct temperatures for your thermistors. If you are using a different delta printer design, you need to adjust the delta parameters. Open config.g in a text editor and look for this line:

M665 R105.6 L215.0 B85 H240

This command defines the basic parameters of your printer and switches the firmware from Cartesian to Delta mode. The R value is the delta radius, the L value is the diagonal rod length, and the B value is the printable radius of the bed. The H value is the height of the nozzle above the bed when homed. In fact, it is helpful to set H to a few mm more than the nozzle height when homed, and to take up the excess in the software endstop adjustments, as will be described below. If you are using a Mini Kossel without the heated bed, change the H parameter in the M665 command to 255. If your printer has a larger Z range than the ~250mm of the Mini Kossel then you should also edit the homedelta.g file. It includes this line:

 G1 S1 X320 Y320 Z320 F500 ; move all carriages up 320mm, stopping at the endstops

You may already have increased the 500 figure to 5000 as described in Part 2 of this series. You should increase all the occurrences of 320 to a value suitable for your printer, so that all carriages move right up to the endstops no matter what the initial position of the effector.

Checking delta moves

Home the printer. Send command G90 to ensure that you are using absolute move coordinates. Then send command G1 Z100 F1000 to move the print head to Z=100. From there, use the buttons on the web interface to move the print head in the X and Y directions by various amounts. You should observe that the height of the print head remains constant. In some cases, you should observe that one or two of the carriages move up and then down within a single move. You can try other types of move too, but bear in mind that at this point, Z=0 is a few mm below the bed. So you should not command the printer to low Z heights yet.

Calibrating the endstop positions, delta radius and homed height

EDIT: 7-factor fast auto-calibration is now implemented! If your printer has a Z probe, instead of following the instructions in this section, you can read part 4 of this series. This tells you how to test and calibrate the Z probe, and run auto-calibration. If you don’t have a working Z probe, read on.

First, fine-tune the endstop positions like this:

  1. Make sure that the bed is clipped to the bed support but don’t place the clips close to the towers. Also make sure that there is no extruded filament stuck to the bottom of the nozzle.
  2. Send M666 X0 Y0 Z0 to clear any existing endstop adjustments.
  3. Home the printer, then send G1 X0 Y0 Z30 F5000. This should place the head just under 30mm above the centre of the bed.
  4. Put a piece of ordinary 80gsm paper on the bed and use the buttons on the web interface to lower the head in small steps until it just grips the paper. Use 0.05mm steps for the last stage (on the Settings tab of the web interface, select “Use half Z steps”). Make a note of the Z height reading on the web interface when it just grips.
  5. Now use the web interface to raise the head by 5mm. Command the head to X-75 Y-42 (by sending G1 X-75 Y-42). This places the head next to the X tower. Again lower the head in stages until it just grips the paper, and read off the Z height.
  6. Repeat step 5 using position X75 Y-42 (next to the Y tower).
  7. Repeat step 5 using position X0 Y85 (next to the Z tower).
  8. When I did this, I got the following results (Height 1 column):
    X Y Tower Height 1 Height 2 Height 3 Height 4
    0 0 Centre 5.55
    -75 -42 X 5.25
    75 -42 Y 4.80
    0 85 Z 5.60

    The centre height should be roughly the average of the other three, but at this stage, ignore it if it is out by a small amount.  Now construct a M666 command from the other three heights, putting a minus sign in front of each like this: M666 X-5.25 Y-4.80 Z-5.60 Send this command to the printer.

  9. Now repeat steps 3 through 7 of this procedure. This time, the heights should be close to zero. I got these results (Height 2 column):
    X Y Tower Height 1 Height 2 Height 3 Height 4
    0 0 Centre 5.55 0.25
    -75 -42 X 5.25  0.00
    75 -42 Y 4.80 -0.10
    0 85 Z 5.60 -0.05

    Add the Height 1 and Height 2 figures together, and construct a new M566 command from the totals: M666 X-5.25 Y-4.70 Z-5.55

  10. Send this to the printer and repeat steps 3 through 7 again. Repeat as necessary until you have all then heights next to the towers at zero:
    X Y Tower Height 1 Height 2 Height 3 Height 4
    0 0 Centre 5.55 0.25 0.35 0.30
    -75 -42 X 5.25 0.00 0.00 0.00
    75 -42 Y 4.80 -0.10 0.05 0.00
    0 85 Z 5.60 -0.05 0.05 0.00
  11. Now you need to adjust the delta parameters to eliminate the error at the centre of the bed. Assuming you measured the lengths of the diagonal rods accurately, you need to adjust the delta radius and homed height. For standard delta printer geometry (delta radius close to half the diagonal rod length), calculate them like this:

    R’ = R – 2.2 * h H’ = H – h

    h is the height error at the centre of the bed, R, L and H are the delta radius, diagonal rod length and homed height currently set in the M665 command in config.g, and R’ and H’ are the new values. The factor of 2.2 is approximate because the exact value depends on how close to vertical the diagonal rods to a tower are when the head is near to that tower. The default values of R, L and H in the config.g file I supply for the Mini Kossel are 105.6, 215.0 and 240 respectively. To correct my +0.30mm height error, I needed to reduce R to 1o4.94 and reduce H to 239.70. Send the correction to the printer: M665 R104.94 H239.70 Now home the printer and check the 4 heights again. The centre height should be zero. The heights near the towers may be slightly different from zero, in which case you need to fine-tune the R parameter. Always home the printer after sending a new M665 or M666 command.

  12. The final check should be done with the bed and hot end at operating temperature, to allow for expansion. You may find that all spot heights are now greater than zero by the same amount; in which case, subtract that amount from the M665 H parameter.
  13. When you have established the perfect values for the M665 and M666 commands, edit them into those commands in the copy of config.g on your PC, then upload it to the printer via the web interface. Reset the printer, home it, set the hot end and bed to operating temperatures, and check that all 4 spot heights are as close to zero as you can reasonably get them.

Calibrating the extruder

The extruder steps/mm value is set and adjusted via the E parameter in the M92 command in config.g. The default command in my config.g file for the Mini Kossel is M92 E663:663 which sets the steps/mm for both extruder 1 and extruder 2 (if present) to 663. The overall procedure for determining the actual steps/mm for your printer is well-known and not firmware-dependent, so I will not go into it here. You can try out new values by sending the new M92 command via the web interface. When you have established the correct value for your printer, edit it into config.g and upload to the printer in the usual way.

Orthogonal axis compensation

If your print bed is not perfectly orthogonal to the towers, you can compensate for it using the M556 command in config.g. For a general idea of how to do this, see the page for setting up orthogonal axis compensation on the Ormerod 2 at https://reprappro.com/documentation/ormerod-2/axis-compensation/#Orthogonal_Axis_Compensation.


Now you are ready to print! Start with something small and simple, such as the Escher lizard in the /gcodes folder of the sample SD card contents for Mini Kossel in my repository. Note that this file does not home the printer, nor does it set the heated bed temperature. So before printing it, home the printer and heat the bed to working temperature. When it has warmed up, you may wish to check that when the head just grips a piece of paper at the centre of the bed, the Z height readout is zero. If it isn’t, just raise or lower the head until it just grips the paper, then send G92 Z0 to define that point as Z=0. This setting will be preserved until you next home the printer.

Slicing models for your printer

If you have not used Duet electronics and firmware before,  please note the following when configuring your slicing program:

  • Relative extruder moves are recommended. So configure your slicer to generate relative extruder moves and to include the M83 command in the start gcode. However, if you are using a program such as Cura that does not support generating relative extruder moves, you can use absolute extruder moves instead.
  • As from April 2015, the convention with Duet firmware is that the first extruder is Tool 0. So you should include a T0 command in your start gcode, before any commands to set the hot end temperature.

2015-01-30 23.11.03Adding a touch screen control panel

Now that you have your Delta printer controlled by Duet electronics, why not upgrade it to include a PanelDue touch-screen control panel, as pictured here? This allows you to control the essential printer functions and print files from the SD card, without the need for an attached PC. You can either buy the controller board from me and source the display yourself, or buy the complete kit from Think3DPrint3D.

To follow…

In the next entry in this series, I describe how to use a Z probe with the Duet on a Delta printer.


Thanks to Think3DPrint3D for providing the Mini Kossel kit and Duet board for this project.

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

7 Responses to Upgrading the Mini Kossel to Duet Electronics Part 3: Calibration

  1. Doug says:

    Nice one Dave should have my large cherry pi together over the weekend ready to do some testing at least as still waiting for the circular heater from China, Could always put my square one on it for the time being tho whilst the round bits turn up!

    Thanks for all your time on this project it is appreciated.


  2. wayno says:

    y T3P3 Mini Kossel is updated and printing with Duet and PanelDue! Thanks for all the hard work you are putting into this project.

  3. wayno says:

    Hi David. I usually use Slic3r and am happy with how it works, i need to use Cura for a particular model that is known not to work in Slic3r. I have followed your advice in this article but am having problems with getting the start code right. I’m setting T0 and NOT using M83 as in my Slic3r gcode but I still cant get the hotend to heat up. The extruder motor also spazzes out.

    Do you have a working start gcode for your mini kossel that you could share?


  4. wayno says:

    Update: If i manually edit the cura produced G-Code and put T0 at the very start all is good. The ‘Start Code’ entered into the cura tab isn’t the very first code so putting T0 here doesn’t help.

  5. davidcrocker says:

    You could try ignoring the error and putting a command in your start gcode to heat the nozzle up. In slic3r it would be something like this:

    M104 S[first_layer_temperature]

  6. Kory Krofft says:

    David, Using your blog as a guide, I completed a large delta just before Christmas and have spent many enjoyable hours tuning an tweaking. From the very first, it has ben capable of some very clean prints so most of the work is in improving accuracy. I am using your bed sensor board with the new version of the Duet controller and can’t imagine any other way to go. I use the Duet Web Control interface. I am not sure where the best place is to ask specific questions so I’ll do it here. Tell me if there is a better point of access if I need a little advice directly from you.
    While testing the printer with various slicers, I will occasionally find a need to cancel a print. Some times it works as expected, with the head moving off the print towards the Z tower. But most of the time, the print will stop and immediately the filament will retract a very long way. Sometimes all the way back to the extruder. Once this retraction starts I usually have to use the E-Stop to pause it. The worst part of this is that often, the rapid retraction will leave a blob of material on the end of the filament which will jam up the extruder making it very difficult to reload. Even if it doesn’t retract that far, I still have to heat up the nozzle and reload before I can resume or restart the print. I cannot seem to figure out why this happens. I considered the slicers but that doesn’t seem to be the cause. I use Cura most of the time as I have had the best prints with it. But Slic3r generated code exhibits the same issue at least some of the time.
    Can you suggest where I should look for the cause?

    Thank you,

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 )

Google+ photo

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

Connecting to %s