Welcome! Log In Create A New Profile

Advanced

Simplifying equations - Help required

Posted by martinprice2004 
Simplifying equations - Help required
December 15, 2010 02:19PM
Its been years since I did any complex transformation of formulae. Could someone help.

Is there a way to simplify the following formulas , preferably to remove some of the square or square roots?
They are transforms for my delta robot.

For non programmers
pow(x,2) is x squared
sqrt(x) is the square root of x
0.866025 is my approximation of Sin 60 if that helps.

T1 = sqrt(pow(F,2) - pow(sqrt(pow((J * -0.8660254) - (x - (V * 0.8660254)),2) + pow((J * -0.5) - (y + (V * -0.5)),2)),2)) + z;

T2 = sqrt(pow(F,2) - pow(sqrt(pow((J * 0.8660254) - (x + (V * 0.8660254)),2) + pow((J * -0.5) - (y + (V * -0.5)),2)),2)) + z;

T3 = sqrt(pow(F,2) - pow(sqrt(pow(0 - (x),2) + pow(J - (y + V),2)),2)) + z;


I'm offering a pure maths degree from the University of Delta Robot for the first correct answer!

Edited 3 time(s). Last edit at 12/15/2010 02:24PM by martinprice2004.
Re: Simplifying equations - Help required
December 15, 2010 05:18PM
As a first look, it seems that in the middle segment of each equation, you have a squared square root.

eg: pow(sqrt( _____ pow((J * -0.8660254) - (x - (V * 0.8660254)),2) + pow((J * -0.5) - (y + (V * -0.5)),2) _____ ),2)

You should be able to eliminate that straight away.

PS: Closing bracket indicators in text editors are your friends here.

Q's:

Is that actually 0.5 in these formulas, or is it a pre-generated value of something say like sin(30) ??

Do you need to generate T1 thru T3 for the same set of values? There's quite a bit of commonality between them, so you could probably break them down into common parts and substitute here and there.

Edited 1 time(s). Last edit at 12/15/2010 05:20PM by Cefiar.
Re: Simplifying equations - Help required
December 16, 2010 04:04AM
I think that this is precisely why it would be better to transfer details regarding step timing to the controller rather than coordinates as is done with the current g-code implementation. Then you could do all of this heavy lifting maths in your PC and just come up with some curve-fitted approximations to the desired step timing sequence. The controller could then implement the step timing synchronously and I think that would result in better, more consistent quality prints with less blobs and warts.
Re: Simplifying equations - Help required
December 16, 2010 05:12AM
0.5 is sin 30 in these equations

I'm trying to do all the calculations in an arduino mega firmware, that way I can use off the shelf PC G Code software to drive the robot.

Is there any stuff on the net how to calculate the curve fits for these equations?
Re: Simplifying equations - Help required
December 16, 2010 06:14AM
I had a feeling that was the case (re: sin 30).

I'll take a further look at it tomorrow and see if I can come up with anything.

BTW: One of the reasons for asking is that some combinations of sin/cos formulas can be transformed into other combinations, which might be easier for you to calculate.

Do you ever see that angle (60 in one, 30 in the other) changing?
Re: Simplifying equations - Help required
December 16, 2010 07:16AM
It is unlikely the angles will change as my design is triangular, so the angles between the towers are 120 degrees.

If you want to take a look at the design go to the link below and also a video on youtube of it working. I'm just tidying up the firmware, hence the drive to simplify the equations.

Helium Frog Website

There is also an excel spreadsheet which performs the calculations

Excel document
Sorry, only registered users may post in this forum.

Click here to login