40823146 cd2021

  • Home
    • Site Map
    • reveal
    • blog
  • About
  • W2~W4
  • W5~W9
  • w11~w18
    • stage3-ag4
    • w11
    • w12
    • w13~w14
      • 小組會議
      • task1
      • task2
      • robodk
    • w15
    • w16
robodk << Previous Next >> w16

w15

影片翻譯

Inverse kinematics for a 2-joint robot arm using geometry

 

We saw this simple two-link robot in the previous lecture about forward kinematics

我們在之前的正向運動學的講座中看到了這個簡單的雙連桿機構

The tooltip pose of this robot is described simply by two numbers

這個連趕工具是由兩個數字簡單描述的

the coordinates x and y with respect to the world coordinate system

相對於絕對坐標系的x和y

So, the problem here is that given x and y

這裡的問題是我們訂了x和y

we want to determine the joined angles, Q1 and Q2

要如何確定連接角度 Q1和Q2

The solution that we’re going to follow in this particular section is a geometric one

在特殊的部分需依照其中一種幾何學的解決方案

We’re going to start with a simple piece of construction

我們要從一個簡單的結構上開始

We’re going to overlay the red triangle on top of our robot

假設把一個紅色的三角形放在我們的機構上

We know that the end point coordinate is x,y so the vertical height of the triangle is y, the horizontal width is x

以肢端點座標為X和Y 三角形的垂直高度為Y 水平寬度為X

And using Pythagoras theorem, we can write r squared equals x squared plus y squared So far, so easy

利用畢氏定理即可得出  r的平方=x的平方+y的平方  目前都很簡單

Now, we’re going to look at this triangle highlighted here in red and we want to determine

the angle alpha

現在我們來看此處用紅色突出顯示的三角形並且確定出我們想要的角度α

In order to do that, we need to use the cosine rule

為了做到這件事我們必須使用餘弦定理

And if you’re a little rusty on the cosine rule, here is a bit of a refresher

如果你對餘弦定理有點不熟悉這裡有一些資料可以複習

We have an arbitrary triangle

這裡有個任意三角形

We don’t have to have any right angles in it

裡面沒有任何直角

and we’re going to label the length of this edge as A and the angle opposite that edge, we’re going to label as little a

我們把這條邊的長度標為A與這條邊相對的角我們標記為a

And we do the same for this edge and thisangle and this edge and this angle

對另外兩邊的邊和角做相同的事

So all together the sides are labelled capitals A,B and C and the angles are labelled little a, little b and little c

把所有的邊都被標記為A,B,C然後角都被標記為a,b,c

So, the cosine rule is simply this relationship here

餘弦定理在這裡就可以以這種簡單的關係表示

It’s a bit like Pythagoras’ theorem except for this extra term on the end with the cos a in it

它有點類似於畢氏定理只是在最後加了一個帶cosa的項

Now, let’s apply the cosine rule to the particular triangle we looked at a moment ago

讓我們把餘弦定理運用在剛才看到的那個特定三角形上

It’s pretty straightforward to write down this particular relationship

可以很直接地寫下此種特殊關係

We can isolate the term cos alpha which gives us the angle alpha that we’re interested in

我們可以將我們所感興趣的α角求出需將給定的cos α項分離出來

And, it’s defined in terms of the constant link lengths, A1 and A2 and the position of the end effector x and y

它是以恆定的連桿長度A1及A2以及末端執行器位置x與y來定義的

We can write this simple relationship between the angles alpha and Q2

我們可以寫出此種於α角和q2之間的簡單關係

And we know from the shape of the cosine function that cos of Q2 must be equal to negative of cos alpha

而且我們從餘弦函數的形狀得知cos q2須等於 -cos α

This time, let’s just write an expressionfor the cosine of the joined angle Q2

這次,讓我們只寫出有關連接角q2的餘弦表達式

Now we’re going to draw yet another red triangle and we’re going apply some simple trigonometry here

再畫一個紅色三角形並且在這使用一些簡單的三角函數

If we know Q2, then we know this length and this length of the red triangle

如果我們知道了q2那我們便可得紅色三角形中q2的對邊長與鄰邊長

We can write this relationship for the sine of the joined angle Q2

我們可以將這種關係寫為連接角q2的正弦

Now we can consider this bigger triangle whose angle is beta and this side length of the triangle is given here in blue

我們可以考慮更大的三角形其角度為β這個三角形的邊長用藍色表示

And the length of the other side of the triangle is this

三角形的另一邊長是這樣表示的

so now we can write an expression for the angle beta in terms of these parameters here

我們可以用這些參數來寫出一個β角的表達式

Going back to the red triangle that we drew earlier we can establish a relationship between Q1 and the angle beta

回到之前我們畫的紅色三角形,我們可以在q1和β角之間建立一個關係

Introduce yet another angle, this one gamma and we can write a relationship between the angle gamma and the tooltip coordinates x and y

代入另一個角度γ,我們可寫出γ角和工具軟件座標x和y之間的關係

Now we can write a simple relationship between the angles that we’ve constructed gammaand beta and the joined angle we’re interested in which is Q1

我們可以用建構出的角度γ,β來寫出γ角和β角與欲求之連接角q1之間的簡單關係

And the total relationship looks something like this

整體關係看起來像這樣

Quite a complex relationship

這個是相當複雜的一個關係

it gives us the angle of joined one, that’s Q1 in terms of the end effector coordinates y and x and a bunch of constants, a1 and a2 and it’s also a function of the second joint angle Q2

此為相當複雜的一個關係它提供了第一關節角q1與端點坐標y和x以及一堆常數a1和a2並且它也是第二關節角q2的函數

So, let’s summarize what it is that we have derived here

讓我們總結一下在這裡得出的結論為何

We have an expression for the cosine of Q2 and we have an expression for Q1

我們有一個q2的餘弦表達式,和一個q1表達式

Now, the cosine function is symmetrical about 0

餘弦函數在0時為對稱的

So, if we know the value of the cosine of Q2 then there are two possible solutions a positive angle and a negative angle

假如我們得知cosq2,那它便會有正角與負角兩種解

We’re going to explicitly choose the positive angle, which means that I can write this expression here

在這裡明確的選擇正角,這意味著我可以在此處寫這個表達式

And now, we have what we call the inverse kinematic solution for this two-link robot

現在我們有了解決雙連桿機構的逆向運動學函式

We have an expression for the two joined anglesQ1 and Q2 in terms of the end effector pose x and y and a bunch of constants

我們有一個對連接角q1和q2的表達式其與末端執行器構成的x和y和一大堆常數有關

You notice that the two equations are not independent

你會注意到這兩個方程式並不獨立

The equation for Q1 in fact depends on the solution for Q2

實際上q1的方程式取決於q2的解

In this case, Q2 is negative and we’re going to write the solution for Q2 with a negative sign in front of the inverse cosine

在這種情況下q2為負因此我們要在反餘弦前加上負號來寫出q2的解

Now, we need to solve for Q1, so we’re going to introduce this particular red triangle the angle beta that we solved previously and the angle gamma which is defined in terms of y and x

現在我們要求出q1的解所以我們要引入這個特定的紅色三角形並用之前得出的β角以及用y和x定義出的γ角

Now we write a slightly different relationship between Q1 gamma and beta different to what we had before

我們在q1γ和β之間寫了一個與之前稍微不同的關係

There’s a change of sign involved

這涉及到符號的變化

Then, we can substitute all that previous equation and come up with this expression for Q1

然後將先前所有的方程代入可得出這個q1的表達式

Again, there is a change of sign here

同樣地這裡也有一個符號的變化

Previously this was a negative sign

在之前的式子裡這裡是負號

And, here in summary form is the solution for the inverse kinematics of our two-link robot when it is in this particular configuration where Q2 is negative

在之前的式子裡,這裡是負號值

Let’s compare the two solutions, the case where q2 is positive and the case where q2 is negative

讓我們在q2為正以及q2為負的情況下進行兩種解法的比較


robodk << Previous Next >> w16

Copyright © All rights reserved | This template is made with by Colorlib