Heuristic (AI) calibration for delta printers on Smoothie

Post Reply
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1720
Joined: Tue May 14, 2013 12:52 pm

Heuristic (AI) calibration for delta printers on Smoothie

Post by 626Pilot »

LONG STORY SHORT:
Source: https://github.com/626Pilot/Smoothieware" onclick="window.open(this.href);return false;
Firmware download: https://github.com/626Pilot/Smoothiewar ... rmware.bin" onclick="window.open(this.href);return false;
Instructions: https://github.com/626Pilot/Smoothiewar ... DME.creole" onclick="window.open(this.href);return false;

CONFIG OPTIONS HAVE CHANGED!
Please see this post. You will need to add a line to your config if it isn't already there, and there are other options that have been renamed or added.

OLD VERSIONS
Old versions of the firmware are available here: https://github.com/626Pilot/Smoothiewar ... rmware.bin" onclick="window.open(this.href);return false;

The commits from 626Pilot are mine. The ones from Jim Morris are not part of my fork, and won't have any of my code. For example, if you scroll to Sept. 19, you'll see a commit from 626Pilot (me) titled "Updating firmware.bin with support for tower scaling." Click that text. Then you'll see "BIN [][][][][] FirmwareBin/firmware.bin" - click View. On the next page, right-click Raw and then save-as.

WHAT FOLLOWS IS LEFT FOR POSTERITY - YOU'RE BETTER OFF READING THE INSTRUCTIONS AT THE LINK ABOVE!

As discussed in this thread, I started working on a heuristic tuning system to get our printers calibrated as best as possible in the summer of 2014. At first, I tried some hard-coded logic to try to tweak the parameters based on hard-coded rules. That was based on code someone had written for Marlin. I could never get it to do much, and it was more likely to get worse and worse with each iteration until finally it got so bad I'd have to turn the printer off.

As summer passed into fall, I started reading up on heuristics so that I could figure out whether there might be a way to let the machine figure out what I couldn't. I found a method called simulated annealing. The algorithm is basically a physics simulator that models annealing, in which metallurgists get atoms of metal to form extremely strong matrices by carefully cooling the metal in steps. SA is one of the fundamental algorithms used in machine intelligence. When you hear about a supercomputer that fills an entire data center running thousands of processors in parallel, there's a good chance that some of those CPUs are running SA algorithms often, if not constantly. SA is a form of machine intelligence that allows computers to solve problems that they have no fundamental understanding of. Some reasonable constraints (which variables, what ranges those variables can be in, etc.) have to be supplied, but aside from those constraints, the algorithm doesn't have to know the nature of what system it's trying to solve.

On the forums, you can find all sorts of advice like, "If the effector is too high next to Z but too low opposite Z, you have to loosen the Z endstop screw." The SA algorithm doesn't actually know that. It doesn't know the relationship between endstops, arm length, delta radius, individual tower offsets, or the surface normal of the build platform. However, because I've given it the ability to simulate different configurations (a "virtual delta printer"), it has the ability to slowly "creep" all 14 variables in the right direction, simultaneously. It can wander through less-optimal configurations on its way to more-optimal configurations, so it has some ability to find its way out of "blind alleys" on its way to better solutions. The particular algorithm I implemented is technically parallel simulated annealing, as each variable can have its own "temperature."

These are the 14 variables the algorithm can adjust:
  • Delta radius
  • Arm length
  • Endstops
  • Tower rotation offsets
  • Tower radius offsets
  • Surface normal (how perpendicular the towers are to the print surface)
In addition to simulated annealing, the software comes with some additional features:
  • Probe calibration - lets you adjust the probe's settings. Priming (running the probe several times before measuring), smoothing (probing several times and averaging the result), and smooth acceleration/deceleration can all be adjusted.
  • Iterative calibration (like Gene B's method - adjust delta radius and endstops at the same time). Both variables are converged simultaneously, usually after a few probing cycles.
  • Depth map-based Z correction - maps the print surface in a grid. Using bilinear interpolation and extrapolation, any positioning errors in Z not corrected by the simulated annealing can be smoothed out. The grid is 5x5, but in the future I'd like to enlarge it to 7x7 or even more, as that would be smoother. I think I need to migrate the bilinear interpolation array to AHB0 (esoteric memory thing on the ARM processor) first.
One final thing to simulate would be the towers, which are assumed to be perfectly straight up and down. In designs like the Rostock MAX, they can lean in or out a little by up to a couple degrees, less if an angle gauge is used during calibration but still not zero. The kinematics don't support this, but the calibration might get better if they did. However, with depth-mapping correction, it's "good enough" for now.

Simulated annealing corrects for errors in X, Y and Z. This should get anyone's delta printer closer to optimal. The depth-map based Z correction will take out enough of whatever error remains, that your printer's positioning on the Z axis should be within 20-30 microns of perfection - and often better than that. X and Y will be more accurate as well.

Building and Installing

NOTE: You don't have to do this section anymore unless you want to! You can just download firmware.bin from GitHub and put it on your SD card.

You'll need to take one of the example config files out of ConfigSamples/*.delta and adjust it to your printer.

I don't know how the heck the FirmwareBin directory works. I tried copying a fresh .bin in there, but when I tried flashing it, it had none of the features I added, so until I figure that out you have to build it yourself. The following commands work in bash (Linux). If you have Windows or Mac... figure it out. Hey, I'm working for free here! :)

You'll need to install dfu-util first. It should be in your distribution's repo (software source).

Code: Select all

git clone https://github.com/626Pilot/Smoothieware.git
cd Smoothieware
sh linux_install (or mac_install)
sh BuildShell
make all
That will build a fresh copy. To upload it, type this:

Code: Select all

make upload
If that doesn't work, google the error message - it means you have to configure Linux to let you use dfu-util without being root.

If you don't want to mess with dfu-util, you can copy LPC1768/main.bin to your printer's SD card. Rename it to firmware.bin, safely eject/disconnect the card, and then power-cycle the printer. Whether you use dfu-util (make upload) or copy by hand, when the printer reboots, you should see the LEDs slowly counting in binary for a few seconds before strobing as usual. That's how you know the firmware got flashed.[/s]

Using
The recommended way to use this on a Delta printer is:
G29 (calibrate your probe - run this, adjusting the parameters each time until you get a good result)
G32 (iterative calibration - gets endstops/delta radius correct - K to keep, but don't use that if you want to run G31 afterwards)
G31 O P Q R S (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)
G31 Z (depth map and print results - here is where you should see a lot of improvement!)

Remember to type M500 to save your configuration. Otherwise, your printer will forget everything it did the next time it's powered off!


Results
Here are the bed depths measured without any calibration at all, measured by typing G31 Z:

Code: Select all

[PD]                         0.403
[PD]
[PD] [ 0.000]     0.253     -0.028     -0.272    [ 0.000]
[PD]
[PD]   0.563      0.169      0.000     -0.244     -0.169
[PD]
[PD] [ 0.000]     0.103     -0.075     -0.141    [ 0.000]
[PD]
[PD]                        -0.122
[PD] Best=0.000, worst=0.563, min=-0.272, max=0.563, mu=0.018, sigma=0.176, energy=0.212
After heuristic calibration (parallel annealing):

Code: Select all

[PD]                         0.253
[PD]
[PD] [ 0.000]    -0.084     -0.084     -0.056    [ 0.000]
[PD]
[PD]   0.028     -0.094      0.000      0.047      0.403
[PD]
[PD] [ 0.000]    -0.084      0.038      0.216    [ 0.000]
[PD]
[PD]                         0.075
[PD] Best=0.000, worst=0.403, min=-0.094, max=0.403, mu=0.026, sigma=0.109, energy=0.122
After heuristic calibration + Z correction:

Code: Select all

[PD]                        -0.019
[PD]
[PD] [ 0.000]     0.019     -0.009     -0.028    [ 0.000]
[PD]
[PD]   0.000      0.009      0.000     -0.009      0.009
[PD]
[PD] [ 0.000]     0.009      0.000     -0.038    [ 0.000]
[PD]
[PD]                        -0.056
[PD] Best=0.000, worst=0.056, min=-0.056, max=0.019, mu=-0.005, sigma=0.015, energy=0.017
In the old thread, two other people ran my firmware and got about the same final result, but the heuristic calibration without Z correction was far better than mine. My printer is one of the early acrylic kits (ordered Dec. 2012), so maybe theirs have better laser-cut parts.

I consider this a beta-quality release. It probably won't break your printer, but keep your hand on the power switch until you've seen it run successfully for awhile and don't leave it unattended while it's probing!

There is room for more improvement in the code, and I'll get to that when I have some time. For now, I hope some more people can benefit from my work.

If you run my firmware, I'd appreciate it if you could share your experience here. It would be nice to see some before-and-after G31 Z output. I would eventually like to send a pull request to the Smoothieware project so that they can pull my code into the main distro, and I told him I'd have some people test it out first.
Last edited by 626Pilot on Tue Mar 15, 2016 12:29 am, edited 10 times in total.
geneb
ULTIMATE 3D JEDI
Posts: 5362
Joined: Mon Oct 15, 2012 12:47 pm
Location: Graham, WA
Contact:

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by geneb »

Please post this to the deltabots mailing list. There's a ton of Smoothieboards about to be sold for a great price and I suspect most of them are going into deltas.

g.
Delta Power!
Defeat the Cartesian Agenda!
http://www.f15sim.com - 80-0007, The only one of its kind.
http://geneb.simpits.org - Technical and Simulator Projects
User avatar
mhackney
ULTIMATE 3D JEDI
Posts: 5412
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by mhackney »

Very cool 626Pilot. Firstly, you could zip and upload Firmware.bin here.

Next, back in the 80s/90s when I did injection molding of ceramics for turbine engines we consulted with Taguchi to optimize our process. It was an amazing and eyeopening experience on how to optimize systems like this. I was familiar with SA but didn't understand how it differed from Taguchi, so I googled them together. It turns out that folks are now applying Taguchi to SA to achieve better/faster results. Here's some work published last year: http://link.springer.com/article/10.100 ... 4-y#page-1" onclick="window.open(this.href);return false;

I am going to give your implementation a whirl as soon as I get my Smoothie back on line (I need to solder on some more headers to support the glad built-in SD reader).

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by Tonkabot »

I am assuming that you've added a z-probe so the smoothie can automatically make the z-mapping?
How (or where) can I see the probe and how to hook it up?

I am guessing it is just a microswitch type of probe. I also assume that to get the microswitch to be repeatable you have to probe at some slow speed.

I am debating with myself if I should buy a smoothieboard in addition to designing my own system. Buying one is obviously going to get done faster...
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1720
Joined: Tue May 14, 2013 12:52 pm

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by 626Pilot »

geneb wrote:Please post this to the deltabots mailing list. There's a ton of Smoothieboards about to be sold for a great price and I suspect most of them are going into deltas.
I will.
Tonkabot wrote:I am assuming that you've added a z-probe so the smoothie can automatically make the z-mapping?
How (or where) can I see the probe and how to hook it up?
You can get mine here. Instructions provided.

[img]http://thingiverse-production-new.s3.am ... atured.jpg[/img]
I am guessing it is just a microswitch type of probe. I also assume that to get the microswitch to be repeatable you have to probe at some slow speed.
You can use something like that. Many people use endstop switches for this purpose. I like mine better because it has a huge runout capability, so I can use smooth probe deceleration to slow it down after it has already triggered. Without that, the printer has to jerk to a stop. That seems to hurt repeatability.
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by Tonkabot »

626pilot, I just looked at your probe design and looks like it should work...
I don't see the actual probe (as in the moving part) in your picture, and I don't see where the magnets go (Yes I see it says where to put them, but I like to see things...)

I think I'll make up a probe starting with yours, however I think I'll just use an opto sensor instead of the hall. cheaper and should be more repeatable yet.
I have a bunch of these: http://www.digikey.com/product-detail/e ... ND/1015250 so it won't cost me anything for the sensor.
they have a 10mil slit on the detector side (and 50mil on the LED side), my experience is that they work well, with excellent repeatability.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1720
Joined: Tue May 14, 2013 12:52 pm

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by 626Pilot »

The moving part is a metal "axle" from McMaster-Carr that hangs off a Nd magnet. When the probe descends, the axle touches the surface, driving the magnet up towards the Hall sensor.

I discovered last night that it's a good idea to lash the probe cable to a screw on the platform, so it can't move relative to the probe. Otherwise, the probe can be bent a little out of orientation as the platform moves around.
User avatar
jdurand
Printmaster!
Posts: 397
Joined: Mon Dec 01, 2014 12:41 am
Location: Silicon Valley, California
Contact:

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by jdurand »

What about an ultrasonic sensor, don't know if the beam could be narrowed.
Standing on the edge of reality... (me)
Quando omni flunkus moritati (Red Green)
Let no man belong to another that can belong to himself. (Paracelsus)
All things are poison and nothing is without poison; only the dose makes a thing not a poison. (Ibid.)
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1720
Joined: Tue May 14, 2013 12:52 pm

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by 626Pilot »

I think the best sensor would be three FSRs. Then, you don't need a probe.
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by Tonkabot »

what is an FSR?

An ultrasonic will not be repeatable enough. sound at 120khz has a wavelength of a centimeter or so, so a centimeter or so is the accuracy you can get.

That Khalid guy was trying an inductive probe, I know they are pretty accurate and repeatable. I don't know how well he got it working.


So if I replace the print head with a probe and calibrate, doesn't switching back to a printhead maybe change things on the end effector a bit - enough to mess with calibration?
I can see it has a different mass and I maybe torqued the screws different...
geneb
ULTIMATE 3D JEDI
Posts: 5362
Joined: Mon Oct 15, 2012 12:47 pm
Location: Graham, WA
Contact:

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by geneb »

Force Sensitive Resistor.

g.
Delta Power!
Defeat the Cartesian Agenda!
http://www.f15sim.com - 80-0007, The only one of its kind.
http://geneb.simpits.org - Technical and Simulator Projects
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by Tonkabot »

geneb wrote:Force Sensitive Resistor.

g.
Oh. FSR's are not very accurate at detecting force, and they are an analog sensor. you either need a comparator to set the threshold that your digital output switches at, or you rely on the internal threshold of the input pin of the processor - which is not that narrow but might remain consistent on a particular CPU. I would guess they are about as good as a microswitch, only more complicated.

Your intention is to use a force sensor for a position probe? ?

Also, why 3?

I think optical would be better if you use a part like the one I posted previously http://www.digikey.com/product-detail/e ... ND/1015250. I am sure if you just try an LED and a phototransistor without aperatures, you will have problems.
User avatar
Nylocke
ULTIMATE 3D JEDI
Posts: 1421
Joined: Sun Jun 23, 2013 1:43 pm
Location: Iowa

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by Nylocke »

Check out my build thread, Ive got FSRs on my printer. Haven't used them a ton considering the auto calibration on Repetier isn't that great, but they do work well. TriD sells a board so you can just plug them directly into it and the board right into one of the endstops. Johann was using/is using them on his Kossels AFAIK. http://deltabot.tumblr.com" onclick="window.open(this.href);return false; scroll down to the post 2014-02-27.
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by Tonkabot »

Nylocke wrote:Check out my build thread, Ive got FSRs on my printer. Haven't used them a ton considering the auto calibration on Repetier isn't that great, but they do work well. TriD sells a board so you can just plug them directly into it and the board right into one of the endstops. Johann was using/is using them on his Kossels AFAIK. http://deltabot.tumblr.com" onclick="window.open(this.href);return false; scroll down to the post 2014-02-27.
Okay, now I see how the FSR's are being used here. I had imagined them being used to sense a probe contacting the glass (which would be a poor use of them).
Having them under the bed and sensing the print nozzle pressing the glass I can see working for Johann.

Used on the rostock they would have to go between the heated bed and the glass. The heat probably doesn't hurt them much. however, the paperclips hold the glass down with some force, and you would now have to read them and decide that the paperclip force is okay, and a little more means the nozzle is pressing the glass. It still seems like it would have to be dialed in on the threshold between the paperclips, and paperclips + nozzle touching. Or one would have to make the glass 'float' as seen in Johann's video.
User avatar
Nylocke
ULTIMATE 3D JEDI
Posts: 1421
Joined: Sun Jun 23, 2013 1:43 pm
Location: Iowa

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by Nylocke »

They are sensitive to heat, and mine go under the snowflake, not the glass. Again, check out my or rpress's build thread, my system is a printed version of his

http://forum.seemecnc.com/viewtopic.php ... 6&start=75" onclick="window.open(this.href);return false;
http://capcart.tumblr.com/post/11040483 ... nsors-from" onclick="window.open(this.href);return false;

Pics on my blog and on my build thread.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1720
Joined: Tue May 14, 2013 12:52 pm

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by 626Pilot »

Tonkabot wrote:So if I replace the print head with a probe and calibrate, doesn't switching back to a printhead maybe change things on the end effector a bit - enough to mess with calibration? I can see it has a different mass and I maybe torqued the screws different...
It doesn't seem to matter. Think of all the forces the effector is under while it's slewing all over the place, being rapidly accelerated and decelerated millions of times, and it never goes out of whack. Unscrewing a probe and then screwing in a hot end mount won't matter to the U-joints.
Tonkabot wrote:Oh. FSR's are not very accurate at detecting force, and they are an analog sensor. you either need a comparator to set the threshold that your digital output switches at, or you rely on the internal threshold of the input pin of the processor - which is not that narrow but might remain consistent on a particular CPU. I would guess they are about as good as a microswitch, only more complicated.
There is a guy who posted in the last thread, who has three FSRs rigged in parallel, one near each tower. The print surface effectively sits on them. He used my probe calibration (G29) and measured a repeatability of 0 steps (n=10, sigma=0). With my probe, AND smooth probe deceleration that I added to the ZProbe class, I get a sigma of 0.3-0.6 steps.
Also, why 3?
If (and this is a big if) I can find some with enough repeatability and accuracy, I would like to try to use them to triangulate the touched position. If the hot end touches the glass near X, X will read "heavier" than Y or Z's FSRs. If the FSRs are good enough, it should be possible to get an accurate read of where the probe actually touched. If I could triangulate the position to within better than 50 microns, it would be worth feeding it into the simulated annealing. Right now, the logic uses the "expected" coordinates for X and Y, and the depth measured for Z. If it knew the actual (X, Y) position where the touch occurs, it would be possible to get a more accurate calibration. The calibration right now is fairly accurate because on deltas, X, Y, and Z are all mathematically intermingled, so an adjustment that improves Z also tends to improve X and Y.
I think optical would be better if you use a part like the one I posted previously http://www.digikey.com/product-detail/e ... ND/1015250. I am sure if you just try an LED and a phototransistor without aperatures, you will have problems.
It would be interesting if there was some cheap laser distance-measuring equipment. I have one of those "laser tapes" where you point it at an object and it tells you how far it is. If they had something like that, and it was good to within 30 microns, it would be cool because there would be no moving parts. I dunno how good it would work on glass, though.
User avatar
[email protected]
Printmaster!
Posts: 39
Joined: Mon Sep 15, 2014 1:58 pm
Location: Belvidere IL

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by [email protected] »

Thank you for working on this, I have my X5 up and running (not printing yet), just ran the current Zprobe stuff available on smoothieware and it changed the radius from 133.05 to 133.107 so my calibration was close. As soon as I can get your firmware I will try it.
Max 2
xyz DaVinci 1.0 with custom FW for Repetier-Host
Future plans
NextEngine scanner
Droplite or other SLA
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1720
Joined: Tue May 14, 2013 12:52 pm

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by 626Pilot »

I've asked Rich C if he has some interest in porting the code to Marlin: https://groups.google.com/forum/#!topic ... 5-false%5D" onclick="window.open(this.href);return false;

What's a good way to get in touch with whoever maintains Repetier?
User avatar
Nylocke
ULTIMATE 3D JEDI
Posts: 1421
Joined: Sun Jun 23, 2013 1:43 pm
Location: Iowa

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by Nylocke »

The website? I think his name is Rolland or something? Probably is an email somewhere sitting around.
User avatar
[email protected]
Printmaster!
Posts: 39
Joined: Mon Sep 15, 2014 1:58 pm
Location: Belvidere IL

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by [email protected] »

Ran the G29 it worked great, G32 worked great, G31 O P Q R S locked up the board after first probe. All the leds went green.
Azteeg x5.
Last edited by [email protected] on Thu Feb 19, 2015 6:47 pm, edited 1 time in total.
Max 2
xyz DaVinci 1.0 with custom FW for Repetier-Host
Future plans
NextEngine scanner
Droplite or other SLA
User avatar
[email protected]
Printmaster!
Posts: 39
Joined: Mon Sep 15, 2014 1:58 pm
Location: Belvidere IL

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by [email protected] »

Here is a possible laser option.
http://hackaday.com/2014/03/29/hacking- ... asy-steps/" onclick="window.open(this.href);return false;
Max 2
xyz DaVinci 1.0 with custom FW for Repetier-Host
Future plans
NextEngine scanner
Droplite or other SLA
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1720
Joined: Tue May 14, 2013 12:52 pm

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by 626Pilot »

[email protected] wrote:Ran the G29 it worked great, G32 worked great, G31 O P Q R S locked up the board after first probe. All the leds went green.
Azteeg x5.
Make sure you ported over all the options from ConfigSamples/AzteegX5.delta/config. The last guy this happened to was missing a few. If that doesn't work, can you upload your config and config-override somewhere?
User avatar
[email protected]
Printmaster!
Posts: 39
Joined: Mon Sep 15, 2014 1:58 pm
Location: Belvidere IL

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by [email protected] »

Ok, thanks
Max 2
xyz DaVinci 1.0 with custom FW for Repetier-Host
Future plans
NextEngine scanner
Droplite or other SLA
User avatar
[email protected]
Printmaster!
Posts: 39
Joined: Mon Sep 15, 2014 1:58 pm
Location: Belvidere IL

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by [email protected] »

Here is the Config file.
No override file on card.



# Robot module configurations : general handling of movement G-codes and slicing into moves
# By 626Pilot of the SeeMeCNC forums, based on mhackney's default file & reorganized for quicker editing
# Thanks to Polygonhell and Flateric for the help!


# The gamma tower height is used for all towers on delta robots
# Rest of the tower config is below, under Endstops
# ---------------------------------------------------------------------
gamma_max 374.713


# Delta Geometry
# ---------------------------------------------------------------------
# arm_radius is DELTA_RADIUS in Repetier
# DELTA_RADIUS = PRINTER_RADIUS - END_EFFECTOR_HORIZONTAL_OFFSET - CARRIAGE_HORIZONTAL_OFFSET
# = 199.0 - 33 - 37.5
# = 128.5
# ---------------------------------------------------------------------
arm_solution linear_delta # default linear_delta, you can also try kossel
arm_radius 128.5 # this is the horiontal distance from hinge to hinge when the effector is centered
arm_length 269.00 # length of the delta arms (hopefully they're all the same!)


# If you have a Z probe, you can select a calibration strategy here
# To calculate probe_offset_x/y/z:
# - Heat up the hot end with filament loaded - and the print surface, if you have bed heat (this is important!)
# - Jog the hot end down to the print surface, leaving a little dot of plastic
# - Deploy the probe, jog it until the probe tip touches the dot
# - Jog the probe up a little, remove the dot, jog it down until it triggers, and record the exact values in offset_x/y/z
# PLEASE NOTE: probe_offset_x and probe_offset_y MUST be 0 if you want to use depth (Z) correction!
# ---------------------------------------------------------------------
leveling-strategy.comprehensive-delta.enable true
comprehensive-delta.probe_smoothing 1 # if your probe has repeatability issues, this will probe multiple times & take the average (default 1)
comprehensive-delta.probe_priming 5 # if your probe keeps "creeping down", this will run it the specified number of times to get it to settle
comprehensive-delta.probe_acceleration 75 # acceleration will be temporarily set to this during probing; original is restored later; 100 is a good value
comprehensive-delta.probe_offset_x 0 # distance between the probe and the nozzle
comprehensive-delta.probe_offset_y 0 #
comprehensive-delta.probe_offset_z 32.88 #


# Optional Z probe, see http://smoothieware.org/zprobe" onclick="window.open(this.href);return false;
# ---------------------------------------------------------------------
probe endstop
probe_pin 1.29 # optional pin for probe
zprobe.enable true # set to true to enable a zprobe
zprobe.probe_pin 1.29!^ # pin probe is attached to if NC remove the !, default 1.29!^
zprobe.slow_feedrate 3 # mm/sec probe feed rate
zprobe.fast_feedrate 40 # move feedrate
zprobe.debounce_count 40 # set if noisy
zprobe.probe_radius 100 # how far out from bed center to probe
zprobe.probe_height 10 # how high the probe has to be moved above trigger elevation so that it won't drag
zprobe.decelerate_on_trigger true # beneficial, unless your probe has no runout after it hits the trigger - in which case, set this to false
zprobe.decelerate_runout 1 # how many millimeters your probe can move past the trigger point; we'll abort any decel > this long


# Speeds
# ---------------------------------------------------------------------
default_feed_rate 8000 # Default rate ( mm/minute ) for G1/G2/G3 moves
default_seek_rate 8000 # Default rate ( mm/minute ) for G0 moves
mm_per_arc_segment 0.25 # Arcs are cut into segments ( lines ), this is the length for these segments
# Smaller values mean more resolution, higher values mean faster computation
mm_per_line_segment 5 # Lines can be cut into segments (not useful with cartesian robots).
delta_segments_per_second 250 # segments per second used for deltas


# Arm solution configuration : Delta robot. Translates mm positions into stepper positions
# This is for an old Rostock MAX with 15-teeth pullies. Use a belt/pulley calculator to find the values for your machine
# ---------------------------------------------------------------------
alpha_steps_per_mm 160 # Steps per mm for alpha stepper
beta_steps_per_mm 160 # Steps per mm for beta stepper
gamma_steps_per_mm 160 # Steps per mm for gamma stepper


# Planner module configuration : Look-ahead and acceleration configuration
# ---------------------------------------------------------------------
acceleration 1000 # Acceleration in mm/second/second.
acceleration_ticks_per_second 1000 # Number of times per second the speed is updated
planner_queue_size 32 # DO NOT CHANGE THIS UNLESS YOU KNOW EXACTLY WHAT YOUR ARE DOING
junction_deviation 0.01 # Similar to the old "max_jerk", in millimeters, see : https://github.com/grbl/grbl/blob/master/planner.c#L409" onclick="window.open(this.href);return false;


# Endstops
# ---------------------------------------------------------------------
endstops_enable true # the endstop module is enabled by default and can be disabled here
delta_homing true # forces all three axis to home a the same time regardless of what is specified in G28
alpha_max_endstop 1.24^ #
alpha_homing_direction home_to_max # or set to home_to_max and set alpha_max
alpha_min 0 # this gets loaded after homing when home_to_min is set
alpha_max 0 # this gets loaded after homing when home_to_max is set
beta_max_endstop 1.26^ #
beta_homing_direction home_to_max #
beta_min 0 #
beta_max 0 #
gamma_max_endstop 1.28^ #
gamma_homing_direction home_to_max #
gamma_min 0 #
# gamma_max moved to top of file, since it's one of the most frequenly adjusted settings


# Homing
# ---------------------------------------------------------------------
alpha_fast_homing_rate_mm_s 100 # feedrates in mm/second
beta_fast_homing_rate_mm_s 100 # "
gamma_fast_homing_rate_mm_s 100 # "
alpha_slow_homing_rate_mm_s 10 # "
beta_slow_homing_rate_mm_s 10 # "
gamma_slow_homing_rate_mm_s 10 # "
alpha_homing_retract_mm 5 # distance in mm
beta_homing_retract_mm 5 # "
gamma_homing_retract_mm 5 # "

# These can be used instead of adjusting the endstop screws
alpha_trim 0 # software trim for alpha stepper endstop (in mm) - moves down
beta_trim 0 # software trim for beta stepper endstop
gamma_trim 0 # software trim for gamma stepper endstop


# Stepper module configuration
# ---------------------------------------------------------------------
microseconds_per_step_pulse 1 # Duration of step pulses to stepper drivers, in microseconds
base_stepping_frequency 100000 # Base frequency for stepping, higher gives smoother movement


# Stepper module pins ( ports, and pin numbers, appending "!" to the number will invert a pin )
# ---------------------------------------------------------------------
alpha_step_pin 2.1 # Pin for alpha stepper step signal
alpha_dir_pin 0.11 # Pin for alpha stepper direction
alpha_en_pin 0.10 # Pin for alpha enable pin
alpha_current .9 # X stepper motor current
alpha_max_rate 30000.0 # mm/min actuator max speed
x_axis_max_speed 30000.0 # mm/min cartesian max speed

beta_step_pin 2.2 # Pin for beta stepper step signal
beta_dir_pin 0.20 # Pin for beta stepper direction
beta_en_pin 0.19 # Pin for beta enable
beta_current .9 # Y stepper motor current
beta_max_rate 30000.0 # mm/min
y_axis_max_speed 30000.0 # mm/min

gamma_step_pin 2.3 # Pin for gamma stepper step signal
gamma_dir_pin 0.22 # Pin for gamma stepper direction
gamma_en_pin 0.21 # Pin for gamma enable
gamma_current .6 # Z stepper motor current
gamma_max_rate 30000.0 # mm/min
z_axis_max_speed 30000.0 # mm/min


# Extruder module configuration
# ---------------------------------------------------------------------
extruder_module_enable true # Whether to activate the extruder module at all. All configuration is ignored if false
extruder_steps_per_mm 92.65 # Steps per mm for extruder stepper - you should do a filament calibration to get this REALLY correct
extruder_default_feed_rate 600 # Default rate ( mm/minute ) for moves where only the extruder moves
extruder_acceleration 2000 # Acceleration in mm/sec^2 only used for retracts
extruder_max_speed 1000 # mm/sec NOTE only used for retracts

extruder_step_pin 2.0 # Pin for extruder step signal
extruder_dir_pin 0.5 # Pin for extruder dir signal
extruder_en_pin 0.4 # Pin for extruder enable signal
delta_current 1 # Extruder stepper motor current (Kysan NEMA17s are rated 1.2A)


# Hotend temperature control configuration
# temperature_control.hotend.thermistor can be one of the following:
# EPCOS100K, RRRF100K, RRRF10K, Honeywell100k, Semitec, or HT100K
# (source: src/modules/tools/temperaturecontrol/Thermistor.cpp)
# ---------------------------------------------------------------------
temperature_control.hotend.enable true # Whether to activate this ( "hotend" ) module at all. All configuration is ignored if false.
temperature_control.hotend.thermistor_pin 0.24 # Pin for the thermistor to read
temperature_control.hotend.heater_pin 2.5 # Pin that controls the heater
temperature_control.hotend.thermistor Semitec # see http://smoothieware.org/temperaturecontrol#toc5" onclick="window.open(this.href);return false;
temperature_control.hotend.beta 4066 # or set the beta value
temperature_control.hotend.set_m_code 104 #
temperature_control.hotend.set_and_wait_m_code 109 #
temperature_control.hotend.designator T #
temperature_control.hotend.max_temp 285 #
temperature_control.hotend.readings_per_second 20 #
temperature_control.hotend.pwm_frequency 2000 #

#temperature_control.hotend.coefficients 0.000811290160145459F,0.000211355789144265F,7.17614730463848e-08F #
#temperature_control.hotend.rt_curve 20.0,126800,150,1360,240,206.5 #
#temperature_control.hotend.i_max 128 #







# Hotend PID configuration
# These values are from an E3D v5 hot end with a part cooling fan duct.
# ---------------------------------------------------------------------
temperature_control.hotend.p_factor 30
temperature_control.hotend.i_factor 1
temperature_control.hotend.d_factor 15


# Heated bed PID configuration
# temperature_control.bed.thermistor can be one of the following:
# EPCOS100K, RRRF100K, RRRF10K, Honeywell100k, Semitec, or HT100K
# (source: src/modules/tools/temperaturecontrol/Thermistor.cpp)
# ---------------------------------------------------------------------
temperature_control.bed.enable true #
temperature_control.bed.thermistor_pin 0.23 #
temperature_control.bed.heater_pin 2.7 #
temperature_control.bed.beta 4066 #
temperature_control.bed.thermistor Semitec #
temperature_control.bed.set_m_code 140 #
temperature_control.bed.set_and_wait_m_code 190 #
temperature_control.bed.designator B #

temperature_control.bed.p_factor 30 #
temperature_control.bed.i_factor 1 #
temperature_control.bed.d_factor 15 #



# uncomment followng to use bang bang isntead of PID for the bed (best for relay conrolled hotbeds)
#temperature_control.bed.bang_bang false # set to true to use bang bang control rather than PID
#temperature_control.bed.hysteresis 2.0 # set to the temperature in degrees C to use as hysteresis when using bang bang


# Switch module for fan control
# ---------------------------------------------------------------------
switch.fan.enable true #
switch.fan.input_on_command M106 #
switch.fan.input_off_command M107 #
switch.fan.output_pin 2.4 #


# Automatically toggle a switch at a specified temperature
# (ueful to turn on a fan or water pump to cool the hotend)
# ---------------------------------------------------------------------
temperatureswitch.hotend.enable false #
temperatureswitch.hotend.type fan # select which MOSFET to use, fan or misc (small MOSFETs)
temperatureswitch.hotend.threshold_temp 60.0 # temperature to turn on (if rising) or off the switch
temperatureswitch.hotend.heatup_poll 5 # poll heatup at 15 sec intervals
temperatureswitch.hotend.cooldown_poll 5 # poll cooldown at 60 sec intervals


# For allowing the board to shut off your ATX power supply
# ---------------------------------------------------------------------
# switch.psu.enable true # turn atx on/off
# switch.psu.input_on_command M80 #
# switch.psu.input_off_command M81 #
# switch.psu.output_pin 2.13o! # open drain, inverted




# Pause button
pause_button_enable true #

# Panel See http://smoothieware.org/panel" onclick="window.open(this.href);return false;
panel.enable true # set to true to enable the panel code

# Example viki2 config for an azteeg miniV2 with IDC cable
panel.lcd viki2 # set type of panel
panel.spi_channel 0 # set spi channel to use P0_18,P0_15 MOSI,SCLK
panel.spi_cs_pin 0.16 # set spi chip select
panel.encoder_a_pin 3.25!^ # encoder pin
panel.encoder_b_pin 3.26!^ # encoder pin
panel.click_button_pin 2.11!^ # click button
panel.a0_pin 2.6 # st7565 needs an a0
#panel.contrast 8 # override contrast setting (default is 9)
#panel.encoder_resolution 4 # override number of clicks to move 1 item (default is 4)
#panel.button_pause_pin 1.22^ # kill/pause set one of these for the auxilliary button on viki2
#panel.back_button_pin 1.22!^ # back button recommended to use this on EXP1
panel.buzz_pin 0.25 # pin for buzzer on EXP2
panel.red_led_pin 2.8 # pin for red led on viki2 on EXP1
panel.blue_led_pin 4.29 # pin for blue led on viki2 on EXP1
panel.external_sd true # set to true if there is an extrernal sdcard on the panel
panel.external_sd.spi_channel 0 # set spi channel the sdcard is on
panel.external_sd.spi_cs_pin 1.23 # set spi chip select for the sdcard
panel.external_sd.sdcd_pin 1.31!^ # sd detect signal (set to nc if no sdcard detect)
panel.menu_offset 1 # some panels will need 1 here

# Example mini viki2 config
#panel.lcd mini_viki2 # set type of panel
#panel.spi_channel 0 # set spi channel to use P0_18,P0_15 MOSI,SCLK
#panel.spi_cs_pin 0.16 # set spi chip select
#panel.encoder_a_pin 3.25!^ # encoder pin
#panel.encoder_b_pin 3.26!^ # encoder pin
#panel.click_button_pin 2.11!^ # click button
#panel.a0_pin 2.6 # st7565 needs an a0
##panel.contrast 18 # override contrast setting (default is 18)
##panel.encoder_resolution 2 # override number of clicks to move 1 item (default is 2)
#panel.menu_offset 1 # here controls how sensitive the menu is. some panels will need 1

panel.alpha_jog_feedrate 6000 # x jogging feedrate in mm/min
panel.beta_jog_feedrate 6000 # y jogging feedrate in mm/min
panel.gamma_jog_feedrate 200 # z jogging feedrate in mm/min

panel.hotend_temperature 185 # temp to set hotend when preheat is selected
panel.bed_temperature 60 # temp to set bed when preheat is selected



# Azteeg specific settings - do not change!
# ---------------------------------------------------------------------
currentcontrol_module_enable true #
digipot_max_current 2.4 # max current
digipot_factor 106.0 # factor for converting current to digipot value
return_error_on_unhandled_gcode false #


# Pause button
# ---------------------------------------------------------------------
pause_button_enable true #


# Serial communications configuration ( baud rate default to 9600 if undefined )
# ---------------------------------------------------------------------
uart0.baud_rate 115200 # Baud rate for the default hardware serial port
second_usb_serial_enable false # This enables a second usb serial port (to have both pronterface and a terminal connected)


# Laser module configuration
# ---------------------------------------------------------------------
laser_module_enable false # Whether to activate the laser module at all. All configuration is ignored if false.
#laser_module_pin 2.7 # this pin will be PWMed to control the laser
#laser_module_max_power 0.8 # this is the maximum duty cycle that will be applied to the laser
#laser_module_tickle_power 0.0 # this duty cycle will be used for travel moves to keep the laser active without actually burning


# Switch module for spindle control
# ---------------------------------------------------------------------
#switch.spindle.enable false #


# Miscellaneous
# ---------------------------------------------------------------------
dfu_enable true # for linux developers, set to true to enable DFU
msd_disable false # speeds up booting, but you can't mount the SD card over USB
Max 2
xyz DaVinci 1.0 with custom FW for Repetier-Host
Future plans
NextEngine scanner
Droplite or other SLA
User avatar
[email protected]
Printmaster!
Posts: 39
Joined: Mon Sep 15, 2014 1:58 pm
Location: Belvidere IL

Re: Heuristic (AI) calibration for delta printers on Smoothi

Post by [email protected] »

I attached file also.
Attachments
config.txt
as running right now
(22.07 KiB) Downloaded 520 times
Max 2
xyz DaVinci 1.0 with custom FW for Repetier-Host
Future plans
NextEngine scanner
Droplite or other SLA
Post Reply

Return to “Smoothieboard and variants”