Sei sulla pagina 1di 17

Vidyalankar

B.E. Sem. VII [CMPN]


Robotics and AI
Prelim Question Paper Solution

1. (a) Uncertainty
One problem with first-order logic and thus with the logical agent approach is that agents almost
never have access to the whole truth about their environment.
Some sentences can be ascertained directly from the agents precepts and others can be inferred
from current and previous percepts together with knowledge about the properties of environment.

r
There will be important questions to which the agent can’t find a categorical answer. The agent

ka
must therefore act under uncertainty
 Uncertainty can also arises because of incompleteness and incorrectness in the agent’s
understanding of properties of the environment.
 Uncertainty means that many of the simplifications that are possible with deductive interfaces
are no longer valid.
 Uncertainty arises because of both laziness and ignorance. It is inescapable in complex,
dynamic or in-accessible world.

1. (b) Precision
an
It is the measure of spatial resolution with which the tool can be positioned within the work space
envelope.
Example  The tool tip is positioned at position A and the next closest position that it can be
moved is B, then precision along that direction is the distance between, point A and B.
Accuracy
al
It is the measure of ability of robot to place the tool tip at an arbitrarily prescribed location in
work envelope.
Repeatability is always < accuracy.

Repeatability
dy

It is the measure of ability of the robot to position the tool tip in the same place repeatedly or the
ability of robot to do the same job again and again repeatedly and then come back to its original
position.
For Cartesian coordinate robot overall precision is uniform.
For Cartesian coordinate robot, cylindrical robot and SCARA robot vertical precision is uniform.
Vi

1. (c) Kinematic Parameters


Joint K Joint K+1
xk
Link K
yk1
k1
z
dk k Link K

yk1
zk1 qk
k1 k
x
Link Diagram
Joint Diagram
k: Joint Angle
1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 1
Vidyalankar : B.E.  RAI

[k, dk, qk, k]


Always asked  Mostly as Compulsory question
EQ: Define / Derive
Qk (Joint Angle):

It is amount of rotation about zk1 to make xk1 parallel with Xk


Dk (Joint distance):
It is amount of translation along Zk1 to make Xk1 intersect with Xk.
k (Link Twist Angle):
It is amount of rotation about Xk to make Zk1 parallel with Zk.
Qk (Link Length):

r
It is amount of translation along Xk to make Zk1 intersect with Zk.
For Revolute joint: QK is variable.

ka
For Prismatic joint :  dk is variable.
4  Operations
1) K: Joint Angle Rot (k, ZK1)
Screw (dk, k,Zk1)
2) dk : Joint Distance Trans (dk, Zk1)
3) k : Link Twist Angle Rot (k, Xk)
4) qk : Link length Trans(dk, xk) Screw (qk, k, Xk)
an
Tkk1 = Screw (dk, Qk, Zk1)
Cosk Sink 0 : 0  1
Screw (qk, k, Xk)
0 0 :qk 
 Sink Cos 0 : 0   0 Cos k Sin  k : 0 
    
 0 0 1 : dk   0 Sin   Cos k : 0 
   
 0 0 0 : 1  0 0 0 :1
al
Cosk Sink.Cos  k Sink.Sin   k :qkCos 
 Sink Cosk.Cos  k Cosk.Sin   k : qkSin 
 
 0 Sin  k Cos  k : dk 
 
 0 0 0 : 1 
dy

Home configuration values are the values of joint variable a reset or initial configuration.
If these values are multiple of /2 it is otherwise, Hard home configuration.

1. (d) EQ: Define yaw / Pitch / Roll


Vi

f3
ROLL

PITCH
f2

RHOCF: Right Handed Orthonormal yaw


Coordinate Frame
f1
2 1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI
Prelim Question Paper Solution

Yaw: It is defined as “rotation about first axis”


Pitch: It is defined as “rotation about second axis”
Roll: “Rotation about third axis”

To specify tool orientation, a mobile tool coordinate frame M = {m1, m2, m3} is attached to the
tool and moves with the tool. Here m3 is aligned with the principal axis of the tool and points
away from the wrist. Next, m2 is parallel to the line followed by the fingertips of the tool as it
opens and closes. Finally, ml completes the right-handed tool coordinate frame M.

By convention, the yaw, pitch, and roll motions are performed in a specific order about a set of
fixed axes. Initially, the mobile tool frame M starts out coincident with a fixed wrist coordinate
frame F = {f1, f2, f3} attached at the end of the forearm. First the yaw motion is performed by
rotating the tool about wrist axis f2. Next, the pitch motion is performed by rotating the tool about

r
wrist axis f2. Finally, the roll motion is performed by rotating the tool about wrist axis f3. In each
case positive angles correspond to counterclockwise rotations as seen looking along the axis back

ka
toward the origin.

The order in which the yaw, pitch, and roll motions are performed is significant because it affects
the final orientation of the tool. For example, a yaw of /2 followed by a pitch of /2 yields a
different final tool orientation from the orientation produced by a pitch of /2 followed by a yaw
of /2. Thus, implicit in the YPR convention is the order of rotations summarized in Table 1.
an Table 1 : Yaw, Pitch, And Roll Motion
Operation Description Axis
1 Yaw f1
2 Pitch f2
3 Roll f3

An alternative way to specify the YPR motions is to instead perform the rotations in reverse order
al
about the axes of the mobile tool frame M rather than the fixed wrist frame F. That is, first a roll
motion is performed about m3, then a pitch motion is performed about m2, and finally a yaw
motion is performed about m1. This is equivalent to performing the rotations about the axes of the
fixed wrist frame F in the original YPR order, in the sense that the tool ends up at the same
orientation. For this reason, the YPR system is often referred to as the RPY system. A sequence
dy

of rotations about the mobile frame M axes is often easier to visualize, particularly when the
angles are not multiples of /2.

2. (a) Compare Electrical, Hydraulic and Pnemuatic Drive Robots

Electrical Drive Robot Hydraulic Drive Robot Pneumatic Drive Robot


1) Based on Electrical supply Based on Fluids / oils Based on Air Actuator.
Vi

(voltage/current) (Diesel / Petrol) Similar to


eg: Stepper Motor/ DC cranes
Motor
2) Low / Medium load Heavy load Not popular in ‘Robotics
used only at Gripper’ to
manipulate delicate objects
3) No leakage problem; clean Leakage of oil; cleanliness Large size; needs Air Pump /
Environment is a problem. Compressor
4) Better Accuracy / Poor Accuracy/ Costly; Poor Accuracy /
Controllability Controllability Controllability
5) Electronics Industry PCB Heavy Engineering Only a few joints.
Assembly / IC Industry to carry molten
Manufacturing steel, Material handling
1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 3
Vidyalankar : B.E.  RAI

2. (b) A general model of learning agents

r
ka
Fig. 1 : A general model of learning agents

A learning agent is divided into four conceptual components i.e. learning element performance
element, problem generator, critic as shown in below. The learning element is responsible for
an
making improvement. The performance element is responsible for selecting external action. It
takes in percepts and decides on actions. The learning element takes some knowledge about the
learning element and some feedback on how the agent is doing, and to tell determine how the
performance element should be modified to do better in future. The design of learning element
depends on the design of the performance element. The critic is designed to tell the learning
element how well the agent is doing. The critic employ's fixed standard of performance.

Since the percepts do not provide indication of the agents success therefore the critic is necessary.
al
For example, a chess program may receive a percept indicating that it has check mated its
opponent, but it needs a performance standard to know that this is a good thing the percept itself
does not say so. It is important that the performance standard is a fixed measure that is outside the
agent; otherwise the agent could adjust its performance standards to meet its behavior. The last
component of the learning agent is the problem generator. Problem generator is responsible for
dy

suggestion action that will lead to new and informative experiences. The point is that if the
performance element had its way, it would keep doing the action that are best, given what it
knows. But if the agent is willing to explore a little, and do some perhaps suboptimal action in the
short run it might discover much better action for the long run?
Consider a example of the automated taxi:
a) The performance element consists of whatever collection of knowledge and procedures the
Vi

taxi has for selecting its driving action i.e. Turning, accelerating, braking, honking etc. The
taxi runs and drives, using this performance element.
b) The learning element formulate goals i.e. To learn better rules describing the effects of
braking and accelerating, to learn the geography of the area, to learn how the taxi bravest on
different conditions of the road the road is wet etc.
c) The critic observes the world and passes information along to the learning element.
For example, after the taxi makes a quick left turn across three lanes of traffic, the critic observes
shocking language used by other drivers, the learning element is able to formulate a rule saying
this was a bad action, and the performance element is modified by installing the new rule. The
problem generator gives suggestion for e.g. It tells which route is faster and better. The learning is
also responsible for improving the efficiency of the performance element. For example, when
asked to make a trip to a new location, the taxi driver may take some time to consult its map and
plan the best route. Next time a similar trip will be faster. This is called seed up learning.
4 1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI
Prelim Question Paper Solution

Various methods of Learning are as follows :


1) Supervised learning
2) Unsupervised learning
3) Reinforcement learning
4) Inductive learning

3. (a) Work-Envelope Geometries


The end-effector, or tool, of a robotic manipulator is typically mounted on a flange or plate
secured to the wrist of the robot. The gross work envelope of a robot is defined as the locus of
points in three-dimensional space that can be reached by the wrist. We will refer to the axes of the
first three joints of a robot as the major axes. Roughly speaking, it is the major axes that are used
to determine the position of the wrist. The axes of the remaining joints, the minor axes, are used
to establish the orientation of the tool. As a consequence, the geometry of the work envelope is

r
determined by the sequence of joints used for the first three axes. Six types of robot joints are
possible (Fu et al., 1987). However, only two basic types are commonly used in industrial robots,

ka
and they are listed in Table 1.

Table 1 : Types of Robot Joints


Type Notation Symbol Description
Revolute R an Rotary motion about an axis

Prismatic P Linear motion along an axis

Revolute joints (R) exhibit rotary motion about an axis. They are the most common type of joint.
The next most common type is a prismatic joint (P), which exhibits sliding or linear motion
along an axis. The particular combination of revolute and prismatic joints for the three major axes
determines the geometry of the work envelope, as summarized in Table 2. The list in Table 2 is
not exhaustive, since there are many possibilities, but it is representative of the vast majority of
al
commercially available robots. As far as analysis of the motion of the arm is concerned, prismatic
joints tend to be simpler than revolute joints. Therefore the last column in Table 2, which
specifies the total number of revolute joints for the three major axes, is a rough indication of the
complexity of the arm.
dy

Table 2 : Types of Robot Joints


Robot Axis 1 Axis 2 Axis 3 Total revolute
Cartesian P P P 0
Cylindrical R P P 1
Spherical R R P 2
SCARA R R R 2
Articulated R R R 3
Vi

P = prismatic, R = revolute

1) Cartesian Robot [PPP] {Gantry Robot}


For the simplest robot listed in Table 2, the three major axes are all prismatic; the resulting
notation for this configuration is PPP. This is characteristic of a Cartesian-coordinate robot,
also called a rectangular- coordinate robot. An example of a Cartesian-coordinate robot is
shown in Fig. 1. Note that the three sliding joints correspond to moving the wrist up and
down, in and out, and back and forth. It is evident that the work envelope or work volume
that this configuration generates is a rectangular box. When a Cartesian-coordinate robot is
mounted from above in a rectangular frame, it is referred to as a gantry robot.

1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 5
Vidyalankar : B.E.  RAI
P

Work Envelope
P Rectangular

r
Fig. 1 : Cartesian robot.

ka
BASE
Application: Material Handling

2) Cylindrical Robot [RPP]


If the first joint of a Cartesian-coordinate robot is replaced with a revolute joint (to form the
configuration RPP), this produces a cylindrical-coordinate robot. An example of a
an
cylindrical-coordinate robot is shown in Fig. 2. The revolute joint swings the arm back and
forth about a vertical base axis. The prismatic joints then move the wrist up and down along
the vertical axis and in and out along a radial axis. Since there will be some minimum radial
position, the work envelope generated by this joint configuration is the volume between two
vertical concentric cylinders.
P
al
P
Work Envelope-cylindrical

R
dy

BASE
Fig. 2 : Application: Limited
workspace- Pharmaceutical industries
3) Spherical Robot [RPP]
Vi

R P
Work Envelope
sphere

BASE
Fig. 3 : Spherical robot.
Application: Spray Painting
6 1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI
Prelim Question Paper Solution

If the second joint of a cylindrical-coordinate robot is replaced with a revolute joint (so that
the configuration is then RRP), this produces a spherical-coordinate robot. An example of a
spherical-coordinate robot is shown in Fig. 3. Here first revolute joint swings the arm back
and forth about a vertical base axis, while the second revolute joint pitches the arm up and
down about a horizontal shoulder axis. The prismatic joint moves the wrist radially in and
out. The work envelope generated in this case is the volume between two concentric spheres.
The spheres are typically truncated from above, below, and behind by limits on the ranges
travel of the joints.

4) SCARA Robot [RPP]


Selective Compliance
Assembly Robot Arm

r
ka
P
R
R

an
Application: Semiconductor Industry and IC
manufacturing / PCB assembly
Fig. 4 : SCARA robot

Like a spherical-coordinate robot, a SCARA robot (Selective Compliance Assembly Robot


Arm) also has two revolute joints and one prismatic joint (in the configuration RRP) to
position the wrist. However, for a SCARA robot the axes of all three joints are vertical, as
shown in Fig. 2. The first revolute joint swings the arm back and forth about a base axis that
can also be thought of as a vertical shoulder axis. The second revolute joint swings the
al
forearm back and forth about a vertical elbow axis. Thus the two revolute joints control
motion in a horizontal plane. The vertical component of the motion is provided by the third
joint, a prismatic joint which slides the wrist up and down. The shape of a horizontal cross
section of the work envelope of a SCARA robot can be quite complex, depending upon the
limits on the ranges of travel for the first two axes.
dy

R
Vi

All Rotary Joints Fig. 5 : Articulated robot.


Similar to Human Arm W.E. = Complex combination
Hence called Anthropomorphic of two sphere
Versatile Robot  All Applications

1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 7
Vidyalankar : B.E.  RAI

When the last remaining prismatic joint is replaced by a revolute joint (to yield the
configuration RRR), this produces an articulated-coordinate robot. An articulated-coordinate
robot is the dual of a Cartesian robot in the sense that all three of the major axes are revolute
rather than prismatic. The articulated-coordinate robot is the most anthropomorphic
configuration; that is, it most closely resembles the anatomy of the human arm. Articulated
robots are also caWed revolute robots. An example of an articulated-coordinate robot is
shown in Fig. 5. Here thef first revolute joint swings the robot back and forth about a vertical
base axis. The second joint pitches the arm up and down about a horizontal shoulder axis, and
the third joint pitches the forearm up and down about a horizontal elbow axis. These motions
create a complex work envelope, with a side-view cross section typically being crescent-
shaped.

3. (b) Inference in Belief Networks

r
The basic task for any probabilistic inference system is to compute the posterior. Probability
distribution for a set of query variables, given exact values for some evidence variables. In

ka
general, an agent gets values for evidence variables form its percepts and asks about the possible
values of other variables so that it can decided what action to take.

The nature of probabilistic inferences


Belief networks are not limited to diagnostic reasoning and in fact can make four distinct kinds of
inferences :
i) Diagnostic inferences : From effects to causes
an
Given that John Calls, infer that P(Burglary | John Calls) = 0.016
ii) Causal inference : From causes to effects
Given Burglary, P(Burglary | John Calls) = 0.86 and P(Mary Calls | Burglary) = 0.67
iii) Inter causal inferences : Between causes of a common effect
Given Alarm, P(Burglary | Alarm) = 0.376
But if the evidence that earthquake is true is added then P(Burglary | Alarm | Earthquake)
goes down to 0.003.
iv) Mixed inferences : Combining two or more of the above inferences :
al
Setting the effect johnCalls to truth and the cause Earthquake to false gives
P(Alarm | johnCalls |  Earthquake) = 0.03
that is, it is the simultaneous use of diagnostic and causal inference.
P(Burglary | Alarm |  Earthquake) = 0.017
dy

This is the combination of Inter causal and diagnostic inference. Belief network can also be
used for the following :
Making decisions based on probabilities in the network and on the agents utilities. Deciding
which additional evidences variables should be observed in order to gain useful information.
Performing sensitivity analysis to understand which aspects of the model have the Greatest
impact on the query variables. Explaining the results of probabilistic inference to the user.
Vi

4. (a) We can use the following prepositional symbols in above set of facts.
P : Rimi is Hungry
Q : Rimi is barks
R : Raja is angry

i) Now represent sentence in prepositional logic.


a) P
b) P  Q
c) Q  R

ii) Now we want to prove : Raja is angry i.e. R


Hence, negate the condusion i.e. R

8 1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI
Prelim Question Paper Solution

{P, PVQ, QVR, R}


 indicates that R is false.
i.e. negation of conclusion is false.
Hence assertion is true.

4. (b) The Wumpus World Environment


The Wumpus world is a simple environment class that provides motivation for logical reasoning.
Wumpus was an early computer game, based on an agent which explores a cave consisting of
rooms connected by passage ways. Hanging out somewhere in the cave is the Wumpus a beast
that's eats everyone who enters its room.

To make matters worse, some rooms contain bottomless pits that will trap anyone who wanders
into these rooms (except for the wumpus, who is too bit to fall in. The justifying feature of the

r
wumpus world environment is the occasional heap of golds.

ka
Specifying the Environment
The Wumpus world is a grid of squares surrounded by walls; each square can contain agents and
objects. The agent always starts in the lower left corner, a square with label [1, l]. The agent's task
is to find the gold, return to [1, 1] and climb out of the cave.

Consider the following figure.


an
al
dy

Fig. 1 : The Wumpus world

To specify the agent's task specify its percepts, actions, and goals. In the Wumpus world the
following steps must be considered:
 In the square containing the wumpus and in the directly adjacent square, which is not
diagonal, the agent will perceive a stench.
Vi

 In the squares directly adjacent to a pit, the agent will perceive a breeze.
 In the square where there is gold, the agent will perceive a glitter.
 When an agent walks into a wall, it will perceive a bump.
 When the wumpus is killed, it gives out a mournful scream that can be perceived anywhere in
the cave.
 The percepts will be given to the agent in the form of five symbols; for example, if there is a
stench, a breeze, and a glitter but not bump and scream, the agent will receive the percept.
[Stench, Breeze, Glitter, None, None]. The agent cannot perceive its own location.
 The agent uses Grab action to pick up an object in the same square as the agent. There are
actions to go forward, turn right by 90°, and turn left by 90°.The agent uses Shoot action to
fire an arrow in a straight line in the direction in which agent is facing. The arrow continues
until the wumpus is hit or killed or the wall is hit. Climb action is used to leave the cave
which is effective only when the agent is in the start square.

1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 9
Vidyalankar : B.E.  RAI

 The agent dies if it enters a square containing a pit or live wumpus. It is safer to enter a
square with a dead Wumpus.
 The agent’s goal is to find the gold and bring it back to the start as soon as possible without
being killed.
An agent does well in a single environment merely by memorizing the sequence of actions that
happen to work in that environment. To provide a real test specify a complete class of
environments, and insist that the agent does well over the whole class.

5. (a) Inductive Learning


In supervised learning, the learning element is given the correct value of the function for particular
inputs, and changes its representation of the function to try to match the information provided by the
feedback. For example- pair (x, f(x)), where x is the input and f(x) is the output of the function
applied to x. The task of pure inductive inference (or induction) is that given a collection of examples

r
of ‘f’, return a function ‘h’ that approximates f. The function ‘h’ is called hypothesis.

ka
Consider an example of plane geometry.

an
Fig. : In (a) we have some example (input, output) pairs. In (b), (c), and (d) we
have three hypotheses for functions from which these examples could be drawn.
a) The (input,output) pairs are (x, y) points in the plane, where y = f(x), and the task is to find a
function h(x) that fits the points well.
al
b) In fig.(b) is a piece wise linear h function.
c) In fig. (c) it is a more complicated h function. Both functions agree with the example points,
but differ on the y values they assign to other x inputs.
d) In fig. (d) it have a function that apparently ignores one of the example points, but fits the
others with a simple function.
dy

A Bias is any preference for one hypothesis over another, beyond the consistency with the
examples. There are always a large number of possible consistent hypothesis so all learning
algorithms exhibit some bias. The agent could perform incremental learning & instead of
applying the learning algorithm to the entire set of examples each time a new prediction is
needed. The agent should update its old hypothesis whenever a new example arrives.
The agent might receive some feedback concerning the quality of the actions it chooses. The
design of learning algorithms for belief networks is also very important. In learning there is a
Vi

fundamental tradeoff between expressiveness which is the desired function representable in the
representation languages and efficiency which is the learning problem going to be tractable for a
given choice of representation language.

5. (b) PROLOG
Prolog is a general purpose logic programming language associated with A.I. and computational
linguistics. Prolog has its roots in first-order-logic a formal logic and unlike many other
programming languages. Prolog is declaration : the program logic is expressed in terms of
relations, represented as facts and rules to computation is initiated by running a query our there
relations.

Prolog was one of the first logic programming languages, and remains among the most popular
such languages today, with many free and commercial implementations available while initially
10 1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI
Prelim Question Paper Solution

aimed at natural language processing, the language has since the stretched for into other areas like
theorem processing, expert systems, games, automated answering systems, antologies and
sophisticated control systems, modern prolog environment support creating graphical user
interfaces as well as administrator and networked applications.

Features of Prolog
1. Stand alone Programs: With prolog we can compile stand – alone programs that will execute on a
machine that is not running turbo prolog. These stand-alone programs can be sold or distributed to
users without paying any royalties to its developer Borland International.
2. Trace Mode of Execution: We can use the trace mode with our program to watch it execute
a step at a time. In this mode, the program will begin to execute and then pause with a menu
at the bottom of the screen. We can then use the F10 key to execute the program one step at a

r
time.
3. Fail predicate for controlled execution : In prolog, forcing a rule to fail under certain

ka
conditions is a type of control and is essential to good programming failure can be forced in
any rule by using the built-in fail predicate. The fail forces backtracking in an attempt to
unify with another clause. Whenever this predicate is invoked, the goal being proved
immediately fails and backtracking is initiated.
4. Backtracking : The solution of compound goal proceeds from left to right. If any condition
in the chain fails, prolog backtracks to the previous condition, tries to prove it again with
another variable binding, and then moves forward again to see if the failed condition will
an
succeed with the new binding.
5. The Cut: The primary purpose of the cut is to prevent or block backtracking based on a
specified condition. This is to eliminate certain search paths in the problem space. The cut
acts like a fence where it is placed in the program. We cannot backtrack beyond the cut. In
some cases it serves a procedural function. The program will not work without it. In other
cases it serves a heuristic function. The program will work without it, but the cut eliminates
al
the need to test irrelevant paths and thus speeds up the execution.
6. Recursion: Recursion is a technique in which something is defined in terms of itself. In
prolog, recursion is the technique of using a clause to invoke a copy of itself. Recursion is
one of Prolog's most important execution control techniques. It is often used with the fail or
the cut predicate.
dy

7. Compound Objects: With turbo prolog, we can create an object that contains other objects.
The resulting structure is called a compound object. For example for addresses address
(name, street, city, state, zip). This entire address can then be treated as a single object in a
predicate.
8. String Operations : The string type is any sequence of characters enclosed in quotation
marks. Turbo prolog has several built-in predicates for string operations. Using the string
Vi

operations predicates, we can join, or concatenate, strings and find substrings. The same
predicates also serve useful functions for testing relationships between strings. The operations
are concat, frontstr, str_len, frontchar, fronttoken, isname, upper-lower.
9. Dynamic Databases : A prolog program is a collection of facts and rules about a particular
knowledge domain. The program really is a database. During program execution facts
obtained from the user during the consultation session that apply only to the current
consultation are stored in the dynamic database. These database predicates are then updated
using one of turbo prolog’s built-in database predicates.
10. File Operations : We can greatly expand the size of our programs by storing data on a disk /
file. Turbo prolog contains several built-in predicates for reading files and writing to files.
Openwrite, closefile, openread, openappend, openmodify, etc. are some of the predicates used
for the same.

1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 11
Vidyalankar : B.E.  RAI

11. Windows, Graphics and Sound : We can create a window for our program at any time by
using the makewindow predicate. Several additional window predicates are removewindow,
clearwindow, cursor (Row, Column), Window-attr (Attr), gotowindow (windowNo), etc.
Various graphics predicates are graphics, text, dot, line, pencolor, penup, pendown, penpos,
forward, back, etc.
12. Interface to other languages : A functional interface to other languages is provided,
allowing procedural language support to be added to any prolog system.
13. Integrated Editor : An integrated editor is provided, making program development,
compilation, and debugging very easy.
14. Modular Programming : Prolog allows modular programming. When developing a large
program, we can break the parts down into several programs or modules. Here, we must

r
define a project file and then compile the programs using the project directive.
15. Controlling Overflow : If we write a very large program, we may find that when we compile

ka
the program we overflow the computer memory available for the internal code array. In
prolog, we can add a code directive to increase the space available for this array.
/ * Simple Turbo Prolog Program * /

domains
disease, indication = symbol
predicates

Clauses
an
symptom (disease, indication)

Symptom (chicken  pox, high fever)


Symptom (chicken  pox, chills)
Symptom (flu, chills)
Symptom (cold, mild – body - ache)
Symptom (flu, severe – body - ache)
al
Symptom (cold, runny - nose)
Symptom (flu, runny – nose)
Symptom (flu, moderate – cough)

6. Tool Configuration Vector (TCV W)


dy

Role / use / Significance TCV


TCV works as i/p to the inverse kinematics problem. It gives position of orientation of the tool.
Definition
 P 
 
CV = W  3  9m  
r .exp 
    
Vi


r3: Approach vector
qn: Roll Angle
Formation of TCV from the ARM matrix
 R11 R12 R13 P1 
R P2 
21 R 22 R 23
Tool
Arm Matrix = TBase 
 R 31 R 32 R 33 P3 
 
 0 0 0 1 
r1 Normal Vector
r2  Sliding Vector
r3  Approach Vector

12 1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI
Prelim Question Paper Solution

Reason for selecting r3 vector (Approach vector)


If we work back along approach vector by distance ‘dn’ we will reach at the wrist where inverse
kinematic problem can be simplified by dividing it into two smaller problems of finding major
unknown and minor unknown.
Roll Angle ‘qn’is encoded in approach vector by using exponential function, it is easily invertible by
natural log ‘|n’

How to obtain Roll Angle (qn)


 w4 
3  qn   
r . exp   W5 
    
 W6 
q 
 
1/2

r
2 2 2
exp  n   w 4  W5  W6
  

ka
q n n(w 24  W52  W62 )1/2 

IK Analysis of 4axis SCARA ADEPT  ONE

 IK Problem of 4Axis SCARA


Given
FIND Tool Configuration Vector
qER
Inverse
Kinematics
an WE R6

 q1  BA 1 
q  EA 2 
q 2
 q3  VE d 3 
 
al
q 4  TR 4 

Step 1 : Link Coordinate Diagram [LCD]

a1 a2
Elbow (2)1
dy

x x2
y2 VE (3)
y1 1 z2 d3
z
d1 x3
y3 3 Roll (4)
z d4
z0 y4
y0 4
x4 z
Vi

0 x0
Base (1)

Step 2 : Arm Matrix of SCARA


 C1 2 4 S1 2 4 0 a1c1  a 2 c1 2 
S C1 2 4 0 a1s1  a 2S1 2 
TBase 
Tool 1 2  4
 0 0 1 d 2  q 3  d 4 
 
 0 0 0 1 

1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 13
Vidyalankar : B.E.  RAI

Step 3 : Tool Configuration Vector


a1c1+a2c12  w1
a1s1+a2s12  w2
W= d1+q3 d4  w3
0  w4
0  w5
exp (q4/)  w6

a) To obtain / Extract Roll Angle (q4 = 4)


0 0
 
1/2
q n n w 24  w 52  w 62

r
q n n| W6 |

ka
(b) To obtain / Extract Vertical Extension (q3 = d3)
w3 = d1 q3 d4
q3  d1  d 4  w 3

(c) To obtain / Extract Elbow Angle (q2 = 2 )


W1 = a1c1+ a2c12
W2 = a1s1 + a2s12
an
W12  W22 a12 c12  a 22 C12 2  2a1a 2 C : C1 2  a12S12  a 22S12 2  2a1a 2S1S1 2
C1C12 +S1S12
= Cos (1= (1-2) = Cos (2)
= C2
w12  w 22 q12  a 22  2a1a 2 c2
w12  w 22  a12  a 22
c2 
al
2a1a 2
 W  w 2  a1  a 2 
2 2 2 2
Now q 2  2  arccos 1 
 2a1a 2 
dy

(d) To obtain / Extract Base Angle (q1 = 1)


W1 = a1c1+ a2c12
W2 = a1s1+a2s12
W1  a1c1  a 2 (c1c2  s1s 2 )
W2  a1s1  a 2  s1c 2  s 2 c1 
W1   a1  a 2 c2 c1   a 2s 2 s1
Vi

W2    a 2s 2 c1   a1  a 2 c2  s1
 W1  a1  a 2 c 2 a 2s 2  C1 
 W  a s 
a1  a 2 c 2   S1 
 2  2 2
(a s )w  (a  a c )w
S1  2 2 1 2 1 2 2 2 2 
(a1  a 2 c2 ) (a 2s 2 )  determinant
(a  a c )w  (a 2s 2 )w 2
C1  1 2 2 21 
(a1  a 2 c 2 )  (a 2s 2 ) 2 determinant
S1  (a s )w  (a1  a 2 c 2 )w 2 
q1  arctan 2 2 1 
C2  (a1  a 2 c 2 )w1  (a 2s 2 )w 2 

14 1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI
Prelim Question Paper Solution

7. (a) Applications of Robots


Robotic applications often involve simple, tedious, repetitive tasks such as the loading and unloading
of machines. They also include tasks that must be performed in harsh or unhealthy environments such
as spray painting and the handling of toxic materials. A summary of robot applications (Brody,1987)
is displayed in Table 1. Here the percentages listed in the second column represent snares of the
overall robot market in the United States for the year 1986. The size of the market in 1986, excluding
separate sales of vision systems, was $516 million (Brody, 1987).
Table 1 : U.S. Robot Market (1986)
Application Percent
Material handling 24.4
Spot welding 16.5
Arc welding 14.5

r
Spray painting and finishing 12.4
Mechanical assembly 6.2

ka
Electronic assembly 4.8
Material removal 4.5
Inspection and testing 2.9
Water jet cutting 2.7
Other 11.1
Traditional applications of material handling, welding, and spray painting and finishing continue
to dominate. The market share of assembly applications, both mechanical and electrical, has
an
grown steadily over the past decade, and there is clearly potential for more applications in this
area. However, the general assembly problem has turned out to be quite challenging. The
assembly process can be modeled as a sequence of carefully planned collisions between the
manipulator and the objects in its workspace. The delicate motion control that is required for
assembly tasks dictates the use of feedback from external sensors. This allows the robot to adapt
its motion in order to compensate for part tolerances and other uncertainties in the environment.
Often customized fixtures and jigs are used to secure parts and present them to the robot at known
al
positions and orientations (Boyes, 1985). This has the effect of reducirg uncertainty, but it can be
an expensive approach.

7. (b) Compare DK and IK (all points)


 What are properties of IK( 4 and 5)
dy

 What are conditions on existence of IK


Direct Kinematics Inverse Kinematics
1) Definition Definition
2) Mapping from Rn  R6 Mapping R6 Rn
3) Takes from Joint space to Takes from Tool Configuration space to Joint
tool configuration space space
4) Existence of DK is IK solutions are conditional
Vi

guaranteed. a) Tool position should be within the workspace of the robot


b) Joint constraints should not be violated.
5) DK soln are unique IK solutions are not unique. We get multiple solutions
(eg: elbowup and elbowdown)
(For Kinematically redundant robot (n>6) we get infinite
solutions).
6) DK is needed to solve IK For actual operations, IK is needed.

7. (c) Goal-based agents


Knowing about the current state of the environment is not always enough to decide what to do.
For example, at a road junction, the taxi can turn left, turn right, or go straight on. The correct
decision depends on where the taxi is trying to get to. In other words, as well as a current state
description, the agent needs some sort of goal information that describes situations that are

1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 15
Vidyalankar : B.E.  RAI

desirable—for example, being at the passenger's destination. The agent program can combine this
with information about the results of possible actions (the same information as was used to update
internal state in the reflex agent) in order to choose actions that achieve the goal. Figure 13 shows
the goat-based agent's structure.

Agent Sensors
State
What the world is
How the world evolves like now

Environment
What the world is
What my actions do
like now

r
What action I

ka
Goals
should do now

Actuators

Fig. 13 :A model-based, goal-based agent. It keeps track of the world state


as well as a set of goals it is trying to achieve, and chooses an actions that
an
will (eventually) lead to the achievement of its goals.
Sometimes goal-based action selection is straightforward, when goal satisfaction results immediately
from a single action. Sometimes it will be more tricky, when the agent has to consider long sequences
of twists and turns to find a way to achieve the goal. Search and planning are the subfields of AI
devoted to finding action sequences that achieve the agent's goals.

Notice that decision making of this kind is fundamentally different from the condition-action
al
rules described earlier, in that it involves consideration of the future—both "What will happen if I
do such-and-such?" and "Will that make me happy?" In the reflex agent designs, this information
is not explicitly represented, because the built-in rules map directly from percepts to actions. The
reflex agent brakes when it sees brake lights. A goal-based agent, in principle, could reason that if
the car in front has its brake lights on, it will slow down. Given the way the world usually
dy

evolves, the only action that will achieve the goal of not hitting other cars is to brake.
Although the goal-based agent appears less efficient, it is more flexible because the knowledge
that supports its decisions is represented explicitly and can be modified. If it starts to rain, the
agent can update its knowledge of how effectively its brakes will operate; this will automatically
cause all of the relevant behaviors to be altered to suit the new conditions. For the reflex agent, on
the other hand, we would have to rewrite many condition-action rules. The goal-based agent's
behavior can easily be changed to go to a different location. The reflex agent's rules for when to
Vi

turn and when to go straight will work only for a single destination; they must all be replaced to
go somewhere new.

7. (d) The 8-queens problem


The goal of the 8-queens problem is lo place eight queens on a chessboard such that no queen
attacks any other (A queen attacks any piece in the same row, column or diagonal). Figure below
shows an attempted solution that fails: the queen in the rightmost column is attacked by the queen
at top left.

Although efficient special-purpose algorithms exist for this problem and the whole n-queens
family, it remains an interesting test problem for search algorithms. There are two main kinds of
formulation. The incremental formulation involves placing queens one by one, whereas the
complete-state formulation starts with all 8 queens on the board and moves them around. In either
16 1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI
Prelim Question Paper Solution

case, the path cost is of no interest because only the final state counts; algorithms are thus
compared only on search cost. Thus, we have the following goal test and path cost:
 Goal test: 8 queens on board, none attacked.
 Path cost: zero.

r
ka
Fig. 1 : Almost a solution to the 8-queens problem

There are also different possible states and operators. Consider the following simple-minded
formulation:
 States: any arrangement of 0 to 8 queens on board.
an
 Operators: add a queen to any square.

In this formulation, we have 64 possible sequences to investigate. A more sensible choice would
use the fact that placing a queen where it is already attacked cannot work, because subsequent
placings of other queens will not undo the attack. So we might try the following:
 States: arrangements of 0 to 8 queens with none attacked.
 Operators: place a queen in the left-most empty column such that it is not attacked by any
al
other queen.

It is easy to see that the actions given can generate only states with no attacks: but sometimes no
actions will be possible. For example, after making the first seven choices (left-to-right) in the
figure, there is no action available in this formulation. The search process must try another
dy

choice. A quick calculation shows that there are only 2057 possible sequences to investigate. The
right formulation makes a big difference to the size of the search space. Similar considerations
apply for a complete-state formulation. For example, we could set the problem up as follows:
 States: arrangements of 8 queens, one in each column.
 Operators: move any attacked queen to another square in the same column-.

This formulation would allow the algorithm to find a solution eventually, but it would be better to
Vi

move to an unattacked square if possible.



1113/Engg/BE/Pre Pap/2013/CMPN/Soln/RAI 17

Potrebbero piacerti anche