40823144 cd2021

  • Home
    • Site Map
    • reveal
    • blog
  • About
    • csave
  • CMSiMDE
  • Stage1-ag17
    • 組員
    • W3
  • Stage2-ag10
    • 組員:
    • W5
    • W6
    • W7
    • W8
    • 成品:
  • W13~W14
    • RoboDK
    • Task
      • task1
      • task2
  • W15
  • W16
  • Stage3-ag4
    • Stage3組員
    • 更改1
    • 模擬問題
  • 英文學習中
  • CoppeliaSim
  • ssh
  • heroku
  • DC推廣中心
task2 << Previous Next >> W16

W15

影片字幕翻譯

翻譯使用自DeepL

1.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 the robot is simply described by two numbers, coordinates x and y is relative to the world coordinate system.

這個工具軟件構成是由兩個數字簡單描述的,相對於絕對坐標系的x和y。

So, the problem here is that given x and y, we want to determine the joined angles, q1 and q2.

所以,這裡的問題是當我們給定了x和y,要如呵得出我們想連接的角度,即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.

並且,利用畢氏定理,我們可得出r的平方 = x的平方 + y的平方。

So far, so easy.

到目前為止,都很容易。

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 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 this angle, 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 expression for 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 this 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, gamma and 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 angles, q1 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.

這是我們使用逆向運動學於雙連桿機構在此特定構造下的解,其中q2為負值

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

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

-------------------------------------------------------------------------------------------------------

2.Inverse kinematics for a 2-joint robot arm using algebra

Here we have the same two link robot as we just looked at but this time we're going tosolve it using an analytical approach , that is we're going to rely much more on algebra ,particular linear algebra rather than geometry .

這裡我們有一個和剛才一樣的二連桿機構,但這次我們要用分析的方法來解決它,也就是說我們要更加的依靠代數,特別是線性代數而不是幾何。

We have an expression E , which is the homogeneous transformation which represents the pose of the robots endefector and we looked at this in the last lecture , we can write the endefector pose as a sequence of elementary homogeneous transformations .

我們有一個表達式E,它表示連桿末端執行器姿勢的齊次轉換,我們在上一節課看了這個表達式,我們可以把末端執行器的姿勢寫成基本其次轉換的序列。

A rotation by Q1 , a translation along the X direction by A1 , a rotation by Q2 and then a translation in the X direction by A2 .

透過旋轉q1,使a1沿x方向平移,透過旋轉q2,使a2沿x方向平移。

If I expand this out , multiply all the transformations together , I get the expression shown here ; a three by three homogeneous transformation matrix representing the pose of the robot's endefector.

如果我將其展開,把所有轉換式乘在一起,我得到的表達式如圖所示;一個3x3的齊次轉換矩陣,它代表著末端執行器的姿勢。

Now for this particular two link robot , we are only interested in the position of its endefector , it's X and Y co - ordinate and they are these two elements within the homogeneous transformation matrix , so I'm going to copy those out .

現在,對於這個特定的二連桿機構,我們只關注其端點位置,就是其x和y的座標,它們是齊次轉換矩陣中的兩個元素,所以我要將它們複製出來。

So here again is our expression for X and Y and what we're going to do is a fairly common trick , we're going to square and add these two equations and I get a relationship that looks like this .

所以這裡又是我們x和y的表達式,我們要做一個相當常見的技巧,我們要將這兩個方程平方相加,然後我會得到看起來像這樣的關係式。

Now I can solve for the joint angle Q2 in terms of the endefector pose X and Y and the robot's constants A1 and A2.

現在我可以根據端點位置x和y及機構的常數a1和a2為條件列式求解關節角度q2。

Now what I'm going to do is apply the sum of angles identity .

現在我要應用的是角之和的特性。

I'm going to expand these terms, sine of Q1 plus Q2 or cos of Q1 plus Q2 and to make life a little bit easier, I'm going to make some substations, so where ever I had cos Q2, I'm going to write C2 and where ever I had sine Q2, I'm going to write S2.

我將這些項展開,q1加q2的正弦或q1加q2的餘弦,為了讓式子更容易一些,我將做一些變化,所以在我有cosq2的地方,換寫上C2,在有sinq2的地方,換寫上S2。

It's a fairly common shorthand when people are looking at robot kinematic equations.

這是一個當人們看到機器運動學方程式的時候,相當常見的速記法。

And here are the equations after making those substitutions.

下面是進行這些替換後的方程式。

Looking at these two equations, I can see that they fall into a very well known form and for that form there is a very well known solution.

觀察這兩個方程,我們可以發現它們屬於一個非常知名的形式,對於這個形式有一個非常知名的解決方案。

So I'm going to consider just one of the equations, the equation for Y and using our well known identity and it's solution, I can determine the values for the variables little a, little b and little c and once l've determined those, then I can just write down the solution for Q1, which x is the equivalent of theta in this particular case.

所以我只考慮其中一個方程,即y的方程,利用我們眾所皆知的特性和它的解,我可以確定變量a,b,c的值,一但我確定了這些值,那麼我就可以寫出q1的解,在這個特定情況下,x相當於θ的值。

Here again is our expression for Q1, copied over from the previous slide and we may remember from earlier in our workings that we determined this particular relationship; X squared plus Y squared is equal to this particular complex expression.

這裡又是我們對q1的表達式,從上一張幻燈片複製過來的,我們可能還記得在早期的說明中,確定了這種特殊的關係,x的平方加上y的平方等於這個特殊的複合表達式。

So I can substitute that in and do some simplification and I end up with this slightly less complex expression for Q1.

因此,我可以將其帶入並做一些簡化,最後得到這個比較不那麼複雜的表達式q1。

And it is the same expression that I got following the geometric approach in the previous section.

而這也是我在上一節中按照幾何方法所得到的表達式。


task2 << Previous Next >> W16

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