You are on page 1of 36

ROBOTICS

LAB

Submitted By :
Reg No : 20-ME-

Instructor: Engr. Naeem Zafar

Department of Mechanical Engineering


Faculty of Mechanical and Aeronautical Engineering

University of Engineering and Technology, Taxila


ROBOTICS, LAB MANUAL

Introduction

This Lab manual has been intended for a course of Robotics taught at Department of Mechatronics
Engineering, University of Engineering & Technology, Taxila. The manual is designed to aid the
teacher in effectively teaching the concepts related to Laboratory as well as helping the students in
conveniently preparing Lab reports. Every effort has been made to ensure correctness and up-to-date
content. However, if any deficiency is found, that may immediately be reported to the concerned
teacher.

2
ROBOTICS, LAB MANUAL

Course Plan and Assessments

Outcomes Assessed

CLO Learning
Course Learning Outcomes (CLOs) PLOs
# Level
Design an algorithm for a robotic system to meet
1
kinematic/dynamic requirements. C5 3
Utilize modern tools for modeling and simulation of the robotic
2 C5 5
system.

CLOs Maximum Marks


Activity Rubrics
Covered Marks Obtained
R1: Coding Standards and
Lab Performance 10
Efficiency
& Evaluation 1, 2
R2: Algorithm/codes’ working on
Rubrics 10
Runtime
R1: Understanding of principles
Viva Rubrics 1, 2 10
and working

Viva Voce Rubrics

Unsatisfactory Satisfactory Good Excellent


Rubrics
(0-3) (4-6) (7-8) (9-10)

Understanding  Unable to  Poorly  Somehow  Comprehensivel


of principles explain the explains the explains the y explains the
and working working working working working
principle and principle and principle and principle and
working working working working
methodology methodology methodology methodology of
of the of the of the the program/
program/ program/ program/ algorithm.
algorithm. algorithm. algorithm.

3
ROBOTICS, LAB MANUAL

Lab Performance Evaluation Rubrics (Cognitive Assessment)

Unsatisfactory Satisfactory Good Excellent


Rubrics
(0-3) (4-6) (7-8) (9-10)

 No name, date,  Includes name,  Includes name,  Includes


or assignment date, and date, and name, date,
title included. assignment assignment title. and
 Poor use of title.  Good use of assignment
white space  White space white space. title.
(indentation, makes the  Organized  Excellent use
blank lines). program fairly work. of white
 Disorganized easy to read.  Good use of space.
and messy  Organized variables (no  Creatively
 Poor use of work. global variables, organized
variables  Good use of unambiguous work.
Coding (many global variables (few naming)  Excellent use
Standards and variables, global  … of variables
Efficiency ambiguous variables,  Solution is (no global
naming). unambiguous efficient and variables,
 … naming). easy to follow unambiguous
 A difficult and  … (i.e. no naming).
inefficient  A logical confusing  Use of proper
solution. solution that is tricks). comments.
easy to follow  User friendly.
but it is not the  …
most efficient.  Solution is
efficient, easy
to understand,
and maintain.

 Does not  Executes  Executes  Executes


execute due to without errors. without errors. without errors
errors.  User prompts  User prompts excellent user
 User prompts contain little are prompts, good
are misleading information, understandable, use of
or non- poor design. minimum use of symbols,
existent.  Some testing symbols or spacing in
Algorithm/  No testing has has been spacing in output.
codes’ working been completed. output.  Thorough and
on Runtime completed.  Thorough organized
testing has been testing has
completed been
completed and
output from
test cases is
included.
 Time efficient.

4
ROBOTICS, LAB MANUAL

Lab Report & Lab Manual Evaluation Rubrics

Unsatisfactory Satisfactory Good Excellent


Rubrics
(0-3) (4-6) (7-8) (9-10)

 Completed less  Completed  Completed  Completed


than 70% of the between 70- between 80- between 90-
requirements. 80% of the 90% of the 100% of the
 Not delivered requirements. requirements. requirements.
Delivery on time or not  Delivered on  Delivered on  Delivered on
in correct time, and in time, and in time, and in
format (disk, correct format correct format correct format
email, etc.) (disk, email, (disk, email, (disk, email,
etc.) etc.) etc.)

 No  Basic  Clearly  Clearly and


documentation documentation documented effectively
included. has been including documented
completed descriptions of including
including all variables. descriptions of
descriptions of  Specific all variables.
all variables. purpose is  Specific
Documentation  Purpose is noted for each purpose is
noted for each function and noted for each
function. control function,
structure. control
structure,
input
requirements,
and output
results.

 The lab  Lab Manual is  Lab manual is  Lab manual is


manual is made with less made with made with
incompletely sufficient sufficient excellent
made. effort. effort. effort.
Lab Manual  Poor/missing  May have  May have some  Well placed
contents like some missing errors in results/graphs
results/graphs contents in results/graphs and
and results/graphs, and organization,
organization, etc. organization, etc.
etc. etc.

5
ROBOTICS, LAB MANUAL

LAB. # 01

1 Title
Introduction to MATLAB, its environments and installation

1.1 Objective
 To install and activate MATLAB.
 To introduce MATLAB and its environments and working.

1.2 Background and Output/Results

MATLAB is a high-performance language for technical computing. It integrates computation,


visualization, and programming environment. Furthermore, MATLAB is a modern program tool and
environment: it has sophisticated data structures, contains built-in editing and debugging tools, and
supports object-oriented programming. These factors make MATLAB an excellent tool for teaching
and research.

The name MATLAB stands for MATrix LABoratory. MATLAB was written originally to provide
easy access to matrix software developed by the LINPACK (linear system package) and EISPACK
(Eigen system package) projects.

MATLAB Installation and activation:

"MATLAB is the high-level language and interactive environment used by millions of


engineers and scientists worldwide. It lets you explore and visualize ideas and collaborate
across disciplines including signal and image processing, communications, control systems,
and computational finance."

MATLAB is a language and an interactive environment for programming and numerical


calculation, analysis, and data visualization. It allows you to analyze data, develop
algorithms, create models as well as applications.

1.2.1 Retrieve Activation Key

The MATLAB Working Environment:


The MATLAB desktop is the main MATLAB application window. As Figure 1 shows the desktop
contains five sub windows:

1. The Command Window

6
ROBOTICS, LAB MANUAL

2. The Workspace Browser


3. The Current Directory Window
4. The Command history Window
5. And one or more Figure Windows

The Command Window is where the user type MATLAB Commands and expressions at the prompt
>> and where the output of those commands are displayed.

MATLAB defines the workspace as the set of variables that the user creates in a work session. The
Workspace Browser shows these variables and some information about them. Double Clicking on a
variable in the workspace browser launches the Array Editor, which can be used to obtain information
and, in some instances, edit certain properties of the variable

The Current Directory tab above the workspace tab shows the contents of the current directory, whose
path is shown in the Current Directory Window. For example, in the windows operating system the
path might be as follows:

C:\MATLAB\Work, indicating that directory “Work” is a subdirectory of the main directory

Figure 1: MATLAB Display


“MATLAB”, which is installed in drive C. Clicking on the arrow in the Current Directory Window
shows a list of recently used paths. Clicking on the button to the right of the window allows the user
to change the current directory.

The Command history Window contains a record of the commands a user has entered in the command
window, including both current and previous MATLAB sessions. Previously entered MATLAB
commands can be selected and re-executed from the command history window by right clicking on a
command or sequence of commands. This action launches a menu from which to select various
options in addition to executing the commands.

Getting Help:
The principal way to get help is to use the MATLAB Help Browser, opened as a separate window
either by clicking on the question mark symbol (?) on the desktop toolbar, or by typing help browser
at the prompt in the Command Window

>> help browser

[MATLAB help browser will be opened where you can get information about various topics]

The Help Browser consists of two panes, the help navigator pane, used to find information, and the

7
ROBOTICS, LAB MANUAL

display pane, used to view the information.

Search field also exists on the navigator pane where you can type either specific words, function
names or any phrase to get information which you are looking for:

Another way to get help for a specific function is by typing doc followed by the function name at the
command prompt. [e.g. typing doc format followed displays documentation for the function called
format in the display pane of the Help Browser]

Online help is available from the MATLAB prompt (a double arrow), both generally (listing all
available commands):

>> help
[A long list of help topics follows]
and for specific commands:

>> help fft

[A help message on the fft function follows. It contains both the H1 line and the help text for fft
function].

How to quit MATLAB:

The answer to the most popular question concerning any program is this: leave a MATLAB session
by typing ‘quit’ or by typing ‘exit’ to the MATLAB prompt.

Here are few additional useful commands:


 To clear the Command Window, type clc
 To abort a MATLAB computation, type ctrl-c
 To continue a line, type . . .

Using the MATLAB editor to create M-Files:

The MATLAB editor is both a text editor specialized for creating M-files and a graphical MATLAB
debugger. The editor can appear in the window by itself, or it can be a sub window in the desktop. M-
files are denoted by the extension .m as in introlab.m.

The MATLAB editor window has numerous pull-down menus for tasks such as saving, viewing and
debugging files. Because it performs some simple checks and uses colors to differentiate between
various elements of code, this text editor is recommended as the tool of choice for writing and editing
M-Functions

8
ROBOTICS, LAB MANUAL

To open the editor type, edit at the prompt in the command window.

M- Functions have two types of information that can be displayed by the user.

 The first is called the H1 line, which contains the function name and the one-line description.
 The second is a block of explanation called the Help text block.

9
ROBOTICS, LAB MANUAL

LAB. # 02

2 Title
Basic mathematics and loops in MATLAB

2.1 Objective
 Use of vectors and Matrix in MATLAB
 Use of conditions & loops in MATLAB

2.2 Background and Output/Results

Introduction to Vectors in MATLAB

This is the basic introduction to MATLAB. Creation of vectors includes a few basic operations.
Topics include the following:
 Defining a vector
 Accessing elements within a vector

Defining a Vector

MATLAB is a software package that makes it easier for you to enter matrices and vectors to
manipulate them. The interface follows a language that is designed to look a lot like the notation used
in linear algebra.
Almost all of MATLAB 's basic commands revolve around the use of vectors. A vector is defined by
placing a sequence of numbers within square braces:

>> v = [9 8 3 4 25 -45 6]

v=9 8 3 4 25 -45 6

This creates a row vector which has the label "v". The first entry in the vector is a 9 and the second
entry is a 8. Note that MATLAB printed out a copy of the vector after you hit the enter key. If you do
not want to print out the result, put a semi-colon at the end of the line:

>> v = [9 8 3 4 25 -45 6];

10
ROBOTICS, LAB MANUAL

If you want to view the vector just type its label:

>> v
v=
9 8 3 4 25 -45 6

Notice, though, that this always creates a row vector. If you want to create a column vector you need
to take the transpose of a row vector. The transpose is defined using an apostrophe (`):

>> v = [9 8 3 4 25 -45 6]’

v=
9
8
3
4
25
-45
6

Or you can use the transpose operator ( .’ )


>> w=v.’
w= 9
8
3
4
25
-45
6

To access block of elements, we use MATLAB’s colons notation, e.g. to access the first three
elements of v we write.
>> v (1:3)
ans =
9 8 3

11
ROBOTICS, LAB MANUAL

Similarly, to access the second through fourth elements of v we write


>> v (2:4)
ans =

8 3 4

Similarly, to access all elements from some specific location say the 3 rd through the last element.

>> v (3: end)


ans =
3 4 25 -45 6

>> v (:)
Produces a column vector.

v = 9
8
3
4
25
-45
6

>> v (1: end)


Produces a row vector.

Indexing is not restricted to contiguous elements.

>> v (1:2: end)


ans =
9 3 25 6

>> v (end: -2:1)


ans =
6 25 3 9

12
ROBOTICS, LAB MANUAL

A common task is to create a large vector with numbers that fit a repetitive pattern. MATLAB can
define a set of numbers with a common increment using colons. For example, to define a vector
whose first entry is 1, the second entry is 2, the third is three, up to 8 you enter the following:

>> v = [1:8]
v=
1 2 3 4 5 6 7 8

If you wish to use an increment other than one, you must define the start number, the value of the
increment, and the last number. For example, to define a vector that starts with 2 and ends in 4 with
steps of .25 you enter the following:

>> v = [2:.25:4]
v= Columns 1 through 7
2.0000 2.2500 2.5000 2.7500 3.0000 3.2500 3.5000 Columns 8 through 9
3.7500 4.0000

Accessing elements within a vector

You can view individual entries in this vector. For example, to view the first entry just type in the
following:

>> v(1)
ans =
2

This command prints out entry 1 in the vector. Also notice that a new variable called ANS has been
created. Any time you perform an action that does not include an assignment MATLAB will put the
label ANS on the result.

A vector can be used as an index into another vector. For example, we can pick the first, third sixth
and seventh elements of v using the command.

>> v ([1 3 6 7])

13
ROBOTICS, LAB MANUAL

v=
3 7 6 4

Introduction to Matrices in MATLAB

A basic introduction to defining and manipulating matrices is given here. It is assumed that you know
the basics on how to define and manipulate vectors using MATLAB.

Defining Matrices

Defining a matrix is like defining a vector. To define a matrix, you can treat it like a column of row
vectors (note that the spaces are required!):

>> A = [1 7 8; 9 4 2; 6 3 5]

A=
1 7 8
9 4 2
6 3 5

You can also treat it like a row of column vectors:

>> B = [ [1 5 3]' [2 8 7]' [3 4 9]']


B=
1 2 3
5 8 4
3 7 9

14
ROBOTICS, LAB MANUAL

If you have been putting in variables through this and the tutorial on vectors, then you probably have
a lot of variables defined. If you lose track of what variables you have defined, the WHOS command
will let you know all of the variables you have in your workspace.

>> whos
Name Size Bytes Class
A 3x3 72 double array
B 3x3 72 double array
v 1x5 40 double array
The grand total is 23 elements using 184 bytes.

You can work with different parts of a matrix, just as you can with vectors. Again, you have to be
careful to make sure that the operation is legal.

To extract the element in the 2nd row and 3rd column we write,
>> A (2,3)
ans =
2
The colon operator is used in the matrix indexing to select a two-dimensional block of elements out
of matrix:
>> C= A (: , 3) % this statement picks the third column of the matrix
C=
8
2
5

The colon operator can also be used in the matrix indexing to extract the row of the matrix

>> C= A (2, :) % this statement picks the 2nd row of the matrix
C=
9 4 2

>> A (1:2,2:3)

ans =

15
ROBOTICS, LAB MANUAL

7 8
4 2

To create a matrix B equal to A but with its last column set to 0’s we write
> B = A;
> B (:, 3) = 0
B=
1 7 0
9 4 0
6 3 0

>> A (end, end)


ans =
5

>> D = A ([1 3], [2 3])


D=
7 8
3 5

Matrix addressing can also be used in the following way


>> E = logical ([1 0 1; 0 1 1; 0 0 0])
E=
1 0 1
0 1 1
0 0 0

Now if we write.
>> A(E)
ans =
1
2

16
ROBOTICS, LAB MANUAL

The use of a colon is useful in finding the sum of all elements of a matrix.
>> s = sum (A (:))
s=
45 Some important standard arrays are:

For example,
>> A = 5 * ones (3, 3)
A=
5 5 5
5 5 5
5 5 5

>> magic (3)


ans =
8 1 6
3 5 7
4 9 2

Finally, sometimes you would like to clear all your data and start over. You do this with the "clear"
command. Be careful though, it does not ask you for a second opinion and its results are final.
>> clear

Conditional control (If, Switch)

This group of control statements enables you to select at run-time which block of code is executed. To
make this selection based on whether a condition is true or false, use the ‘if’ statement (which may
include else or elseif). To select from a number of possible options depending on the value of an
expression, use the switch and case statements.

if, else, and elseif

if evaluates a logical expression and executes a group of statements based on the value of the
expression. In its simplest form, its syntax is

if logical_expression
statements

17
ROBOTICS, LAB MANUAL

end

If the logical expression is true (1), MATLAB executes all the statements between the if and end
lines. It resumes execution at the line following the end statement. If the condition is false (0),
MATLAB skips all the statements between the if and end lines and resumes execution at the line
following the end statement.

For example,
You can nest any number of if statements.

switch, case, and otherwise.

Switch executes certain statements based on the value of a variable or expression. Its basic form is
switch expression (scalar or string)

case value1

statements % Executes if expression is value1


case value2
statements % Executes if expression is value2
.
.
.
otherwise
statements % Executes if expression does not
% match any case
End

This block consists of


 The word switch followed by an expression to evaluate.
 Any number of case groups. These groups consist of the word case followed by a possible value
for the expression, all on a single line. Subsequent lines contain the statements to execute for the
given value of the expression. These can be any valid MATLAB statement including another
switch block. Execution of a case group ends when MATLAB encounters the next case
statement or the otherwise statement. Only the first matching case is executed.
 An optional otherwise group. This consists of the word otherwise, followed by the statements to
execute if the expression's value is not handled by any of the preceding case groups. Execution
of the otherwise group ends at the end statement.
 An end statement.

18
ROBOTICS, LAB MANUAL

Loops

With loop control statements, you can repeatedly execute a block of code, looping back through
the block while keeping track of each iteration with an incrementing index variable. Use the “for
statement” to loop a specific number of times.

For Loop

The for loop executes a statement or group of statements a predetermined number of times.
Its syntax is
for index = initial: increment: final
statements
end

The default increment is 1. You can specify any increment, including a negative one. For positive
indices, execution terminates when the value of the index exceeds the end value; for negative
increments, it terminates when the index is less than the end value.

For example, this loop executes five times.

for n = 2:6
x(n) = 2 * x(n - 1);
end

You can nest multiple for loops.

for m = 1:5
for n = 1:100
A(m, n) = 1/(m + n - 1);
end
end

while Loop

The while loop executes a statement or group of statements repeatedly as long as the controlling
expression is true (1).

Its syntax is
while expression
statements
end

19
ROBOTICS, LAB MANUAL

If the expression evaluates to a matrix, all its elements must be 1 for execution to continue. To reduce
a matrix to a scalar value, use all and any functions.

For example, this while loop finds the first integer n for which n! (n factorial) is a 100-digit number.
And n = 1.

while prod(1:n) < 1e100


n = n + 1;
end

Exit a while loop at any time using the break statement.

Continue

The continue statement passes control to the next iteration of the ‘for’ or ‘while’ loop in which it
appears, skipping any remaining statements in the body of the loop. The example below shows a
continue loop that counts the lines of code in the file, skipping all blank lines and comments.

fid = fopen('magic.m', 'r');


count = 0;
while ~feof(fid) line = fgetl(fid);
if isempty(line) | strncmp(line, '%', 1)
continue
end
count = count + 1;
end
disp(sprintf('%d lines', count));

Break

The break statement terminates the execution of a “for loop” or while loop. When a break statement
is encountered, execution continues with the next statement outside of the loop. In nested loops, break
exits from the innermost loop only.
The example below shows a while loop that reads the contents of the file fft.m into a MATLAB
character array. A break statement is used to exit the while loop when the first empty line is
encountered.

The resulting character array contains the M-file help for the fft program.
fid = fopen('fft.m', 'r');
s = '';

20
ROBOTICS, LAB MANUAL

while ~feof(fid) line = fgetl(fid);


if isempty(line)
break
end
s = strvcat(s, line);
end
disp(s)

Task:

Write a MATLAB code of Factorial Program with the help of loop Constructs (Use For or While).

MATLAB CODE:

% Use a while loop to calculate factorial(5)


n=5;
f=n;
while n>1
n=n-1;
f=f*n;
end
disp(['n!=' num2str(f)])

21
ROBOTICS, LAB MANUAL

LAB. # 03

3 Title
Introduction to Simulink and Simscape library in MATLAB

3.1 Objective

Explore elements of Simulink and Simscape library and get used to it.

3.2 Background and Output/Results

22
ROBOTICS, LAB MANUAL

LAB. # 04

4 Title
Design a Robotic manipulator (rigid body tree) in Simulink (MATLAB)

4.1 Objective

Design a two-link manipulator (rigid body tree) having revolute joints and an end effector with fix
joint.

4.2 Background and Output/Results

To design a robotic manipulator using Simulink in MATLAB, follow these steps:

1. Open Simulink Environment: Open MATLAB and launch Simulink.

2. Access SimScape Toolbox: Ensure that SimScape Toolbox is installed and accessible in your
MATLAB environment.

3. Create a New Simulink Model: Open a new Simulink model by selecting "File" -> "New" ->
"Model".

4. Add Necessary Blocks

5. Add Required Blocks for Model Configuration

6. Design the Base of the Robot

7. Add Joints and Links

8. Complete the Robot

9. Run the Simulation: Run the Simulink model to visualize the robot's structure and verify its
correctness.

10. Debug and Iterate: If necessary, debug any errors or misalignments in the model, and iterate on
the design until the desired robotic manipulator is achieved.

23
ROBOTICS, LAB MANUAL

24
ROBOTICS, LAB MANUAL

25
ROBOTICS, LAB MANUAL

26
ROBOTICS, LAB MANUAL

LAB. # 05

5 Title
Design forward kinematics to simulate the Robot movement in Simulink (MATLAB)

5.1 Objective

Attach forward kinematics on previously designed robot to control the joints and simulate the robot
using sinusoid.

5.2 Background and Output/Results

To simulate the robot and perform forward kinematics based on the provided instructions, follow
these steps:

1. Create Simulink Model:

Start by creating a new Simulink model where you will simulate the robot and perform forward
kinematics.

2. Import Robot Model:

Use an m-file or script to import the robot model defined in Simulink, which contains the SimScape
model of the robot we Made in Lab 4.

ts = 0.001; % Sampling time (1 millisecond)

dof2_arm = importrobot('Rigidbodytree');

3. Configure Joint Properties:

Set up the joint properties for each joint in the robot:

Joint 1: Set limits (`-90` to `90` degrees), actuation (motion provided by input), and sensing
(position).

Joint 2: Set limits (`-60` to `60` degrees), actuation (motion provided by input), and sensing
(position).

27
ROBOTICS, LAB MANUAL

Then we make Subsystem of whole this Robot. And named that as ROBOT.

4. Generate Motion Commands:

Use sine wave generators to produce motion commands for each joint (`q1` for Joint 1 and `q2` for
Joint 2), respecting the joint limits.

5. Implement Forward Kinematics Algorithm:

 Get Transform Block: Use the "Get Transform" block from the Robotic System Toolbox.
 Configure the block with the rigid body tree (`dof2_arm`) and joint configuration signals
(`[q1, q2]`).
 Coordinate Transformation Block: Use a coordinate transformation block to extract the
end effector position from the homogeneous transformation matrix.

 Create Subsystem of above and named Forward Kinematics.

6. Visualization and Analysis:

 Scope: Set up a scope to visualize the results:


 Show joint positions (`q1` and `q2`) alongside the desired motion commands.
 Show the calculated end effector position (`x`, `y`, `z` coordinates).

7. Run Simulation:

Run the Simulink simulation to observe the robot's motion and the calculated end effector position
based on the provided joint commands.

8. Analysis:

Analyze the simulation results from the scope to verify that the robot follows the desired joint
motions and to observe the end effector's position.

9. Further Development:

Experiment with different trajectories, joint configurations, and robotic algorithms using the
Robotic System Toolbox and Simulink to explore more complex behaviors and functionalities.

28
ROBOTICS, LAB MANUAL

29
ROBOTICS, LAB MANUAL

30
ROBOTICS, LAB MANUAL

LAB. # 06

6 Title
Design inverse kinematics to move the robot on predefined trajectory in Simulink (MATLAB)

6.1 Objective

Attach inverse kinematics on previously designed robot to calculate the joints angles from the
coordinate values and simulate the robot by defining the trajectory using signal builder.

6.2 Background and Output/Results

To implement the described process of using inverse kinematics to move a robot on a predefined
trajectory in Simulink (MATLAB), follow this step-by-step design.

1. Rigid Body Tree Setup:

 Ensure you have a rigid body tree (`DOF2_arm`) representing your robot's kinematic structure,
defining its joint configuration and end effector.
 Load this tree into your MATLAB workspace for use in Simulink.

2. Model Initialization in Simulink:

 Create or open a Simulink model where you'll implement the trajectory generation and
inverse kinematics.
 Include necessary blocks and components for signal generation, inverse kinematics, and
visualization.

3. Trajectory Generation:

 Use a Signal Builder block to generate the trajectory defining the end effector's path.
 Configure the Signal Builder to produce custom signals for X, Y, and Z coordinates of the
end effector over time.

4. Preparing Input Signals for Inverse Kinematics:

 Connect the Signal Builder outputs to the inputs of a Coordinate Transformation


block using a mux of 3 inputs.
 Use this block to convert the X, Y, and Z trajectory signals into a homogeneous
transformation matrix (pose) required by the Inverse Kinematics block.

31
ROBOTICS, LAB MANUAL

5. Inverse Kinematics Configuration:

 Insert an Inverse Kinematics block into your Simulink model.


 Input the rigid body tree (`DOF2_arm`) representing your robot.
 Specify the target end effector body (e.g., tool) within the rigid body tree.
 Set solver options and parameters like weights for position/orientation
6. Joint Angle Calculation:

 Connect the output of the Coordinate Transformation block to the Inverse Kinematics block.
7. Visualizing Results:

 Use a Demux block to separate the joint angle outputs from the Inverse Kinematics
block.
 Implement a Forward Kinematics block to calculate and display the resulting end
effector positions.

8. Simulation and Verification:

 Run the simulation to observe the robot's movement along the predefined square
trajectory.

32
ROBOTICS, LAB MANUAL

33
ROBOTICS, LAB MANUAL

34
ROBOTICS, LAB MANUAL

LAB. # 07

7 Title
Design the trajectory using Signal editor for inverse kinematics of the robot in Simulink (MATLAB)

7.1 Objective

Use signal editor to design the input trajectory of the inverse kinematics on previously designed robot
to calculate the joints angles from the coordinate values and simulate the robot.

7.2 Background and Output/Results

Same as lab 6 just Replace Signal builder with signal Editor.

35
ROBOTICS, LAB MANUAL

LAB. # 08

8 Title
Design the modified robot (Mid Evaluation task)

8.1 Objective

Give details of your mid evaluation task with detailed parameters.

8.2 Background and Output/Results

Same as Lab 4 Just Dimensions Changes

36

You might also like