Anda di halaman 1dari 11

POST TEST PRAKTIKUM ALAT PENGEMBANGAN PERANGKAT LUNAK

TUTORIAL COPELIASIM KONTROL JOINTS (VELOCITY DAN POSITION)

LUSIANA DIYAN NINGRUM (2210181051)

2 D4 TEKNIK KOMPUTER B

POLITEKNIK ELEKTRONIKA NEGERI SURABAYA

SURABAYA

2020
TUTORIAL COPELIASIM KONTROL JOINTS (VELOCITY DAN POSITION)

A. Peralatan yang digunakan


1. PC/Laptop yang sudah terinstall OS Windows/Linux
2. Software simulator CoppeliaSim/VREP

B. Langkah Percobaan
B.1 Joint(Velocity)

1. Buka Software CoppeliaSim

2. Sebelum mulai membuat simulasi, Anda bisa mengatur ukuran dari lantai pada area kerja
dengan cara klik RezisableFlor, dan nanti akan muncul dialog box untuk memasukkan
ukuran yang diperlukan

3. Buat body Crane berbentuk kubus dengan cara klkik kanan pada area kerja. Add > Primitive
shape > Cuboid.
4. Isi pada X-size[m] = 0.1, Y-Size[m] = 0.1, dan Z-size[m] = 0.1. Klik OK.

5. Tambahkan joint dengan cara klik kanan pada area kerja > Add > Joint > Revolute.

6. Atur posisi object. Klik Object/Item Shift > Mouse Translation > pilih along X dan along Z.
Geser Revolute joint berada di atas cuboid.
7. Atur scene object properties joint menjadi motor enabled. Sorot joint > Scene object
properties > Show dynamic properties dialog

8. Tambahkan cuboid baru untuk menjadi barnya. Atur x=0.5,y=0.015,z=0.015


9. Atur posisi object.Sorot object > Klik Object/Item Translation/Position > pilih along X dan
along Z. Geser Revolute joint berada di atas cuboid.

10. Susun scene hierarchy menjadi seperti dibawah ini

>>

11. Tambahkan child script pada base Cuboid dengan cara klik Cuboid > add associated child script
> non threaded
12. Klik dua kali icon kertas disebelah Cuboid dan tambahkan script seperti berikut:

function sysCall_init()

-- do some initialization here

joint=sim.getObjectHandle('Revolute_joint')

sim.setJointTargetVelocity(joint,0,1)
end

function sysCall_actuation()

-- put your actuation code here

end

function sysCall_sensing()

-- put your sensing code here

end

function sysCall_cleanup()

-- do some clean-up here

end

-- See the user manual or the available code snippets for additional callback functions and details
13. Jalankan simulasi, apabila bar bisa bergerak maka percobaan berhasil

B.2 Menggontrol Position dari sebuah Joint

1. Object yang digunakan masih sama seperti percobaan sebelumnya


2. Klik revolute joint. Buka scene object properties > show dynamic properties dialog > Centang
“control loop enabled”

3. Edit script menjadi seperti berikut


function sysCall_init()

-- do some initialization here

joint=sim.getObjectHandle('Revolute_joint')

last_time=sim.getSimulationTime()

ccw=false

end

function sysCall_actuation()

-- put your actuation code here

if ((sim.getSimulationTime()-last_time)>5) then

time_elapsed=true

last_time=sim.getSimulationTime()

else
time_elapsed=false

end

if (time_elapsed and ccw==true) then

ccw=false

sim.setJointTargetPosition(joint,90*math.pi/180)

elseif (time_elapsed and ccw==false) then

ccw=true

sim.setJointTargetPosition(joint,-90*math.pi/180)

end

end

function sysCall_sensing()

-- put your sensing code here

end

function sysCall_cleanup()

-- do some clean-up here

end

-- See the user manual or the available code snippets for additional callback functions and details

4. Jalankan simulasi, apabila bar bergerak 90 derajat kemudian kembali dengan sudut yang sama
berarti simulasi berhasil
Referensi:

CoppeliaSim Tutorial: Joint (velocity and position)

https://www.youtube.com/watch?v=YFpXZN3EKfY&list=PLjzuoBhdtaXOoqkJUqhYQletLLnJ
P8vjZ&index=16

https://www.youtube.com/watch?v=efQtKGXivbQ&list=PLjzuoBhdtaXOoqkJUqhYQletLLnJP
8vjZ&index=17

Anda mungkin juga menyukai