w14 <<
Previous Next >> w16
w15
We saw this simple two-link robot in the previous lecture about forword kinematics.
我們在上一堂關於正向運動學的課程看到了這簡單的雙連桿機構。
The tooltip pose of this robot is described simple by two numbers, the coordinates x and y with respect to the world coordinate frame.
該機器人的工具提示姿勢由兩個數字簡單描述,即相對坐標的坐標 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, w'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.
就像畢氏定理一樣,只是多了 cos a。
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.
而且,從餘弦函數的形狀知道,Q2 的 cos 必須等於 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,那麼我們就知道這個長度和這個紅色三角形的長度。
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.
所以,如果我們知道Q2的餘弦值,可能有兩個解一個是正角度,一個是負角度
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.
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為負的情况。
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.
如果我將其展開,將所有變換相乘,就會得到此處所示的表達式 E ;它是一個三乘三的齊次變換矩陣,表示機械手臂的最終的位置。
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,為了讓生活更輕鬆一點,我將建立一些分部,所以只要有 cos Q2,我會將其取代為C2並且在有正弦Q2的地方,我會將其取代為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 相當於 theta。
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.
這與我在上一節中遵循幾何方法求出的表達式一樣。
w14 <<
Previous Next >> w16