GUS Math

GUS Math

Postby Viproz » Wed Dec 03, 2014 5:33 pm

Hello,

With the addition of the Simpson solution to Smoothie I've been trying to do the math of Simpson and I don't understand what we're using in the processor come from

From what I can understand we have the three spheres formed by the tree arms :
r1²=(x-P1x)²+(y-P1y)²+(z+P1z)²
r2²=(x-P2x)²+(y-P2y)²+(z+P2z)²
r3²=(x-P3x)²+(y-P3y)²+(z+P3z)²

where rI is the extension of the arm (the part that will change to move the head), PIx the x coord of the point of the base of the arm and so on for y and z.

With the (0; 0; 0) in the center of the bed we have :
P1(-r*sin(60);-r*cos(60);P1z)
P2(r*sin(60);-r*cos(60);P2z)
P3(0;r;P3z)

PIz is just a calibrated value

From there I really don't see where this is coming from :
d=SIZE*1.0
i=SIZE/2.0
j=SIZE*math.sqrt(3)/2.0
x=(r1*r1-r2*r2+d*d)/(2*d)
y=(r1*r1-r3*r3-x*x+(x-i)**2+j*j)/(2*j)
z=math.sqrt(r1*r1-x*x-y*y)

It looks like it's coming from http://en.wikipedia.org/wiki/Trilateration but here we don't have an axis that goes through two of the sphere center

What am I missing ?
Viproz
 
Posts: 25
Joined: Tue Jun 10, 2014 5:00 pm

Re: GUS Math

Postby Nicholas Seward » Wed Dec 03, 2014 6:38 pm

The trick is that you put one shoulder at (0,0) and another at (size,0). This makes the math much much easier. Once you find x,y,z in this coordinate system, you can translate the x and the y so (0,0,0) will be in the center of the bed. If I remember right, I used that method to calibrate using the z height so the x and y coordinates could be thrown away.
Nicholas Seward
 
Posts: 738
Joined: Mon Nov 25, 2013 10:41 pm

Re: GUS Math

Postby Viproz » Fri Dec 05, 2014 5:06 pm

Thanks for the reply,

With the x at the bottom it's indeed a lot better but I still don't get why we could do without the calibrated z values in there, I have :

r1²=x²+y²+z²
r2²=(x-r*sqrt(3))²+y²+(z-z2)²
r3²=(x-r*sqrt(3)/2)²+(y-r*sqrt(3)/2)²+(z-z3)²

(we place the 0 of the z axis to z1 for simplicity)

I've got something really bad once I finished the math with that :
z=
completeformula.png
completeformula.png (11.78 KiB) Viewed 11481 times

and without the stuff that we could pre-calculate :
z=
withoutconst.png
withoutconst.png (6.97 KiB) Viewed 11481 times


Am I still missing something or do we need to approximate to have less operation to do ?

PS : some of the math might be wrong, I had to switch between using geogebra and doing stuff by hand because my computer/the software isn't powerful enough
Viproz
 
Posts: 25
Joined: Tue Jun 10, 2014 5:00 pm

Re: GUS Math

Postby Nicholas Seward » Fri Dec 05, 2014 5:50 pm

We are using this to do different things so you will have to include items I excluded. I assumed z2 and z3 are 0 so I could use touch points to solve for the max_r's among other things..
Nicholas Seward
 
Posts: 738
Joined: Mon Nov 25, 2013 10:41 pm


Return to GUS Simpson

Who is online

Users browsing this forum: No registered users and 2 guests

cron