Heuristic (AI) calibration for delta printers on Smoothie

FRANCO888999
Plasticator
Posts: 8
Joined: Tue May 26, 2015 4:26 am

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

Post by FRANCO888999 »

626Pilot wrote:OK! New version: https://github.com/626Pilot/Smoothieware
Precompiled version: https://github.com/626Pilot/Smoothiewar ... rmware.bin

Changes:
  • Annealing order randomizer was not useful, so it has been removed.
  • 2D memory allocation bug fixed, but not deallocation.
  • Grid size increased to 7x7.
  • Test point calculation routine fixed to work with 7x7 grid.
  • Simulated depth output removed - it's not useful unless you're me anyway.
  • Simulated annealing automatically re-probes after it finishes annealing, so that you can see what REALLY happened.
  • If you ask for something that requires bed probing, and the geometry hasn't been changed since the last probe, the last values will be used rather than pointlessly re-probing the surface.
My probe is kaput. I am done with Hall-O stuff. I am going to get a microswitch instead. The upshot of this is that I haven't tested it as much as I wanted to, but I think it's good to go. Please test and let me know if anything is amiss.

Thanks!
Hi,

I only want to say thankyou , just tested and it really work very well , Also the new workflow it 's very usefull and help to speed up the calibration process and help to not commit error.

Great job!
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

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

Post by 626Pilot »

OK, I just pushed another update. This brings my branch of Smoothie up to date with the upstream (main) version. The most interesting improvement is the addition of support for a filament detector.

Changes made to the calibration system:
  • Updated the README with new (hopefully better) instructions.
  • Probe priming has been modified so that it's done at all points. Before, it would only do it on the first point, leaving all the other points to go without that benefit. If you use priming, this WILL make probing take a lot longer! Probe priming and smoothing should only be used if the G29 calibration produces better results with them - see the README for updated instructions.
  • Altered G31 A so that it re-probes the surface, even if you just got done with the annealing calibration. This is because you may wish to anneal with the heated bed off, and then depth-map with the heated bed at whatever temp you like to print at. G31 A also tests your depth-mapping calibration for you, so you don't have to run G31 Z afterwards.
  • FirmwareBin/firmware.bin updated to the newest version.
Source: https://github.com/626Pilot/Smoothieware
Firmware download: https://github.com/626Pilot/Smoothiewar ... rmware.bin
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

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

Post by 626Pilot »

Another update - found a bug that made G31 A upwards-crash the carriages. If you downloaded the firmware between my last post and now, you'll want to get the newer version!
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

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

Post by 626Pilot »

Aaaaaand, another update...
  • Reverted Z correction code to not forcing a re-probe - you can use 'F' if you want to do that.
  • Depths are now printed out line-by-line as they are probed, rather than waiting until the end to print the whole thing at once.
Source: https://github.com/626Pilot/Smoothieware
Firmware download: https://github.com/626Pilot/Smoothiewar ... rmware.bin

I also updated the README with advice about using F with G31, and also some info about what to do if you have a heated bed. My recommendation is to try running the simulated annealing with the bed hot, and again with it cold, to see which gives you the better result. This is because the glass may become more or less warped as it thermally expands, is pressed into by the Onyx as it warps when hot (which it DOES), fighting against the binder clips, etc... ;)

When you are done with that, you want to turn the heated bed back ON, wait for the temp to STABILIZE FULLY, and THEN run G31 AF. If you don't have bed heat, you can just run G31 A.

Also, I figured out something cool!

The G31 OPQRS (simulated annealing) command takes some extra arguments. You can see them all by typing G31 by itself. One of the args is max temp. By default, this is 0.35. I discovered that if I drop that number, at least on my printer, I can get a slightly better calibration! Try these:

Code: Select all

G31 OPQRS U0.3
G31 OPQRS U0.1
G31 OPQRS U0.05
G31 OPQRS U0.01
You can also try altering the binary search width:

Code: Select all

G31 OPQRS V0.15
G31 OPQRS V0.05
G31 OPQRS V0.01
Lower values will make it take longer, but it might be able to find a slightly more precise calibration.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

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

Post by 626Pilot »

I think I may have found a way to make the annealing process run significantly faster.

The annealer runs many tests, always trying to answer the same question: Should this value be increased, or decreased? In order to figure that out, it tries to find the optimum value for a variable by performing a binary search. That means it starts with a solution space (let's say, arm length is 269mm for Trick Laser arms, and we're willing to search +-3mm, so we'll search 266-272mm.) It tests the top and bottom of that range. If the top of the range is better, the bottom is increased by a little (the binary search width). If the bottom of the range is better, the top is decreased by a little. So, it collapses the search space piece by piece until it has "shrunk" around the optimal value.

Here's the thing: It keeps trying to collapse the search space, even after the search space has been collapsed to a point where it's OUTSIDE the maximum amount the variable can be moved. Let's say the arm length is 269, it's searching the range 270 to 270.5 - but according to the annealing temperature, that variable's value can't be changed by more than 0.2 for this iteration. The BOTTOM of the range is 270, far exceeding the maximum amount the variable can be changed. At this point, whether the optimal value is 270.13 or 270.36 is irrelevant because we can't go that far anyway!

I think the way to speed it up is to implement a check: If the search range starts further from the variable than it can possibly be moved this iteration, pick the closer of the range min and max, and use that as the optimal value.

Another optimization to try would be performing a coarse search, and then progressively refining it. The search space could be divided into some small number of segments. For the arm length example, that would mean testing at 266, 272, and some number of points between (say, five). The two adjacent points with the lowest (best) energy score become the new range. Then, we divide that space into five points, simulate them, find the best two, etc., getting smaller and smaller segments until we have bracketed the optimal value. Again, this would stop searching if the range got outside the maximum amount we can move the variable.

If these ideas work, simulated annealing could get a LOT faster. I'm not sure, but it could yield a 2x speed improvement. Maybe more.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

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

Post by 626Pilot »

I was right!!! :D

Simulated annealing is now... I don't know... 30 times faster? :) It now takes under 10 seconds to anneal the variables. You still have to wait ages for it to probe the bed, but now you don't have to wait 1-2 minutes for it to do the calculations!!!

Additionally, you don't have to use G31 AF - you can just use G31 A. The depth probing routine keeps track of bed temp and target temp between probings. If you run G31 OPQRS at room temperature with the heater off, and then G31 A after turning on the heater, it will know to re-probe the bed. Also, if you try to do this when the heater is on - but the temp is more than a degree off from target - it will tell you to wait until the temperature stabilizes, and then try again. Automating that was fun!

Source: https://github.com/626Pilot/Smoothieware
Firmware download: https://github.com/626Pilot/Smoothiewar ... rmware.bin
FRANCO888999
Plasticator
Posts: 8
Joined: Tue May 26, 2015 4:26 am

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

Post by FRANCO888999 »

626Pilot wrote:I was right!!! :D

Simulated annealing is now... I don't know... 30 times faster? :) It now takes under 10 seconds to anneal the variables. You still have to wait ages for it to probe the bed, but now you don't have to wait 1-2 minutes for it to do the calculations!!!

Additionally, you don't have to use G31 AF - you can just use G31 A. The depth probing routine keeps track of bed temp and target temp between probings. If you run G31 OPQRS at room temperature with the heater off, and then G31 A after turning on the heater, it will know to re-probe the bed. Also, if you try to do this when the heater is on - but the temp is more than a degree off from target - it will tell you to wait until the temperature stabilizes, and then try again. Automating that was fun!

Source: https://github.com/626Pilot/Smoothieware
Firmware download: https://github.com/626Pilot/Smoothiewar ... rmware.bin
Hi,

Great news I'm impressed on how fast you made this upgrade!
Can I ask if will be possible to implement a 9x9 matrix?
I ask because with the 7x7 I got a great leap forward and maybe with a bigger matrix and with just made better and faster routine.....

Thank you
User avatar
gestalt73
Printmaster!
Posts: 339
Joined: Wed Aug 07, 2013 11:10 am
Location: Anaheim, CA

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

Post by gestalt73 »

Holy smokes 626Pilot, that sounds amazing!

I'll give it a spin this morning between prints.

Alan
User avatar
gestalt73
Printmaster!
Posts: 339
Joined: Wed Aug 07, 2013 11:10 am
Location: Anaheim, CA

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

Post by gestalt73 »

Hey 626Pilot, fantastic work on the calibration changes.

Best energy yet, at 0.010.

The results below are from a *Full Bed* calibration with a diameter of 270mm.

What this means for those of you seeing this thread for the first time is that the measured delta between the highest and lowest point on my bed are now *50 MICRONS* across the complete bed area.

So 0.2mm layer height full bed prints are absolutely no problem now.

And 0.1mm layer height prints across the full be should be possible, although I still recommend a first layer height of 0.15mm or 0.2mm for those types of prints.

Outstanding!

Seems like the order is
G29
G32
G31 OPQRS
G32 A
G31 Z

Code: Select all

[PD]                                   -0.020
[PD]
[PD] [  --  ]    -0.020     -0.015      0.000      0.005     -0.005    [  --  ]
[PD]
[PD] [  --  ]    -0.020      0.000     -0.010      0.005     -0.005    [  --  ]
[PD]
[PD]  -0.010     -0.005     -0.010      0.000     -0.005      0.000      0.025
[PD]
[PD] [  --  ]    -0.010     -0.005     -0.020      0.020      0.010    [  --  ]
[PD]
[PD] [  --  ]    -0.005     -0.005     -0.010      0.020      0.000    [  --  ]
[PD]
[PD]                                   -0.025
[PD]
[PD] Best=0.000, worst=0.025, min=-0.025, max=0.025, mu=-0.002, sigma=0.009, energy=0.010
bot
Printmaster!
Posts: 988
Joined: Thu Sep 25, 2014 12:18 am
Location: Vancouver
Contact:

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

Post by bot »

That's impressive. Can you do one of those full bed prints at .2mm to show us what it's like? Possibly one that extends beyond just one layer, like maybe at least 50mm in Z?
*not actually a robot
User avatar
gestalt73
Printmaster!
Posts: 339
Joined: Wed Aug 07, 2013 11:10 am
Location: Anaheim, CA

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

Post by gestalt73 »

Hey 626Pilot,

A couple of things...

The heated bed temp stabilization sounds like a great idea, but seems to get in the way more than it helps.
It looks like it will abort if your bed temp is +/- 0.5c, which I'm not sure that I'd be as concerned about. Maybe if we could pass a switch to ignore bed temp stabilization, or increase the allowable range a bit?

Twice today while working with through the G31 OPQRS step, the board has hard locked, and turned off heat to both the bed and hotend.
Both times it's occurred during probing of the third row.
After I pull power and reset it is successful on the next try.

This is with a build of the firmware pulled from git this morning.

UPDATE: I am able to get through all the steps if I reset the Smoothie after each step. I do have the GLCD enabled.
Whatever this glitch is, I didn't see in in the build I grabbed from 06/09.

UPDATE 2: Ok, so here's something interesting, and I remember it happening on previous builds as well. I get to this point where it hardlocks or hardresets during the SA step, and the solution is to reformat the MicroSD card and copy the contents back onto it. After I did it for your most recent build, every step worked flawlessly. Very interesting.


Thanks!
User avatar
KAS
ULTIMATE 3D JEDI
Posts: 1157
Joined: Thu Dec 04, 2014 6:06 pm

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

Post by KAS »

I just ported over to smoothie on the v2 and now working on the calibration. It's appears that I am locking up during the G31 OPQRS procedure. This is what I get when I run the calibration steps in order.

G29

RECEIVED: [BH] Bed height set to 384.370
RECEIVED: [PR] Test 1 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Test 2 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Test 3 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Test 4 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Test 5 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Test 6 of 10: Measured 750 steps (3.750 mm)
RECEIVED: [PR] Test 7 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Test 8 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Test 9 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Test 10 of 10: Measured 749 steps (3.745 mm)
RECEIVED: [PR] Stats:
RECEIVED: [PR] range: 1 steps (0.0050 mm)
RECEIVED: [PR] mu: 749.100 steps (3.745 mm)
RECEIVED: [PR] sigma: 0.300 steps (0.001 mm)
RECEIVED: [PR] Repeatability: 0.0050 (add a little to be sure)
RECEIVED: [PR] This is your best score so far!
RECEIVED: [PR] This score is very good!


G32

RECEIVED: [ES] Endstops: Difference => 0.630 (want 0.030), out of tolerance by 0.600.
RECEIVED: [ES] Setting endstops to {-0.117, 0.000, -0.819}.
RECEIVED: [DR] Delta Radius - Depths: Center=3.910, Tower average=3.960 => Difference: -0.050 (want 0.030), out of tolerance by -0.080.
RECEIVED: [DR] Changing delta radius from 133.966 to 133.866
RECEIVED:
RECEIVED: [IC] Iteration 2 (max 20)
RECEIVED: [ES] Endstops: Difference => 0.075 (want 0.030), out of tolerance by 0.045.
RECEIVED: [ES] Setting endstops to {-0.117, 0.000, -0.721}.
RECEIVED: [DR] Delta Radius - Depths: Center=3.640, Tower average=3.620 => Difference: 0.020 (want 0.030), within tolerance.
RECEIVED:
RECEIVED: [IC] Iteration 3 (max 20)
RECEIVED: [ES] Endstops: Difference => 0.030 (want 0.030)
RECEIVED: [ES] Endstops are within tolerance.
RECEIVED: [DR] Delta Radius - Depths: Center=3.670, Tower average=3.658 => Difference: 0.012 (want 0.030), within tolerance.
RECEIVED:
RECEIVED: [PK] Current kinematic settings:
RECEIVED: [PK] Arm length: 269.000
RECEIVED: [PK] Delta radius: 133.866
RECEIVED: [PK] Endstop offsets: {-0.117, 0.000, -0.721}
RECEIVED: [PK] Radius offsets (ABC): {0.000, 0.000, 0.000}
RECEIVED: [PK] Angle offsets (DEF): {0.000, 0.000, 0.000}
RECEIVED: [PK] Virtual shimming: {0.000, 0.000, 0.000}, vector={0.000, 0.000, 1.000}, d=0.000, Disabled
RECEIVED: [PK] Depth (Z) correction: Disabled
RECEIVED:
RECEIVED: [IC] All done! Save settings with M500.

G31 OPQRS

RECEIVED: [PD] 0.115
RECEIVED: [PD]
RECEIVED: [PD] [ -- ] -0.310 -0.135 -0.025 0.050 0.145 [ -- ]
RECEIVED: [PD]
RECEIVED: [PD] [ -- ] -0.200 -0.040 -0.010 0.040 0.005 [ -- ]
RECEIVED: [PD]
RECEIVED: [PD] -0.160 -0.155 -0.040 0.000 0.005 0.005 -0.025
RECEIVED: [PD]
RECEIVED: [PD] [ -- ] -0.050 -0.065 -0.015 -0.020 -0.010 [ -- ]
RECEIVED: [PD]
RECEIVED: [PD] [ -- ] -0.045 -0.070 -0.030 -0.015 0.000 [ -- ]


Then the board appears to lockup requiring to full reset to get it working again.
User avatar
gestalt73
Printmaster!
Posts: 339
Joined: Wed Aug 07, 2013 11:10 am
Location: Anaheim, CA

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

Post by gestalt73 »

Hey KAS,

I've been running into a similar issue, not sure if it was something that was reintroduced since the 6/9 code update, or if it's been there all along.

(You can do this by either pulling the sd card or performing these steps when connected via usb)
- copy all your files off the sd card
- reformat the card
- copy all the files back
- reboot

I suspect there's some weirdness between the sdcard code and the new SA code, maybe where it reads/writes config_override or dt_transform?

I've had multiple consecutive hard resets in a row when using the calibration code, then the first time I reformat the card, everything works perfectly the first time.


Alan
User avatar
KAS
ULTIMATE 3D JEDI
Posts: 1157
Joined: Thu Dec 04, 2014 6:06 pm

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

Post by KAS »

Just tried it after doing what you mentioned with the SD_card. It stopped after the 3rd probe on G31 OPQRS. Seems very random when it decides to halt. I've yet to finish the complete calibration.
User avatar
gestalt73
Printmaster!
Posts: 339
Joined: Wed Aug 07, 2013 11:10 am
Location: Anaheim, CA

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

Post by gestalt73 »

Hey KAS,

That is interesting. Out of curiosity, what optional modules do you have enabled?

I've been able to run it with GLCD enabled, but haven't tried enabling ethernet or webserver.

I wonder if disabling things like ethernet, webserver, glcd would result in a successful calibration, and provide a clue to 626Pilot about where to look.
User avatar
KAS
ULTIMATE 3D JEDI
Posts: 1157
Joined: Thu Dec 04, 2014 6:06 pm

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

Post by KAS »

Looks like I made it through the entire calibration. Although I only ran each command once.

Code: Select all

RECEIVED: [PD]                                    0.150                                  
RECEIVED: [PD]
RECEIVED: [PD] [ 0.249]    -0.005     -0.095     -0.020      0.005      0.060    [ 0.251]
RECEIVED: [PD]
RECEIVED: [PD] [ 0.049]     0.025     -0.015     -0.030     -0.025     -0.070    [-0.064]
RECEIVED: [PD]
RECEIVED: [PD]   0.115     -0.065     -0.060      0.000     -0.075     -0.095     -0.090 
RECEIVED: [PD]
RECEIVED: [PD] [ 0.087]     0.045     -0.080     -0.050     -0.070     -0.040    [-0.004]
RECEIVED: [PD]
RECEIVED: [PD] [ 0.198]     0.050     -0.080     -0.025      0.000      0.070    [ 0.197]
RECEIVED: [PD]
RECEIVED: [PD]                                    0.125                                  
RECEIVED: [PD]
RECEIVED: [PD] Best=0.000, worst=0.251, min=-0.095, max=0.251, mu=0.013, sigma=0.084, energy=0.058
User avatar
KAS
ULTIMATE 3D JEDI
Posts: 1157
Joined: Thu Dec 04, 2014 6:06 pm

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

Post by KAS »

gestalt73 wrote:Hey KAS,

That is interesting. Out of curiosity, what optional modules do you have enabled?

I've been able to run it with GLCD enabled, but haven't tried enabling ethernet or webserver.

I wonder if disabling things like ethernet, webserver, glcd would result in a successful calibration, and provide a clue to 626Pilot about where to look.
Modules? That's a good question. I'll post my config, I literally just finished the smoothieboard install last night. I'm using the trick trucks with arms, also 400 step motors on 16 tooth pulleys. I printed a 10mm test cube that measured just about perfect, but I haven't tried a full circle print yet.

Code: Select all

# 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                                    384


# Delta Geometry
# ---------------------------------------------------------------------
# arm_radius is DELTA_RADIUS in Repetier
# DELTA_RADIUS = PRINTER_RADIUS - END_EFFECTOR_HORIZONTAL_OFFSET - CARRIAGE_HORIZONTAL_OFFSET
#              = 202.25         - 33                             - 38.4
#              = 130.85
# ---------------------------------------------------------------------
arm_solution                                 linear_delta     # default linear_delta, you can also try kossel
arm_radius                                   130.85           # 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                       3                # if your probe has repeatability issues, this will probe multiple times & take the average (default 1)
comprehensive-delta.probe_priming                         1                # if your probe keeps "creeping down", this will run it the specified number of times to get it to settle
comprehensive-delta.probe_acceleration                    90               # 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                        0                #


# Optional Z probe, see http://smoothieware.org/zprobe
# ---------------------------------------------------------------------
probe                                        endstop
probe_pin                                    1.28             # optional pin for probe
zprobe.enable                                true             # set to true to enable a zprobe
zprobe.probe_pin                             1.28!^           # pin probe is attached to if NC remove the !, default 1.29!^
zprobe.slow_feedrate                         3                # mm/sec probe feed rate
zprobe.fast_feedrate                         70               # move feedrate
zprobe.debounce_count                        0                # set if noisy
zprobe.probe_radius                          110              # how far out from bed center to probe
zprobe.probe_height                          4                # how high the probe has to be moved above trigger elevation so that it won't drag
zprobe.decelerate_on_trigger                 false            # beneficial, unless your probe has no runout after it hits the trigger - in which case, set this to false
zprobe.decelerate_runout                     0                # 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                    200              # segments per second used for deltas


# Arm solution configuration : Delta robot. Translates mm positions into stepper positions
# ---------------------------------------------------------------------
alpha_steps_per_mm                           200
beta_steps_per_mm                            200
gamma_steps_per_mm                           200


# 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


# 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_min_endstop                            nc
alpha_max_endstop                            1.25^            #
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_min_endstop                             nc
beta_max_endstop                             1.27^            #
beta_homing_direction                        home_to_max      #
beta_min                                     0                #
beta_max                                     0                #

gamma_min_endstop                            nc
gamma_max_endstop                            1.29^            #
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
minimum_steps_per_minute                     1200             # Never step slower than this
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 )
# ---------------------------------------------------------------------
currentcontrol_module_enable                 true             # Only needed on Smoothieboard

alpha_step_pin                               2.0              # Pin for alpha stepper step signal
alpha_dir_pin                                0.5!             # Pin for alpha stepper direction
alpha_en_pin                                 0.4              # Pin for alpha enable pin
alpha_current                                1.2              # X stepper motor current NOTE - config-override
alpha_max_rate                               30000.0          # mm/min
x_axis_max_speed                             30000.0          # mm/min cartesian max speed

beta_step_pin                                2.1              # Pin for beta stepper step signal
beta_dir_pin                                 0.11             # Pin for beta stepper direction
beta_en_pin                                  0.10             # Pin for beta enable
beta_current                                 1.2              # Y stepper motor current NOTE - config-override
beta_max_rate                                30000.0          # mm/min
y_axis_max_speed                             30000.0          # mm/min

gamma_step_pin                               2.2              # Pin for gamma stepper step signal
gamma_dir_pin                                0.20!            # Pin for gamma stepper direction
gamma_en_pin                                 0.19             # Pin for gamma enable
gamma_current                                1.2              # Z stepper motor current NOTE - config-override
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                        90.81	      #calibrated on a segment of PLA marked with sharpie every 100mm using calipers.
#extruder_steps_per_mm                        92.4  	      #measured to be 101.75mm per 100mm
extruder_default_feed_rate                   600              # Default rate ( mm/minute ) for moves where only the extruder moves
extruder_acceleration                        500              # Acceleration in mm/sec^2 only used for retracts
extruder_max_speed                           50               # mm/sec NOTE only used for retracts

extruder_step_pin                            2.3              # Pin for extruder step signal
extruder_dir_pin                             0.22             # Pin for extruder dir signal
extruder_en_pin                              0.21             # Pin for extruder enable signal
delta_current                                1.0              # Extruder stepper motor current (Kysan NEMA17s are rated 1.2A) NOTE - config-override


# 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.23             # Pin for the thermistor to read
temperature_control.hotend.heater_pin        2.7              # Pin that controls the heater
temperature_control.hotend.thermistor        Semitec          # see http://smoothieware.org/temperaturecontrol#toc5
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                #


# Hotend PID configuration
# ---------------------------------------------------------------------
temperature_control.hotend.p_factor          65.4
temperature_control.hotend.i_factor          4.635
temperature_control.hotend.d_factor          230


# 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.24             #
temperature_control.bed.heater_pin           2.5              #
temperature_control.bed.beta                 3974             #
temperature_control.bed.thermistor           Honeywell100K    # 
temperature_control.bed.set_m_code           140              #
temperature_control.bed.set_and_wait_m_code  190              #
temperature_control.bed.designator           B                #

# 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


# Bed PID configuration
# ---------------------------------------------------------------------
temperature_control.bed.p_factor             1500.9
temperature_control.bed.i_factor             326.286
temperature_control.bed.d_factor             1726


# 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.6              #
switch.fan.output_type                       pwm              #

# Automatically toggle a switch at a specified temperature
# (ueful to turn on a fan or water pump to cool the hotend)
# ---------------------------------------------------------------------
# automatically toggle a switch at a specified temperature
# useful to turn on a fan or water pump to cool the hotend
temperatureswitch.hotend.enable                 true             # enable this module
temperatureswitch.hotend.switch                 fan2             # select which MOSFET to use, must match a switch configuration (fan2 below)
temperatureswitch.hotend.designator             T                # first character of the temperature control designator to use as the temperature sensor to monitor
temperatureswitch.hotend.threshold_temp         60.0             # temperature to turn on (if rising) or off the switch
temperatureswitch.hotend.heatup_poll            15               # poll heatup at 15 sec intervals
temperatureswitch.hotend.cooldown_poll          60               # poll cooldown at 60 sec intervals

switch.fan2.enable                              true             # enable
switch.fan2.input_on_command                    M42              # gcode to turn on
switch.fan2.input_off_command                   M43              # gcode to turn off
switch.fan2.output_pin                          2.4              # pin that controls the fan


# 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


# LCD Panel http://smoothieware.org/panel
# ---------------------------------------------------------------------
panel.enable                                true             # set to true to enable the panel code
panel.lcd                                   reprap_discount_glcd     
panel.spi_channel                           0                 # spi channel to use  ; GLCD EXP1 Pins 3,5 (MOSI, SCLK)
panel.spi_cs_pin                            0.16              # spi chip select     ; GLCD EXP1 Pin 4
panel.encoder_a_pin                         3.25!^            # encoder pin         ; GLCD EXP2 Pin 3
panel.encoder_b_pin                         3.26!^            # encoder pin         ; GLCD EXP2 Pin 5
panel.click_button_pin                      1.30!^            # click button        ; GLCD EXP1 Pin 2
panel.buzz_pin                              1.31              # pin for buzzer      ; GLCD EXP1 Pin 1
panel.back_button_pin                       2.11!^            # back button         ; GLCD EXP2 Pin 8

# pins used with other panels
#panel.up_button_pin                         0.1!              # up button if used
#panel.down_button_pin                       0.0!              # down button if used
#panel.click_button_pin                      0.18!             # click button if used

panel.menu_offset                            0                 # some panels will need 1 here

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

# setup for external sd card on the GLCD which uses the onboard sdcard SPI port
panel.external_sd                     true              # set to true if there is an extrernal sdcard on the panel
panel.external_sd.spi_channel         1                 # set spi channel the sdcard is on
panel.external_sd.spi_cs_pin          0.28              # set spi chip select for the sdcard (or any spare pin)
panel.external_sd.sdcd_pin            0.27!^            # sd detect signal (set to nc if no sdcard detect) (or any spare pin)

# Misc
# ---------------------------------------------------------------------
pause_button_enable                          true             #
return_error_on_unhandled_gcode              false            #


# 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                                   false            # 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



# network settings
network.enable                               true             # enable the ethernet network services
network.webserver.enable                     true             # enable the webserver
network.telnet.enable                        true             # enable the telnet server
#network.ip_address                           auto             # use dhcp to get ip address
# uncomment the 3 below to manually setup ip address
network.ip_address                           10.0.0.89        # the IP address
network.ip_mask                              255.255.255.0    # the ip mask
network.ip_gateway                           10.0.0.1         # the gateway address
#network.mac_override                         xx.xx.xx.xx.xx.xx  # override the mac address, only do this if you have a conflict
User avatar
KAS
ULTIMATE 3D JEDI
Posts: 1157
Joined: Thu Dec 04, 2014 6:06 pm

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

Post by KAS »

I think I understand the process better after reading the entire thread a few times. I was skipping the G32 A & G31 Z procedure.


G31 Z

Code: Select all

RECEIVED: [PD]                                    0.010                                  
RECEIVED: [PD]
RECEIVED: [PD] [  --  ]     0.000     -0.010     -0.005     -0.015     -0.005    [  --  ]
RECEIVED: [PD]
RECEIVED: [PD] [  --  ]    -0.010     -0.005     -0.005     -0.015      0.000    [  --  ]
RECEIVED: [PD]
RECEIVED: [PD]   0.000      0.000     -0.005      0.000      0.000      0.005      0.005 
RECEIVED: [PD]
RECEIVED: [PD] [  --  ]     0.000      0.000      0.000      0.000     -0.010    [  --  ]
RECEIVED: [PD]
RECEIVED: [PD] [  --  ]     0.000     -0.020      0.000      0.005      0.000    [  --  ]
RECEIVED: [PD]
RECEIVED: [PD]                                    0.005                                  
RECEIVED: [PD]
RECEIVED: [PD] Best=0.000, worst=0.020, min=-0.020, max=0.010, mu=-0.002, sigma=0.005, energy=0.005
Guess it's time to print something.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

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

Post by 626Pilot »

gestalt73 wrote: The heated bed temp stabilization sounds like a great idea, but seems to get in the way more than it helps.
It looks like it will abort if your bed temp is +/- 0.5c, which I'm not sure that I'd be as concerned about. Maybe if we could pass a switch to ignore bed temp stabilization, or increase the allowable range a bit?
It's set to work like that because it's bad to have the temperature fluctuating when it probes. Due to the thermal mass in a heated bed system, it can take awhile for the PID algorithm to settle down and stop ringing up and down. If the bed temp changes, it WILL cause the measured depths to change, and that will throw noise into the system that you don't want to deal with. Maybe it's a pain, but so is calibrating the probe. It's better to endure that pain once than have a substandard calibration.
Twice today while working with through the G31 OPQRS step, the board has hard locked, and turned off heat to both the bed and hotend.
Both times it's occurred during probing of the third row.
After I pull power and reset it is successful on the next try.

This is with a build of the firmware pulled from git this morning.

UPDATE: I am able to get through all the steps if I reset the Smoothie after each step. I do have the GLCD enabled.
Whatever this glitch is, I didn't see in in the build I grabbed from 06/09.
Better leave the GLCD off, then. It won't help you during calibration anyway.
UPDATE 2: Ok, so here's something interesting, and I remember it happening on previous builds as well. I get to this point where it hardlocks or hardresets during the SA step, and the solution is to reformat the MicroSD card and copy the contents back onto it. After I did it for your most recent build, every step worked flawlessly. Very interesting.
It's a good idea to check the filesystem on the MicroSD card from time to time. The FS implementation on Smoothie is primitive and sometimes unreliable, especially if you mount it as a drive in your OS. The controller has no "resync" according to wolfmanjm, so if you write a file over USB and then tell Smoothie to do a write operation (e.g. run G31 A or M500), it can corrupt files because Smoothie is not paying attention to what the host machine is writing to the card over USB. It thinks there's free space where there isn't.

wolfmanjm's advice is generally to avoid EVER mounting the SD card over USB. My procedure for doing so anyway is to never let Smoothie and the host machine OS write things to the SD card during the same session. If you have mounted the SD card to your computer over USB, do not send M500 or G31 A until you've safely unmounted and reset the Smoothie controller. Likewise, if you type G31 A or send M500 on a clean session, ensure that you reboot the controller BEFORE you mount the card over USB. NEVER, EVER do write operations via Smoothie and from your computer during the same session (without rebooting the controller) or you're going to chew up a file sooner or later. Maybe config, maybe your autolevel information from G31 A, maybe config-override. Whatever gets corrupted, it won't be any fun for you.

Another important thing to remember: if you mount the SD card and save a .gcode file to it, remember to unmount the card before you hit the start button on a print job. Otherwise, your OS may just randomly decide it wants to scan the SD card or check it for something. Even moderate read/write operations to the SD card will hang the Smoothie board until the operation is complete. If you're saving a .gcode file and you send G28, don't be surprised if your printer keeps trying to move the carriages up after they already hit the endstop switches (which, by the way, will fail to cause Smoothie to stop). It will grind your belts and make a horrendous noise.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

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

Post by 626Pilot »

KAS wrote:Modules? That's a good question. I'll post my config, I literally just finished the smoothieboard install last night. I'm using the trick trucks with arms, also 400 step motors on 16 tooth pulleys. I printed a 10mm test cube that measured just about perfect, but I haven't tried a full circle print yet.

Code: Select all

# LCD Panel http://smoothieware.org/panel
# ---------------------------------------------------------------------
panel.enable                                true             # set to true to enable the panel code

...

# network settings
network.enable                               true             # enable the ethernet network services
network.webserver.enable                     true             # enable the webserver
network.telnet.enable                        true             # enable the telnet server
Having the LCD panel, network, web server, and telnet server running will consume extra RAM. For the duration of the calibration, I suggest setting panel.enable and network.enable to false, save, safely unmount the SD card, then reboot the controller.

If you want to check out RAM usage, you can set second_usb_serial_enable to true, save, unmount, reboot. Connect through Repetier as normal, then fire up a serial terminal like minicom or cutecom (or windows terminal or whatever comes with Mac OS) and connect to the second serial port on the board. You can type 'mem' to see how much RAM is available on the three buses. When you're done with that, make sure to set second_usb_serial_enable to false & reboot or else you won't be able to print without that serial terminal connected.
Last edited by 626Pilot on Mon Jun 15, 2015 9:13 pm, edited 1 time in total.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

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

Post by 626Pilot »

FRANCO888999 wrote: Can I ask if will be possible to implement a 9x9 matrix?
I ask because with the 7x7 I got a great leap forward and maybe with a bigger matrix and with just made better and faster routine.....
You can try this, if you want, but you have to recompile. Change 7 to 9 in this line: https://github.com/626Pilot/Smoothiewar ... tegy.h#L32

Doing this will consume significantly more RAM than before. Smoothie has to create several arrays big enough to hold the probing (X, Y) coordinates, measured depths, test carriage positions, etc. Even a "small" change like going from 7x7 to 9x9 could eat a lot of memory - that's another 32 points it has to keep track of, in several arrays - so be careful!
User avatar
KAS
ULTIMATE 3D JEDI
Posts: 1157
Joined: Thu Dec 04, 2014 6:06 pm

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

Post by KAS »

626Pilot wrote:
KAS wrote:Modules? That's a good question. I'll post my config, I literally just finished the smoothieboard install last night. I'm using the trick trucks with arms, also 400 step motors on 16 tooth pulleys. I printed a

If you want to check out RAM usage, you can set second_usb_serial_enable to true, save, unmount, reboot. Connect through Repetier as normal, then fire up a serial terminal like minicom or cutecom (or windows terminal or whatever comes with Mac OS) and connect to the second serial port on the board. You can type 'mem' to see how much RAM is available on the three buses. When you're done with that, make sure to set second_usb_serial_enable to false & reboot or else you won't be able to print without that serial terminal connected.

I'll give that a whirl if it happens again. Seems to be working fine now with everything enabled.
bot
Printmaster!
Posts: 988
Joined: Thu Sep 25, 2014 12:18 am
Location: Vancouver
Contact:

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

Post by bot »

I'm going to be using a smoothie in a new printer I'm making, so I'm really excited to try this out! I bought some limit switches to use as probes. Will that work?
*not actually a robot
User avatar
KAS
ULTIMATE 3D JEDI
Posts: 1157
Joined: Thu Dec 04, 2014 6:06 pm

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

Post by KAS »

I used a repurposed micro switch from a microwave. Repeatably was surprisingly good. I did order a precision switch with an extended arm so I can design a mount that would go directly under the nozzle. But I had that itch to try it out while waiting on the package.
20150616_201045.jpg
User avatar
gestalt73
Printmaster!
Posts: 339
Joined: Wed Aug 07, 2013 11:10 am
Location: Anaheim, CA

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

Post by gestalt73 »

Hey KAS,

What's interesting about that switch is that it is basically the limit switch that we use on the printers, but without the arm.

I've had my suspicions about the flex in the arm and its effect on repeatability. I may remove the arm and see if I get better repeatability with the probe.

Thanks!
Post Reply

Return to “Smoothieboard and variants”