Idea for calibrating wally / lisa / gus

If you have a question or a comment that doesn't fit anywhere then start a topic here. As we get this forum up and running we will be adding more categories and liberally moving topics to the appropriate place.

Idea for calibrating wally / lisa / gus

Postby Dejay » Fri Jul 25, 2014 6:57 am

I've just read that wally is somewhat orphaned because of problems calibrating the XY, and thought that sounds really sad. Maybe this might be an idea for a solution:

I'm still working on calibrating my kossel mini. Because I'm mechanically very lazy I rather prefer writing code to auto calibrate it instead of adjusting parameters iteratively (although I seem to enjoy posting about ideas even more than actually implementing them). So the idea is to use the inverse kinematic formula for a printer and correlate physical positions with the position of the stepper motors relative to the homing position. For a delta printer (or lisa) this should work very nice, simply probe 13 points on your print bed, throw in the stepper motor positions and use non linear programming / numerical optimization to find the unknown variables.

Someone else had this idea first and implemented this in a maxima worksheet (algebraic math package). It's all explained in the worksheet.
https://github.com/hercek/Marlin/blob/M ... ration.wxm
I simply ported it to c using an LBFGS library (I really don't have a clue how it works lol)
https://github.com/DejayRezme/DeltaAutoCalibration

The formula for delta inverse kinematic on Z=0 is this:
Code: Select all
A : (x-xa)^2 + (y-ya)^2 + (ta+α)^2 - r^2 = 0 $
B : (x-xb)^2 + (y-yb)^2 + (tb+β)^2 - r^2 = 0 $
C : (x-xc)^2 + (y-yc)^2 + (tc+γ)^2 - r^2 = 0 $

If you eliminate x and y you can use that as an error function (sum over multiple probed points), that should be 0 if your rod length and delta radius is correct (please refer to the maxima worksheet comments). So if you plug in the wrong parameters into the error function it doesn't resolve to 0 for all points but you can use the derivative of the function to see in which direction you have to tweak the parameters to minimize / reduce the error. The LBFGS algorithm does that for you. It runs very fast on a PC. For delta this is especially nice because you only need to use a Z probe and sample enough points and you can calibrate all three axis dimensionally correct.

For wally, you'd first have to use different formula and create a different error function of course.
Also you'd probably have to print or draw cubes at various positions and measure the width / depth at different positions. The simplest math case would be to use a pen to draw an X/Y print with approximate values, measure the X/Y positions of the cross sections (they should be warped) and throw them into the error function. I don't know the formulas or how to set it up exactly.

Maybe this is a nice math homework for Nicholas students? :twisted:

I'm pretty sure this will work for deltas / lisa / gus (but not 100% sure), it might not be mathematically feasible for polar / scara arms. I'm not really that good at math, just wanted to share the general idea :)

PS: For windows, best use the version of the maxima worksheet in my repo because the original has problems loading with character encodings for α,β,γ
Last edited by Dejay on Fri Jul 25, 2014 7:04 am, edited 1 time in total.
Dejay
 
Posts: 11
Joined: Tue May 27, 2014 1:34 am

Re: Idea for calibrating wally / lisa / gus

Postby Nicholas Seward » Fri Jul 25, 2014 7:03 am

This is "easy" for a Rostock because it is only a 2D problem in the end. For Wally and GUS, you have to do it in 3D. However, I have done essentially what you have lined out for GUS with limited success. What we need is cheap micron level position transducers.
Nicholas Seward
 
Posts: 738
Joined: Mon Nov 25, 2013 10:41 pm

Re: Idea for calibrating wally / lisa / gus

Postby Dejay » Fri Jul 25, 2014 7:34 am

Oh ok I see now in segmentize you use leastsq to get optimal values!
https://github.com/NicholasSeward/Conce ... mentize.py

The only thing that might be relevant is that I found if you only use 7 points there exist multiple solutions (at least if the points sampled are concentric), while with more points there is only one global minima. In the c code I repeat running the algorithm with multiple randomized parameters, it sometimes converges to a local minima, sometimes doesn't converge at all. But with repeating it is easy to find the global minima. Maybe it is similar for gus.

I'm not sure what you mean with 2D vs 3D, since you probe at Z=0 it only looks 2D?

Cheers,
Dejay
Dejay
 
Posts: 11
Joined: Tue May 27, 2014 1:34 am

Re: Idea for calibrating wally / lisa / gus

Postby Nicholas Seward » Fri Jul 25, 2014 7:57 am

GUS does only use touch points. We can get away with that because the system is more defined by those touch points than Wally points are.
Nicholas Seward
 
Posts: 738
Joined: Mon Nov 25, 2013 10:41 pm

Re: Idea for calibrating wally / lisa / gus

Postby Feign » Mon Jul 28, 2014 2:18 pm

From what I understand, the Wally calibration assumed that changing the length of Arm A would not change the length of Arm B. But mechanically it does, and in a non-contant way.

If the Wally arm motors were fixed to the arms rather than the base (the way the GUS motors are fixed to their respective arms) then the assumption would be correct and the Wally firmware woudl be able to work on some simple trig.

But they aren't, so it isn't, so it doesn't. :|
Feign
 
Posts: 18
Joined: Mon Jun 16, 2014 8:26 pm


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests