cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

2 Trigonometric function with two unidentified

SOLVED
Highlighted
Regular Member

2 Trigonometric function with two unidentified

Hello guys, I am stuck for two days about an issue. I have to create a solution matrix for the following two trigonometric functions.

m*cos(a)+n*cos(b)=x

m*sin(a)+n*sin(b)=y

 

0<a<180 , 0<b<180

m,n,x,y are constants. a,b are unidentified.

How can I solve x,y as matrix solution?

 

I will trigger x,y values with FRAME, so at each X.i, Y.i values I have to calculate a,b degrees and draw lines.

I am using MathCAD 15.

I would really appreciate your help. Thanks in Advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: 2 Trigonometric function with two unidentified

If you limit Theta2, too (positive in the range from 0 to 180°) you have a unique, single solution.

One way to calculate the angles Theta1 and Theta2 based on the coordinates x,y of the endpoint is shown in the picture below:

B.png

B2.png

View solution in original post

22 REPLIES 22
Highlighted

Re: 2 Trigonometric function with two unidentified

You would like to create an animation if you use the FRAME variable?

Let us create one frame of this animation!

 

Highlighted

Re: 2 Trigonometric function with two unidentified

Thank you for your intention @ValeryOchkov 

 I'll show with sketch in add.

 

There is K.i matrix. It consists nodes that arm going to reach. Arms are should be rectangular boxes. I wrote the translational and rotational matrix. Arms are working perfrectly fine. But it needs target node in order to calculate teta1 and alpha angles.

For example K.1 is (x,y)=(450,600)

It will calculate these angles then will go to K.2=(460,590), later on K.3=(465,582) and so on.

 

I will later make K.i matrix with bezier if I can finish this earlier. It has manual nodes added by me now.

I hope I could explained myself clearly. Thank you!

 

Highlighted

Re: 2 Trigonometric function with two unidentified

May be so

 

Highlighted

Re: 2 Trigonometric function with two unidentified

see please the attach

sincos.gif

Highlighted

Re: 2 Trigonometric function with two unidentified

Thank you really much. I am now trying to understand it. You're the best

Highlighted

Re: 2 Trigonometric function with two unidentified

Hi,

The analytical solution gives me these results:

Solution11.jpg

Highlighted

Re: 2 Trigonometric function with two unidentified

When a function with sin and cos, it's easier to make matrix solution. However in my function, there are only cos or sin one function :(. I have to make a general matrix solution. I am sorry I couldn't understand by your point. What do you suggest me to do exactly. I need this kind of solution below:

Sin-cosSin-cos

Highlighted

Re: 2 Trigonometric function with two unidentified

Solution12.jpg

Highlighted

Re: 2 Trigonometric function with two unidentified

Thank you really but I gave it as an example. The actual functions I ask are in The main post. I know this one...
Highlighted

Re: 2 Trigonometric function with two unidentified

Solution13.jpg

Highlighted

Re: 2 Trigonometric function with two unidentified

Thank you so much, I am trying to figure it out combine with my functions now.


@-MFra- wrote:

Solution13.jpg




Highlighted

Re: 2 Trigonometric function with two unidentified

Your problem normally has two solutions (can be clearly seen in Valerys animation).

So how can you expect a single, linear matrix solution?

Highlighted

Re: 2 Trigonometric function with two unidentified

Thanks Werner! This system of two equations has two solutions - x1-y1 and x2-y2:

sincos.gifsincos.png

 

Highlighted

Re: 2 Trigonometric function with two unidentified

I expected to limit them between 0<teta<180 in order to have one solution.

Highlighted

Re: 2 Trigonometric function with two unidentified

In your original question you limited a and b in the range from 0 to 180 degrees and this would not have guaranteed a single unique solution.

Obviously now you are referring to the drawing you posted later. Theta2 has a different meaning (compared to b). Limiting Theta2 can make the solution unique. Nonetheless its still not a linear problem and so you can't solve it with matrix operations.

 

Highlighted

Re: 2 Trigonometric function with two unidentified

You are right. I'm still ignorant about it. Solutions above are fulfill task. However my point is defining two angle so trigger the system based on those angle. But you're saying it isn't possible due to fact that there will not be unique solution. Isn't there any way to eliminate the solution we don't want?

 

Let me give you the way in my mind:

if I draw the closed loop in the first zone(+x,+y) and let theta1 won't go below 0 (will be limited 0<theta1<180)

we still cannot avoid to calculate other solution?

Highlighted

Re: 2 Trigonometric function with two unidentified

May be so

sincos.png

Highlighted

Re: 2 Trigonometric function with two unidentified

If you limit Theta2, too (positive in the range from 0 to 180°) you have a unique, single solution.

One way to calculate the angles Theta1 and Theta2 based on the coordinates x,y of the endpoint is shown in the picture below:

B.png

B2.png

View solution in original post

Highlighted

Re: 2 Trigonometric function with two unidentified

And here's a small animation using the above formulas

Robot2.gif

Highlighted

Re: 2 Trigonometric function with two unidentified

I really appreciate this and I feel dumber each time asking you after your precious messages 🙂

 

a small question: I want to start as Teta1=0 then

the values from your codes

 

I need to do exception for i=0

 

it will be like;
i=0 --> Theta1=0

i=1..20 Matrix calculated Theta values

Highlighted

Re: 2 Trigonometric function with two unidentified

You mean Theta1 = Theta2 = 0? Some sort of rest position?

There is no exception. You simply add the point with the coordinates (L.A+L.B / 0) as first point of your Matrix of K points. You have to decide which way the robot arms should chose to move from rest position to the first point of your curve and at which speed.

You wrote in a previous answer that you have a bunch of points K and intend to connect them via a Bezier curve.

So you may simply ad the start point in front -  maybe even a few more points between the start point and the first regular "K-point". This insertion of points could be done by linear interpolation.

After the adding the point(s) go ahead with your Bezier.

 

Highlighted

Re: 2 Trigonometric function with two unidentified

I found a sneaky way to make it.

 

resim.png

Thank you for everything. I will try to move them with rectangular boxes.

Announcements