Skip to content

Modular, opensource, high performance G-code interpreter and CNC controller written in Object-Oriented C++

Notifications You must be signed in to change notification settings

daboeg/Smoothieware

 
 

Repository files navigation

626Pilot's Delta Calibration - Introduction

This is beta-quality code. I don't think it will crash your probe, but keep your hand near the power switch anyway, and DON'T walk away while it's probing!

This firmware includes an advanced auto-calibration system for Delta printers. See comments at the top of src/modules/tools/zprobe/ComprehensiveDeltaStrategy.cpp for more info.

Download firmware.bin from the FirmwareBin directory, put it on your SD card, and reboot. Make sure you're downloading firmware.bin directly, and not just saving the page you find it on. If you don't download it directly, the controller won't boot! If you need to build and upload your own firmware, instructions are further down in this file.

The auto-calibration system requires either a Z-probe, or a print surface resting on force-sensitive resistors (FSRs) that have been hooked up to your controller to serve as "min endstops." If you need a Z-probe, this is the one I designed, which can be built for about $15 + some 3D-printed parts: http://www.thingiverse.com/thing:161753

It is also possible to use a cheap (less than $5) mechanical endstop. This may not be quite as accurate as the other Z-probe because the switch lever may bend slightly over time. Anyway, I have one here: http://www.thingiverse.com/thing:1000936

You will need to add some settings to your config file - see the Azteeg X5 and Smoothieboard ".delta" directories under ConfigSamples. I put all the settings you need near the top. The Smoothieboard file is more up-to-date, as I no longer have a working Azteeg X5.

Configuration File

You'll need to pull one of the example files (boardname.delta) out of ConfigSamples and adapt it for your printer. Make sure you don't leave ANYTHING out. If you do, strange things WILL happen!

This module uses a lot of RAM. It has a lot to keep track of! You may find it necessary to disable LCD panel and network support in your configuration file until after you're done calibrating. (It will be necessary to leave the ComprehensiveDeltaStrategy module turned on at all times for depth correction, but it uses significantly less RAM when it's not actively calibrating!)

Calibration Workflow

The recommended way to use this on a Delta printer is:

  • G29 E (calibrate your probe)
  • G32 (iterative calibration - gets endstops/delta radius correct - type M500 after it's done to save!)
  • G31 H O P Q R (simulated annealing - corrects for errors in X, Y, and Z - it may help to run this multiple times)
  • G31 A (depth mapping - corrects errors in Z, but not X or Y - benefits from simulated annealing, though)
  • M500 to save everything
  • Hint:* Try leaving the P command (adjust arm length) out of G31 H O P Q R. You should know your arm length already, and it should stay fixed.
  • Hint:* Type G31 by itself to get a full list of its available commands. You can specify different annealing temperature multipliers per-variable! This isn't usually necessary, but nice to have.

Probe Calibration

It's *essential* to run G29 first, to get an idea of how repeatable your probe is - and to tune the probing parameters, which can have a HUGE impact on accuracy! You want 30 microns (0.03mm) or less, ideally zero. If your probe's repeatability is worse than that, you may have printed your mount too loosely (not enough filament flow) or you may have "delta arm blues" or some other slop in the printer that should be corrected before trying any sort of calibration. You may also have bad probe electronics! If you're using an endstop probe and it has crashed into the bed a few times, it may have damaged the switch. If you can't get good repeatability, try replacing it!

Priming and smoothing will make everything take longer to run, but may provide greater accuracy - provided that they actually provide a benefit, which they may or may not! If you need excessive priming or smoothing, it may be that your feedrates (particularly slow_feedrate) and accelerations are off. If they're too high, you may have repeatability issues; and if they're too low, you may have problems from the steppers vibrating. (They will tend to vibrate more the slower you go!)

The best way to calibrate your probe is to use the command G29 E S15 with different values for smoothing (P) and priming (Q). I would not bother to use either feature unless that experiment tells you it's necessary. *Do yourself a favor.* Spend as much time on G29 as it takes to get your probe's score as low as possible. You want 0, but you can take a little higher. *Even if it takes 20 minutes to get your probe dialed in, it WILL pay off ALL THE TIME because you'll get a better calibration!!!*

Heated Bed

If you have a heated bed, you MAY want to turn it on during the GeneB-style calibration (G32) and the simulated annealing routine (G31 HOPQR). However, you may want to leave it off instead. Try it both ways. The thermal expansion of the print surface may cause better results at room temperature, or at your favorite printing temperature. Choose the one that produces a better calibration (the one with the lowest energy).

If you don't have a heated bed, it will be necessary to set *comprehensive-delta.probe_ignore_bed_temp* to *true* in your config.

"But shouldn't we always calibrate at full operating temperature?" - No, not necessarily. We want the print surface to have the least amount of deformation possible during calibration, because those deformations will throw the calibration off. That's why you'd want to try it both ways, and pick whichever one is better.

ATTENTION

  • Make sure you bring your print surface up to temperature BEFORE you run the depth correction routine (G31 A). The print surface WILL change shape slightly when it's brought up to temperature - and yes, it IS enough to matter!!!

Printer Calibration

After your probe is calibrated, you can run G32, which will perform a standard "GeneB"-style calibration, in which delta radius and endstops are adjusted. That will get your printer a little closer to its optimal configuration. It will also clear out all of the adjustment variables (tower radius/angle, surface normal).

Then, you can run the simulated annealing calibration. Type G31 HOQR (to anneal everything except the arm length, which is a GOOD IDEA) or G31 HOPQR (to anneal everything including arm length). If you want to completely start from scratch, you can run G31 HOQRY (the Y means "reset all offsets to 0") - but I don't recommend that - better to start from a fresh G32 (GeneB) calibration. The printer will go down and tap the print surface in a grid, and then start the simulated annealing process. It should take a few minutes, and you'll see two of the LEDs on the controller flash on and off slowly to indicate that it's working.

The algorithm has the ability to transit through worse solutions in order to find better ones, so you may find that as you run G31, it gets worse before it gets better, in two ways. First, the readout that tells you the energy level (during annealing) may rise before it falls. (You want the energy reading to be as low as possible - ideally 0. 0.05 or less is optimal.)

Second, you may find that running G31 produces worse (higher energy) results that then become better. Each time you get a better result, my recommendation is to type M500 so that the calibration is saved. That way, you can run the annealing process five times if you want, and if it never produces an improvement, you can just reset the controller.

There ARE conditions in which the simulated annealing will not improve the calibration:

  • If your calibration is already fairly good (less than 0.05 energy on my printer, and maybe higher or lower on yours), this may well be the case. This is also a good reason to type M500 after you run G32.
  • It may also be that you have too much tower lean. Any tower lean will twist the effector so that it's not parallell ("tram") with the print surface. That twisting will rotate the effector's nozzle slightly off from center, meaning that its XYZ position is deflected a little from where the printer thinks it is! This can throw off the calibration. Using a digital angle gauge like the ones used to algin table saws, you may be able to re-tighten your towers to your chassis such that they have less lean. Some delta printers are better about this than others.
  • It may be that there's an issue with the probe. I found that using my Hall-O probe mount, it worked very poorly when I used 16-gauge wires to conenct it because the stiffness of the wire would push and pull against the probe during travel. If you want to use my Hall-O probe, make sure you use thin wire (22-gauge or higher), such as that which comes with the Hall-O board.

Depth Mapping (Z-only correction)

  • REMEMBER:* If you have a heated bed, do the above steps with your heated bed OFF. Then, turn the bed heat ON and wait for it to STABILIZE at its operating temperature BEFORE you proceed!!!

G31 HOPQR fixes errors in X, Y, and Z, assisting greatly with dimensional accuracy. However, there is one final step to get an even better calibration! After G31 HOPQR, you can run G31 A. That will tap the bed in a grid as before, but instead of adjusting the calibration, it will store a depth map of the print surface and use this to correct Z in real time. This ONLY fixes errors in Z, not X or Y, so you should only run it AFTER you do the annealing. Afterwards, you can run G31 Z again, and it'll show you the final corrected depths - they should be within a few microns of zero!

Saving the calibration

When you're satisfied with your calibration, type M500 to save everything. If you turn the printer off and then on again, it WON'T lose its configuration, so you only have to do this calibration once. Run it again if the printer is moved, or a heavy object or person collides with it.

Depth Mapping Visualizer

pyjamasam (SeeMeCNC forums) has posted a Python script that you can use to visualize the amount of Z error across your print surface by analyzing dm_surface_transform, a file that this firmware will put on your SD card after you run G31 A. I've included it in the same directory as this text file.

To use, copy dm_surface_transform from the SD card to the current directory, and then run this command: python dm_surface_analyzer.py

You will need to have Python and matplotlib installed. If you open dm_surface_analyzer.py in a text editor, you can see the instructions right at the top.

Original Smoothie README below:

Current build status:

Overview

Smoothie is a free, opensource, high performance G-code interpreter and CNC controller written in Object-Oriented C++ for the LPC17xx micro-controller ( ARM Cortex M3 architecture ). It will run on a mBed, a LPCXpresso, a SmoothieBoard, R2C2 or any other LPC17xx-based board. The motion control part is a port of the awesome grbl.

Documentation can be found here : http://smoothieware.org/

NOTE it is not necessary to build Smoothie yourself unless you want to. prebuilt binaries are available here: Nightly builds and here: recent stable build

Quick Start

These are the quick steps to get Smoothie dependencies installed on your computer:

  • Pull down a clone of the Smoothie github project to your local machine.
  • In the root subdirectory of the cloned Smoothie project, there are install scripts for the supported platforms. Run the install script appropriate for your platform:
    • Windows: win_install.cmd
    • OS X: mac_install
    • Linux: linux_install
  • You can then run the BuildShell script which will be created during the install to properly configure the PATH environment variable to point to the required version of GCC for ARM which was just installed on your machine. You may want to edit this script to further customize your development environment.

Building Smoothie

From a shell, switch into the root Smoothie project directory and run:

make clean
make all

To upload you can do

make upload

if you have dfu-util installed.

Alternatively copy the file LPC1768/main.bin to the sdcard calling it firmware.bin and reset.

Donate

The Smoothie firmware is free software developed by volunteers. If you find this software useful, want to say thanks and encourage development, please consider a Donation

About

Modular, opensource, high performance G-code interpreter and CNC controller written in Object-Oriented C++

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 56.1%
  • C 40.6%
  • HTML 1.0%
  • Makefile 1.0%
  • Shell 0.4%
  • Ruby 0.3%
  • Other 0.6%