Anda di halaman 1dari 21

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/320146369

Sistem Dinamik

Working Paper · February 2017


DOI: 10.13140/RG.2.2.34784.99840

CITATIONS READS

0 1,659

1 author:

Indrazno Siradjuddin
Politeknik Negeri Malang
122 PUBLICATIONS   401 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Thesis View project

Book Project View project

All content following this page was uploaded by Indrazno Siradjuddin on 01 October 2017.

The user has requested enhancement of the downloaded file.


Sistem Dinamik
Indrazno Siradjuddin
February 14, 2017

1 Sistem Dinamik Pergerakan Pegas

Gambar 1: Sistem pegas

1.1 Metode Lagrange (Lagrangian Method)

L = T −V (1)

dimana L adalah fungsi Lagrange, T adalah energi kinetik dan V adalah energi
potensial. Untuk sistem konservatif (tidak ada energi yang hilang) maka per-
samaan gerak (an equation of motion) dapat dihasilkan dari diferensial dari fungsi
Lagrange, hasil persamaan berikut ini disebut juga Lagrange’s equation
 
d ∂L ∂L
− = 0 (2)
dt ∂ q̇i ∂qi

dimana qi adalah sistem koordinat dari pergerakan sistem yang digeneralisasi.


Untuk kasus pegas yang memiliki satu sumbu pergerakan bebas i = 1 atau dengan
kata lain sistem 1 DOF (degrees of freedom), maka subscript i tidak perlu ditulis

1
tanpa mengihangkan arti, untuk itu koordinat dari sistem pegas q1 = q = x.
Persamaan Lagrange untuk kasus sistem pegas menjadi
 
d ∂L ∂L
− = 0 (3)
dt ∂ ẋ ∂x
dimana ẋ adalah turunan pertama dari x. Energi kinetik T dari sistem pegas
adalah
1
T = mẋ2 (4)
2
sedangkan energi potensial V dari sistem pegas adalah
1 2
V = kx − mg(l + x) (5)
2
dimana k adalah konstanta pegas dengan satuan N/m dan l adalah panjang pegas.
Lebih lanjut, turunan pertama fungsi Lagrange didapatkan persamaan sebagai
berikut:
!
d ∂ 21 mẋ2 − 12 kx2 + mg(l + x)
 
d ∂L
= (6)
dt ∂ ẋ dt ∂ ẋ
= mẍ (7)
∂ 12 mẋ2 − 21 kx2 + mg(l + x)

∂L
= (8)
∂x ∂x
= −kx + mg (9)

oleh karena itu, persamaan Lagrange untuk sistem pegas menjadi

mẍ + kx − mg = 0 (10)
mẍ = mg − kx (11)

Persamaan Lagrange yang dihasilkan diatas dapat di validasi dengan menggunakan


hukum Newton dan Hooke.

1.2 Hukum Hough dan Newton


X
f = w − fk (12)
X
f = mg − kx (13)
mẍ = mg − kx (14)
mg − kx
ẍ = (15)
m
2
1.3 Simulasi dengan Python
1 import pylab
2 from s c i p y . i n t e g r a t e import o d e i n t
3 d e f MassSpring ( s t a t e , t ) :
4 # unpack t h e s t a t e v e c t o r
5 x = state [0]
6 xd = s t a t e [ 1 ]
7 # t h e s e a r e our c o n s t a n t s
8 k = 2 . 5 # Newtons p e r metre
9 m = 1 . 5 # Kilograms
10 g = 9 . 8 # metres per second
11 # compute a c c e l e r a t i o n xdd
12 xdd = ((−k∗x ) /m) + g
13 # r e t u r n t h e two s t a t e d e r i v a t i v e s
14 r e t u r n [ xd , xdd ]
15

16 state0 = [0.0 , 0.0]


17 t = pylab . a r a n g e ( 0 . 0 , 1 0 . 0 , 0 . 1 )
18
19 s t a t e = o d e i n t ( MassSpring , s t a t e 0 , t )
20
21 pylab . p l o t ( t , s t a t e )
22 pylab . x l a b e l ( ’TIME ( s e c ) ’ )
23 pylab . y l a b e l ( ’STATES ’ )
24 pylab . t i t l e ( ’ Mass−S p r i n g System ’ )
25 pylab . l e g e n d ( ( ’ $x$ (m) ’ , ’ $\ dot {x}$ (m/ s e c ) ’ ) )
26 pylab . s a v e f i g ( ” t e s t . svg ” )
Program 1: Sistem pegas

Gambar 2: Hasil program simulasi sistem pegas

3
1.4 Gaya redaman
Model dan simulasi sistem pegas diatas adalah diturunkan berdasarkan asumsi
tidak ada gaya eksternal yang mempengaruhi sistem. Sesungguhnya, pendekatan
yang lebih realistis adalah bahwa sistem pegas tidak selamanya akan berosilasi
terus menerus, melainkan lambat laun osilasi akan berkurang/teredam sehingga
pegas akan kembali pada posisi normal (rest). Oleh sebab itu sistem pegas bukan
merupakan sistem konservatif. Gaya redaman yang dinotasikan fd adalah propor-
sional dengan kecepatan, dapat dirumuskan sebagai berikut

fd = −cẋ (16)

dimana c adalah konstanta redaman viskos (viscous damping) dengan satuan


N.s/m, tanda ”-” diberikan sebagai tanda yang selalu berlawanan dengan arah
gerak benda. Persamaan Lagrange menjadi
 
d ∂L ∂L
− = Qi (17)
dt ∂ q̇i ∂qi

dimana Qi adalah gaya eksternal. Sebagai perbandingan dengan sistem yang kon-
servatif, nilai Qi adalah sama dengan nol. Untuk kasus sistem pegas maka
 
d ∂L ∂L
− = −cẋ (18)
dt ∂ ẋ ∂x

dengan cara yang sama seperti diatas, maka diperoleh persamaan gerak dinamik
pegas sebagai berikut

mẍ = mg − kx − cẋ (19)

Simulasi dengan Python berikut ini dengan menggunakan c = 2 N.s/m


1 import pylab
2 from s c i p y . i n t e g r a t e import o d e i n t
3 d e f MassSpring ( s t a t e , t ) :
4 # unpack t h e s t a t e v e c t o r
5 x = state [0]
6 xd = s t a t e [ 1 ]
7 # t h e s e a r e our c o n s t a n t s
8 k = 2 . 5 # Newtons p e r metre
9 m = 1 . 5 # Kilograms
10 g = 9 . 8 # metres per second
11 c = 2.0
12 # compute a c c e l e r a t i o n xdd
13 xdd = ((−k∗x − c ∗xd ) /m) + g
14 # r e t u r n t h e two s t a t e d e r i v a t i v e s

4
15 r e t u r n [ xd , xdd ]
16

17 state0 = [0.0 , 0.0]


18 t = pylab . a r a n g e ( 0 . 0 , 1 0 . 0 , 0 . 1 )
19
20 s t a t e = o d e i n t ( MassSpring , s t a t e 0 , t )
21
22 pylab . p l o t ( t , s t a t e )
23 pylab . x l a b e l ( ’TIME ( s e c ) ’ )
24 pylab . y l a b e l ( ’STATES ’ )
25 pylab . t i t l e ( ’ Mass−S p r i n g System ’ )
26 pylab . l e g e n d ( ( ’ $x$ (m) ’ , ’ $\ dot {x}$ (m/ s e c ) ’ ) )
27 pylab . s a v e f i g ( ” t e s t . svg ” )
Program 2: Sistem pegas dengan damper

Gambar 3: Hasil program simulasi sistem pegas dengan damper

5
2 Sistem Pergerakan Pendulum Pegas

Gambar 4: Sistem pendulum pegas

Energi kinetik total sistem pendulum pegas adalah merupakan gabungan antara
energi kinetik translasi (tangensial atau translational) dan rotasi (radial atau ro-
tational)
1  2 2 2

T = m ẋ + (l + x) θ̇ (20)
2
Catatan: Energi kinetik untuk benda berputar dengan jarak dari titik pusat r
adalah
1 2
Tr = Iω (21)
2
dimana I adalah momen inersia dan ω adalah kecepatan putaran (ω = θ̇). Jika
masa pegas diabaikan, maka momen inersia dari pendulum pegas adalah

I = mr2 (22)

untuk kasus pendulum pegas, r = (l + x). Energi potensial sistem pendulum pegas
diakibatkan oleh gravitasi dan sifat pegas itu sendiri, dituliskan sebagai berikut
1
V = −mg(l + x) cos θ + kx2 (23)
2
Fungsi Lagrange sistem pendulum pegas dapat diformulasikan sebagai berikut
1  2  1
L = m ẋ + (l + x) θ̇ + mg(l + x) cos θ − kx2
2 2
(24)
2 2
6
Dapat diketahui dari persamaan diatas bahwa terdapat dua sistem koordinat pada
sistem pendulum pegas yaitu sistem koordinat translasi yang direpresentasikan
oleh x dan sistem koordinat rotasi yang direpresentasikan oleh θ. Sehingga per-
samaan Lagrange pada kedua koordinat tersebut dapat diformulasikan sebagai
berikut, terhadap x
 
d ∂L ∂L
− = 0 (25)
dt ∂ ẋ ∂x
(mẍ) − (m(l + x)θ̇2 + mg cos θ − kx) = 0 (26)
 
2 kx
ẍ = (l + x)θ̇ − g cos θ + (27)
m

dan terhadap θ
 
d ∂L ∂L
= (28)
dt ∂ θ̇ ∂θ
d  
m(l + x)2 θ̇ = −mg(l + x) sin θ (29)
dt
2
m(l + x) θ̈ + 2m(l + x)ẋθ̇ = −mg(l + x) sin θ (30)
(l + x)θ̈ + 2ẋθ̇ = −g sin θ (31)
(g sin θ + 2ẋθ̇)
θ̈ = − (32)
(l + x)

3 DO NEXT!!!
1. Python code to simulate the spring pendulum

2. Include the damping force

3. Python code to simulate the spring pendulum with the damping force

4. Hardcoded ODE Euler

5. Hardcoded ODE Runge Kutta 4th Order

7
4 Single Joint Elbow Kinematic

Gambar 5: 1 DOF lengan robot

Kinematic terdiri dari forward kinematic dan inverse kinematic. Dalam kinemat-
ics, akan dipelajari hubungan atau fungsi yang memetakan input (input space)
atau join robot (joint space) untuk robot manipulator menjadi output (output
space) atau task space atau work space. Gambar 5 adalah contoh sederhana dari
sistem 1 DOF (degrees of freedom) dimana jumlah input hanya satu yaitu sebuah
motor pada posisi (0, 0) atau base, yang menggerakkan lengan l. Gerakkan putaran
motor (dalam hal ini ditunjukkan oleh posisi sudut θ) ditujukan untuk mempo-
sisikan ujung lengan (end-effector) pada posisi koordinat tertentu yang dinotasikan
oleh (xe , ye ). Dengan trigonometri dapat dengan mudah didapatkan

xe = l cos θ (33)
ye = l sin θ (34)

Problem pada inverse kinematic adalah untuk mencari posisi sudut motor θ jika
dinginkan posisi end-effector pada (xe , ye ). Inverse kinematic dari kasus ini dapat
dihitung dengan
ye
tan θ = (35)
xe
 
ye
θ = arctan (36)
xe

4.1 Simulasi 1 DOF lengan dengan Python


1 from pylab import ∗
2 #from math import s i n , cos , r a d i a n s , p i
3 t = linspace (0 ,1 ,200)

8
4 theta = s i n (2∗ pi ∗ t /4)
5 figure ()
6 subplot (2 ,4 ,(1 ,2) )
7 p l o t ( t , t h e t a ∗180/ p i )
8 x l a b e l ( ’TIME ( s e c ) ’ )
9 y l a b e l ( ’ELBOW ANGLE ( deg ) ’ )
10 # compute hand p o s i t i o n Hx , Hy
11 l = 0.45
12 Hx = l ∗ c o s ( t h e t a )
13 Hy = l ∗ s i n ( t h e t a )
14 subplot (2 ,4 ,(5 ,6) )
15 p l o t ( t , Hx , ’ b− ’ )
16 p l o t ( t , Hy , ’ r− ’ )
17 x l a b e l ( ’TIME ( s e c ) ’ )
18 y l a b e l ( ’HAND POSITION (m) ’ )
19 l e g e n d ( ( ’Hx ’ , ’Hy ’ ) , l o c= ’ l o w e r r i g h t ’ )
20 subplot (2 ,4 ,(3 ,8) )
21 p l o t ( ( 0 , Hx [ 0 ] ) , ( 0 , Hy [ 0 ] ) , ’ g− ’ )
22 p l o t ( ( 0 , Hx[ − 1 ] ) , ( 0 , Hy[ − 1 ] ) , ’ r− ’ )
23 p l o t (Hx [ 0 : − 1 : 1 0 ] , Hy [ 0 : − 1 : 1 0 ] , ’ k . ’ )
24 x l a b e l ( ’X (m) ’ )
25 y l a b e l ( ’Y (m) ’ )
26 axis ( ’ equal ’ )
27 pylab . s a v e f i g ( ” t e s t 1 d o f . svg ” )
Program 3: Simulasi kinematics 1 DOF

Gambar 6: Simulasi 1 DOF lengan robot

9
5 2 DOF Kinematic

Gambar 7: 2 DOF lengan robot

5.1 Forward Kinematic

x1 = l1 cos θ1 (37)
y1 = l1 sin θ1 (38)
x2 = l1 cos θ1 + l2 cos(θ1 + θ2 ) (39)
y2 = l1 sin θ1 + l2 sin(θ1 + θ2 ) (40)

1 from pylab import ∗


2 d e f j o i n t s t o h a n d ( a1 , a2 , l 1 , l 2 ) :
3 Ex = l 1 ∗ c o s ( a1 )
4 Ey = l 1 ∗ s i n ( a1 )
5 Hx = Ex + ( l 2 ∗ c o s ( a1+a2 ) )
6 Hy = Ey + ( l 2 ∗ s i n ( a1+a2 ) )
7 r e t u r n Ex , Ey , Hx , Hy
8
9 # limb geometry
10 l 1 = 0.34 # metres
11 l 2 = 0.46 # metres
12
13 # d e c i d e on a r a n g e o f j o i n t a n g l e s
14 n 1 s t e p s = 10
15 n 2 s t e p s = 10
16 a 1 r a n g e = l i n s p a c e ( 0 ∗ p i / 1 8 0 , 120∗ p i / 1 8 0 , n 1 s t e p s ) # s h o u l d e r
17 a 2 r a n g e = l i n s p a c e ( 0 ∗ p i / 1 8 0 , 120∗ p i / 1 8 0 , n 2 s t e p s ) # elbow
18

10
19 # sample a l l c o m b i n a t i o n s and p l o t j o i n t and hand c o o r d i n a t e s
20 f=f i g u r e ( f i g s i z e =(8 ,12) )
21 f o r i in range ( n1steps ) :
22 f o r j in range ( n2steps ) :
23 subplot (2 ,1 ,1)
24 p l o t ( a 1 r a n g e [ i ] ∗ 1 8 0 / pi , a 2 r a n g e [ j ] ∗ 1 8 0 / pi , ’ r+ ’ )
25 ex , ey , hx , hy = j o i n t s t o h a n d ( a 1 r a n g e [ i ] , a 2 r a n g e [ j ] , l 1 , l 2 )
26 subplot (2 ,1 ,2)
27 p l o t ( hx , hy , ’ r+ ’ )
28 subplot (2 ,1 ,1)
29 x l a b e l ( ’ S h o u l d e r Angle ( deg ) ’ )
30 y l a b e l ( ’ Elbow Angle ( deg ) ’ )
31 t i t l e ( ’ J o i n t Space ’ )
32 subplot (2 ,1 ,2)
33 x l a b e l ( ’ Hand P o s i t i o n X (m) ’ )
34 y l a b e l ( ’ Hand P o s i t i o n Y (m) ’ )
35 t i t l e ( ’ Hand Space ’ )
36 a1 = a 1 r a n g e [ n 1 s t e p s / 2 ]
37 a2 = a 2 r a n g e [ n 2 s t e p s / 2 ]
38 ex , ey , hx , hy = j o i n t s t o h a n d ( a1 , a2 , l 1 , l 2 )
39 subplot (2 ,1 ,1)
40 p l o t ( a1 ∗180/ pi , a2 ∗180/ pi , ’ bo ’ , m a r k e r s i z e =5)
41 axis ( ’ equal ’ )
42 x l = g e t ( g e t ( f , ’ a x e s ’ ) [ 0 ] , ’ xlim ’ )
43 y l = g e t ( g e t ( f , ’ a x e s ’ ) [ 0 ] , ’ ylim ’ )
44 p l o t ( ( x l [ 0 ] , x l [ 1 ] ) , ( a2 ∗180/ pi , a2 ∗180/ p i ) , ’ b− ’ )
45 p l o t ( ( a1 ∗180/ pi , a1 ∗180/ p i ) , ( y l [ 0 ] , y l [ 1 ] ) , ’ b− ’ )
46 subplot (2 ,1 ,2)
47 p l o t ( ( 0 , ex , hx ) , ( 0 , ey , hy ) , ’ b− ’ )
48 p l o t ( hx , hy , ’ bo ’ , m a r k e r s i z e =5)
49 axis ( ’ equal ’ )
50 x l = g e t ( g e t ( f , ’ a x e s ’ ) [ 1 ] , ’ xlim ’ )
51 y l = g e t ( g e t ( f , ’ a x e s ’ ) [ 1 ] , ’ ylim ’ )
52 p l o t ( ( x l [ 0 ] , x l [ 1 ] ) , ( hy , hy ) , ’ b− ’ )
53 p l o t ( ( hx , hx ) , ( y l [ 0 ] , y l [ 1 ] ) , ’ b− ’ )
54 pylab . s a v e f i g ( ” t e s t 2 d o f . svg ” )
Program 4: Simulasi kinematics 1 DOF

11
Gambar 8: Hasil simulasi 2 DOF lengan robot

5.1.1 Inverse Kinematic !!!

5.2 Jacobian
Working space atau task space ξ = [x, y]T dan input space atau joint space θ =
[θ1 , θ2 ]T . Forward kinematic

ξ = f (θ) (41)

merupakan hubungan posisi sudut pada join θ dengan posisi end-effector ξ pada
Euclidean space. Dengan mencari turunan pertama dari fungsi forward kine-
matic, hubungan kecepatan sudut pada join dengan kecepatan end-effector pada

12
taskspace dapat diketahui

dξ df (θ)
= (42)
dt dt
dξ ∂f (θ) dθ
= (43)
dt ∂θ dt
ξ̇ = Jθ̇ (44)

dimana J disebut sebagai matriks Jacobian. Untuk kasus 2 DOF, matriks Jacobian
dapat dicari dengan

∂f (θ)x ∂f (θ)x
 
 ∂θ1 ∂θ2 
J =  (45)
 

 ∂f (θ) ∂f (θ) 
y y
∂θ1 ∂θ2
Tuliskan program Python dibawah ini untuk menghitung secara simbolik kompo-
nen matriks J
1 # import sympy
2 from sympy import ∗
3 # d e f i n e t h e s e v a r i a b l e s a s s y m b o l i c ( not numeric )
4 a1 , a2 , l 1 , l 2 = symbols ( ’ a1 a2 l 1 l 2 ’ )
5 # a1 and a2 r e p r e s e n t t h e t a 1 and t h e t a 2 , r e s p e c t i v e l y
6 # f o r w a r d k i n e m a t i c s f o r Hx and Hy
7 f x = l 1 ∗ c o s ( a1 ) + l 2 ∗ c o s ( a1+a2 )
8 f y = l 1 ∗ s i n ( a1 ) + l 2 ∗ s i n ( a1+a2 )
9 # u s e sympy d i f f ( ) t o g e t p a r t i a l d e r i v a t i v e s f o r J a c o b i a n matrix
10 J11 = d i f f ( fx , a1 )
11 J12 = d i f f ( fx , a2 )
12 J21 = d i f f ( fy , a1 )
13 J22 = d i f f ( fy , a2 )
14 p r i n t J11
15 p r i n t J12
16 p r i n t J21
17 p r i n t J22
Program 5: Menghitung secara simbolik komponen matrix J
akan didapatkan hasil matriks Jacobian J sebagai berikut
 
−l1 sin(θ1 ) − l2 sin(θ1 + θ2 ) −l2 sin(θ1 + θ2 )
J = (46)
l1 cos(θ1 ) + l2 cos(θ1 + θ2 ) l2 cos(θ1 + θ2 )

Program simulasi berikut memberikan gambaran aplikasi mencari nilai kecepatan


end-effector dengan Jacobian, biasa disebut juga velocity kinematic.

13
1 from sympy import ∗
2 from numpy import ∗
3 d e f j a c o b i a n (A, aparams ) :
4 ”””
5 Given j o i n t a n g l e s A=(a1 , a2 )
6 r e t u r n s t h e J a c o b i a n matrix J ( q ) = d f /dA
7 ”””
8 l 1 = aparams [ ’ l 1 ’ ]
9 l 2 = aparams [ ’ l 2 ’ ]
10 dFxdA1 = −l 1 ∗ s i n (A [ 0 ] ) − l 2 ∗ s i n (A[ 0 ] +A [ 1 ] )
11 dFxdA2 = −l 2 ∗ s i n (A[ 0 ] +A [ 1 ] )
12 dFydA1 = l 1 ∗ c o s (A [ 0 ] ) + l 2 ∗ c o s (A[ 0 ] +A [ 1 ] )
13 dFydA2 = l 2 ∗ c o s (A[ 0 ] +A [ 1 ] )
14 J = matrix ( [ [ dFxdA1 , dFxdA2 ] , [ dFydA1 , dFydA2 ] ] )
15 return J
16
17 aparams = { ’ l 1 ’ : 0 . 3 3 8 4 , ’ l 2 ’ : 0 . 4 5 5 4 }
18 A = a r r a y ( [ 4 5 . 0 , 9 0 . 0 ] ) ∗ p i /180 # joint angles
19 Ad = matrix ( [ [ − 5 . 0 ] , [ 3 . 0 ] ] ) ∗ p i /180 # j o i n t v e l o c i t i e s
20 J = j a c o b i a n (A, aparams )
21 Hd = J∗Ad
22 p r i n t Hd
Program 6: Velocity kinematic

Kecepatan end-effector dihitung jika diketahui θ1 = 45◦ , θ2 = 90◦ , θ̇1 = −5◦ s−1
dan θ̇2 = 3◦ s−1 dan dihasilkan ẋ = 0.03212204 m s−1 dan ẋ = −0.00964106 m s−1 .

5.3 Persamaan Dinamik


5.3.1 Forward Acceleration Kinematics

d   d  
ξ̇ = ξ̈ = Jθ̇ (47)
dt dt
d   d
= J θ̇ + θ̇ (J) (48)
dt dt
= Jθ̈ + J̇θ̇ (49)

Sebagai contoh, untuk kasus 2 DOF lengan robot


 
d d
 dt (j1,1 ) dt (j1,2 )
J̇ =  (50)
 

d d 
(j2,1 ) (j2,2 )
dt dt

14
dimana
d d
(j1,1 ) = (−l1 sin(θ1 ) − l2 sin(θ1 + θ2 )) (51)
dt dt
= −l1 cos(θ1 )θ˙1 − l2 cos(θ1 + θ2 )θ˙1 − l2 cos(θ1 + θ2 )θ˙2 (52)

d d
(j1,2 ) = (−l2 sin(θ1 + θ2 )) (53)
dt dt
= −l2 cos(θ1 + θ2 )θ̇1 − l2 cos(θ1 + θ2 )θ̇2 (54)
d d
(j2,1 ) = (l1 cos(θ1 ) + l2 cos(θ1 + θ2 )) (55)
dt dt
= −l1 sin(θ1 )θ̇1 − l2 sin(θ1 + θ2 )θ̇1 − l2 sin(θ1 + θ2 )θ̇2 (56)
d d
(j2,2 ) = (l2 cos(θ1 + θ2 )) (57)
dt dt
= −l2 sin(θ1 + θ2 )θ̇1 − l2 sin(θ1 + θ2 )θ̇2 (58)

5.3.2 Inverse Acceleration Kinematics

ξ̈ = Jθ̈ + J̇θ̇ (59)


 
θ̈ = J−1 ξ̈ − J̇θ̇ (60)

dimana J−1 adalah inverse dari J.

6 Persamaan Gerak 1 DOF (Variasi Kasus)

Gambar 9: Sistem dinamik elbow robot

15
Linear/Translational Kinetic Energy:
1 2
T1 = mv (61)
2
1
= m(ẋ2 + ẏ 2 ) (62)
2
Rotational Kinetic Energy:
1 2
T2 = I θ̇ (63)
2
Total Kinetic Energy:

T = T1 + T2 (64)
1 1
= m(ẋ2 + ẏ 2 ) + I θ̇2 (65)
2 2
Dengan mentransformasikan koordinat titik pusat massa m, (x, y) → (r, θ) yang
dapat diperoleh dengan cara sebagai berikut,

x = r sin(θ) (66)
y = −r cos(θ) (67)
ẋ = r cos (θ)θ̇ (68)
ẏ = r sin (θ)θ̇ (69)

substitusikan, Kinetic Energy menjadi


1 1
T = m((r cos(θ)θ̇)2 + (r sin(θ)θ̇)2 ) + I θ̇2 (70)
2 2
1 2 2 2 2 1 2
= mr θ̇ (cos θ + sin θ) + I θ̇ (71)
2 2
1 2 2 1 2
= mr θ̇ + I θ̇ (72)
2 2
Energi potensial

V = mgh (73)

dimana h adalah ketinggian benda dari permukaan tanah. Dengan mendifinisikan


bahwa energi potensial nol adalah saat lengan menghadap tegak lurus kebawah,
θ = 0◦ . Maka,

V = mgr(1 − cos(θ)) (74)

16
Dengan demikian fungsi Lagrange dapat ditulis sbg berikut

L = T −V (75)
1 2 2 1 2
= mr θ̇ + I θ̇ − mgr(1 − cos(θ)) (76)
2 2
Untuk dapat merumuskan derivative dari fungsi Lagrange, perlu diketahui
∂L
= mgr sin(θ) (77)
∂θ
dan
∂L
= mr2 θ̇ + I θ̇ (78)
∂ θ̇
dan
 
d ∂L
= mr2 θ̈ + I θ̈ (79)
dt ∂ θ̇
Dalam kasus ini koordinat system hanya satu yaitu θ, persamaan EULER-LAGRANGE
dapat ditulis sebagai berikut
 
d ∂L ∂L
− = Q (80)
dt ∂ θ̇ ∂θ
dalam hal Q adalah torque yang diberikan kepada system. Dengan kata lain, hal
ini dapat digunakan untuk menjawab pertanyaan, ”berapa torque yang dibutuhkan
untuk mengahasilkan state dinamik yang diinginkan”.

Q = mr2 θ̈ + I θ̈ + mgr sin(θ) (81)

Persamaan forward dynamic dari gerak pendulum dapat dihitung dengan


Q − mgr sin(θ)
θ̈ = (82)
I + mr2
Program Python dibawah ini adalah implementasi sistem dinamik 1 dof
1 from s c i p y . i n t e g r a t e import o d e i n t
2 from pylab import ∗
3 def onejointarm ( state , t ) :
4 theta = state [ 0 ] # j o i n t a n g l e ( rad )
5 t h e t a d o t = s t a t e [ 1 ] # j o i n t v e l o c i t y ( rad / s )
6 m = 1.65 # kg
7 r = 0.50 # l i n k l e n g t h (m)
8 g = 9.81 # g r a v i t a t i o n a l c o n s t a n t (m/ s / s )

17
9 i = 0.025 # moment o f i n e r t i a ( kg m m)
10 t h e t a d d o t = −(m∗g ∗ r ∗ s i n ( t h e t a ) ) / ( i + (m∗ r ∗ r ) )
11 return [ theta dot , theta ddot ]
12
13 t = linspace (0.0 ,10.0 ,1001) # 10 s e c o n d s sampled a t 1000 Hz
14 s t a t e 0 = [ 9 0 . 0 ∗ p i / 1 8 0 . 0 , 0 . 0 ] # 90 deg i n i t i a l a n g l e , 0 deg / s e c
i n i t i a l velocity
15 s t a t e = odeint ( onejointarm , state0 , t )
16 print state
17 figure ()
18 p l o t ( t , s t a t e ∗180/ p i )
19 legend (( ’ thetadot ’ , ’ thetaddot ’ ) )
20 x l a b e l ( ’TIME ( s e c ) ’ )
21 y l a b e l ( ’THETA DOT ( deg ) & THETA DDOT ( deg / s e c ) ’ )
22 pylab . s a v e f i g ( ” t e s t 1 d o f d y n a m i c . svg ” )
Program 7: Simulasi dinamik 1 DOF
Hasil plot

Gambar 10: Hasil simulasi sistem dinamik 1 DOF lengan robot

Program dibawah ini skeleton animasi pendulum


1 from s c i p y . i n t e g r a t e import o d e i n t
2 from pylab import ∗
3
4 d e f animate arm ( s t a t e , t ) :
5 l = 0.5
6 f i g u r e ( f i g s i z e =(12 ,6) )
7 plot (0 ,0 , ’ r . ’ )
8 p , = p l o t ( ( 0 , l ∗ s i n ( s t a t e [ 0 , 0 ] ) ) ,(0 , − l ∗ c o s ( s t a t e [ 0 , 0 ] ) ) , ’ b− ’ )
9 t t = t i t l e ( ” %4.2 f s e c ” % 0 . 0 0 )
10 xlim ([ − l −.05 , l + . 0 5 ] )
11 ylim ([ − l , . 1 0 ] )

18
12 step = 3
13 f o r i i n xrange ( 1 , shape ( s t a t e ) [ 0 ] − 1 0 , s t e p ) :
14 p . set xdata ((0 , l ∗ sin ( state [ i , 0 ] ) ) )
15 p . s e t y d a t a ((0 , − l ∗ c o s ( s t a t e [ i , 0 ] ) ) )
16 t t . s e t t e x t ( ” %4.2 f s e c ” % ( i ∗ 0 . 0 1 ) )
17 draw ( )
18
19 t = linspace (0.0 ,10.0 ,1001)
20 s t a t e = odeint ( onejointarm , state0 , t )
21 animate arm ( s t a t e , t )
Program 8: Simulasi dinamik 1 DOF

7 Equations of motion for a two-joint arm

Gambar 11: Two joints arm

19
8 Motor Control: Muscle

Gambar 12: Model dari muscle dengan torque yang konstan

I θ̈ = mglz cos(θ) + τm (83)

20

View publication stats

Anda mungkin juga menyukai