Sei sulla pagina 1di 2

Department of Mechatronics Engineering

Air University

Lab # 3
Objective
Quick overview of Linear algebra(matrix theory) commands
To develop a 2-link manipulator using vectors in MATLAB

Lab Exercise
Consider a 2 DOF, 2R planar manipulator as shown in figure below assuming the fixed-length
L1
L2
parameters as
= 4 and
= 3 units.

Show the following


(a)
(b)
(c)
(d)

Write a MATLAB program that represent two links of the manipulator as vectors.
Plot the 2-link vector form manipulator at any desired orientation of your own choice
Show the coordinates of the end effector
Modify the above written MATLAB program that plots a shaded region to show the
workspace of the manipulator (When the arms are extended parallel to ground)

MATLAB CODE:clc
clear all
for angle=0:1:120
a1=[0 4*cos(angle)];
a2=[0 4*sin(angle)];
b1=[4*cos(angle) 7*cos(angle)];
b2=[4*sin(angle) 7*sin(angle)];
plot(a1,a2,b1,b2)
hold on
end

Advanced Robotics Lab

Spring 2016

Department of Mechatronics Engineering

Air University

clc
clear all
a1=[0 4*cos(30)];
a2=[0 4*sin(30)];
b1=[4*cos(30) 7*cos(45)];
b2=[4*sin(30) 7*sin(45)];
plot(a1,a2,b1,b2)
hold on

Advanced Robotics Lab

Spring 2016

Potrebbero piacerti anche