View with images and charts Automation and Robotics Robot: Robot is a software controllable mechanical device that uses sensors to guide its end effectors through programmed motion in a work space in order to manipulate physical object. Robot Classification: (Drive Technology) Electric Drive Hydraulic Drive Electric Drive: Most robot manipulators today use electric drive in the form of DC or Servomotors, DC stepper motor etc. Hydraulic Drive: Hydraulic drive is preferred when high speed manipulation of substantial loads is molten steel handling or auto body part handling etc. Work Envelop Geometric: The gross work of a robot is defined as locus of points in three dimensional spaces that can be reached by the wrist. As a consequence the geometry of work envelops is determined by the sequence of joints used for first three axes. Six types of robot joints are possible. However only two basic types are commonly used in industrial robots, they are listed below. Types Revolute

Notation R

Prismatic

P

Symbol

Simplest Robot List: Cartesian Robot Cylindrical Robot Spherical Robot SCARA Robot Articulated Robot Cartesian Robot:

Description Rotary about an axis

Linear motion along an axis

3 2 1

Fig: Cartesian Robot In the Cartesian Robot the three major axes are all prismatic and the three sliding joints corresponding to moving the wrist up and down, in and out and back and forth. The work envelops and work volume that this configuration generates is a rectangular box. When a Cartesian co-ordinate robot is mounted above in a rectangular frame, it is referred to as a gantry robot. Cylindrical Robot: If the first joint of a Cartesian Robot is replaced by a revolute joint, this produces a cylindrical robot. The cylindrical robot joining the arm back and forth about a vertical base axis.

Work envelope geometry

Cylindrical Robot

Fig: Cylindrical Robot and its work envelop geometry The prismatic joint then move the wrist up and down along a vertical axis and in and out along a radial axis. There will be some minimum radial position. The work envelope generates by this configuration is volume between the two vertical concentric cylinders. Spherical Robot: If the second joint of a cylindrical co-ordinate robot is replaced with a revolute joint, this produces spherical co-ordinate robot. The first revolute joint joining the arm back and forth about a vertical base axis, where second revolute joint pitches the arm up and down about horizontal shoulder axis. The prismatic joint moves the wrist radially in and out. The work envelope generated in this case is the volume between the two vertical concentric spheres.

Fig: Spherical Robot SCARA Robot: SCARA (Selective Compliance Assembly Robot Arm). The two revolute joint and one prismatic joint. The axis of all three joints are vertical. The first revolute joint swing the arm back and forth about the base axis. The second revolute joint swing the fore arm back and forth along a vertical elbow axis. The third prismatic joint slides the wrist up and down.

2 3 1

Fig: SCARA Robot Articulated Robot: When the last remaining prismatic joint is replaced by revolute joint, this produces an articulated robot. An articulated robot is the dual of Cartesian Robot. The articulated robot is the most arthromorphic configuration, that is if most closely resembles, the anatomy of the human arm. Articulated robot are also called revolute robot. The first revolute joint swing the arm back and forth about a vertical base axis. The second revolute joint pitches the arm up and down about a horizontal axis. The third joint pitches the fore arm up and down about a horizontal elbow axis. These motion creates a complex work envelope.

Fig: Articulated Robot Example: Determine the work space ‘X’ of a 2 – arm hinge mechanism. The configuration space is given by θ

=

{θ

1

θ

2

0≤ θ 1≤ π ; 0≤ θ 2≤ π 2

Display the workspace graphically.

}

Y = Y0

X2

Y1

Y2

L2

P( X 2 , Y)

2

X1

L1

1 X = X0

Fig: Given Configuration Space.

Sol

n

According to the given configuration the work space is shown graphically as shown below.

Y

X L1

L2

Motion Control Method Motion Control Method: In motion control method the two types of movements as listed below: Point to point motion. Continuous path motion. Point to point motion: When the tool moves to a sequence of discrete point on the work space. For example spot welding is an application of point to point motion. Continuous path motion: The end effectors must follow a prescribed path in 3D space and the speed of along the path may vary. For example arc welding. Application of Robot: Material handling Spot welding Material removing Arc welding Spray painting and finishing Mechanical assembly Inspection and testing Basic Kinematics of Constrained Rigid Bodies: Degree of Freedom of a Rigid body in a Plane: The degree of freedom (DOF) of a rigid body is defined as a number of independent movements it has.

Y

X

To determine the DOF of this body in a two dimensional plane. There are 3 DOF. The bar can translated along X axis, translated along Y axis, and rotated about it centroid. Degree of Freedom of a rigid body in space:

An unrestrained rigid body in space has six degree of freedom. Three translating motions along the X,Y and Z axis and three rotary motions around the X,Y and Z axis respectively.

Y

X Z

Kinematic Constraints: We can hinder the motion of an independent rigid bodies with kinematic constrains. Kinematic constrains are constraints between rigid bodies that result in the decrease of the degrees of freedom of a rigid body system. Lower Pairs in Planar Mechanism:

Y

X

Fig: A planar revolute pair

A rigid body in a plane has only three independent motions â&#x20AC;&#x201C; two translations and one rotary. So introducing either a revolute pair or a prismatic pair between two rigid bodies removes two degree of freedom.

Y

X

Lower Pair in Special Mechanism:

A spherical pair keeps two spherical centers together. Two rigid bodies together. Two rigid bodies connected by this constraint will be able to rotate relatively around X, Y, Z axes, but there will be no relative translation along any of their axes. Therefore a spherical pair removes three degree of freedom in special mechanism. A Planar Pair:

A plane pair keeps the surface of two rigid bodies together. Two bodies connected by this kind of pair will have two independent translation motions in the plane and a rotary motion around the axis that is perpendicular to the plane. Therefore a plane pair removes three degree of freedom is special mechanism. Here in the figure the body has 3 DOF. Gruebler’s Equation: F =3( n −1) −2l −h

Where

F = Total degree of freedom n = Number of link l =Number of joint h =0

Example 01: Find the degree of freedom of the given mechanism in Fig: 01.

Sol

n

F =3( n −1) −2l −h

⇒ F = 3( 2 −1) − 2 ×1 − 0 =3−2 =1

n =2 l =1

Ans

Example 02: Find the degree of freedom of the given mechanism in Fig: 02.

Fig: 02

Sol

n

F =3( n −1) −2l −h ⇒ F = 3( 2 −1) − 2 ×1 − 0 =3−2 =1

n =2 l =1

Ans

Example 03: Find the degree of freedom of the given mechanism in Fig: 03.

C A

Fig: 03

Sol

n

F =3( n −1) −2l −h

B

D

n= 4

⇒ F = 3( 4 − 1) − 2 × 4 − 0 =1

l=4

Ans

Fixed and Movable Coordinate:

X

X

Z

Y

Z

Y

X .Y = XY Cosθ

m

f

3

P

3

Mobile Link Body

Revolute Joint

f

2

Base f

1

m

1

Fixed Link

F=

M=

{f

f

1

f

2

}

3

{m m m } 1

2

3

[ P] [ P.m1 [ P] = [ P. f 1 M

P.m3]

P.m2

=

P. f 31]

P. f 2

F

T T

[ P] = [ P ] F

A=

M

f m f m f m f m f m f m f m f m f m 1

1

1

2

1

3

2

1

2

2

2

3

3

1

3

2

3

3

Problem: Suppose the co-ordinates of the point P with respect to the mobile co-ordinate frame are measured and found to be

[ P] [0.6 M

=

0.5 1.4]

T

. What are

the co-ordinates of P with respect to the fixed co-ordinate frame f with the body in the position? [Given θ = π

Sol

n

[ P] = [ P ] F

⇒

[ P]

⇒

[ P]

⇒

2]

F

F

[ P]

0 = 1 0

M

F = −1 0 0

f m f m f m f m f m f m f m f m f m 1

1

1

2

1

3

2

1

2

2

2

3

3

1

3

2

3

3

0 0 1

0 −0.5 + 0 = 0.6 + 0 + 0 0 + 0 +1.4

0.6 0.5 1.4

0.6 0.5 1.4

[ P]

⇒

⇒

F

−0.5 = 0.6 1.4

[ P] [ −0.5 F

=

0.6 1.4]

T

Fundamental Rotation: Rotation Matrix:

f3 m 3 3 2 1 f1 m 1

f2 m 2

If the mobile coordinate frame M is obtained from a fixed coordinate frame F by rotating M about one of the unit vector of F, then the resulting coordinate transformation matrix is called a fundamental rotation matrix. Example

m3

f3

m2

f2

f1 m 1

R1 ( φ ) = 1 R1 (φ) = 0 0

f m f m f m f m f m f m f m f m f m 1

1

1

2

1

3

2

1

2

2

2

3

3

1

3

2

3

3

0 − Sinφ Cosφ

0 Cosφ Sinφ

f3

m3

f2 m 2

f1 m1 Cosφ R2 (φ) = 0 − Sinφ

0 1 0

Sinφ 0 Cosφ

f3 m

3 m

2

f2

f1 m1 Cosφ R3 (φ) = Sinφ 0

− Sinφ Cosφ 0

0 0 1

There is a simple consistant pattern to the structure of the three fundamental rotation matrix. The Kth row and Kth column of

R ( φ ) are identical to the Kth row and Kth column of the K

Identity Matrix I, in the remaining 2 × 2 submatrix, the diagonal terms are Cosφ, while the off diagonal terms are ± Sinφ , where φ is the angle of rotation. The sign of the diagonal terms above the diagonal is

( −1)

K

for the Kth fundamental rotation matrix.

Problem: Suppose the mobile coordinate frame M is rotated about the coordinate frame F. Let φ = π

[ P] = [ 2 M

coordinates of P in the fixed coordinate frame F. n

1 0 0 π = 0 Cos π π − Sin R1 3 3 3 π π 0 Sin 3 Cos 3

( )

Then

1

axis of the fixed

3 radius be the amount of rotation. Suppose P is a point whose

coordinates in the mobile M frame are

Sol

f

0 3]

T

. What are the

[ P]

1 0 0 F = 0 Cos π − Sin π 3 3 0 Sin π 3 Cos π 3

[ P]

⇒

F

[P]

⇒

⇒

F

1 = 0 0

0.866

0 −0.866 0.5

2 0 3

2 = −2.598 1.5

[ P] [ 2 F

=

Kinematic of a Particle:

Z P r (t) r

Y

0 0.5

2 0 3

X

−2.598 1.5]

T

t dr t)( ( tv ) = tv )( = VO+ ∫ ta )( dt tO dt dv t)( tS )( = + t tv )( dt ta )( = S O∫ tO dt General 3D motion in a Cartesian Co-ordinates

Z

eZ eY eX X

Y

r ( t ) = x (t )ex + y (t )e y + z (t )ez dx (t ) dy (t ) dz (t ) v( t ) = r ′( t ) = ex + ey + ez dt dt dt = x′(t )ex + y′(t )e y + z′(t )ez

Problem: Determine the velocity and acceleration of a particle in a Cartesian co-ordinate

x(t ) r(t ) = y (t ) z (t )

Z

r(t)

P

X(t)

X

Sol

n

From the Fig, we can write

x (t ) = r (t )Cosφ(t ) y (t ) = r (t ) Sinφ(t ) z (t ) = z (t )

Now, to find the velocity r ′Cosφ(t ) − r (t )φ(t ) Sinφ(t ) ′ v (t ) = r Sinφ(t ) + r (t )φ(t )Cosφ(t ) z (t )

Special case of Plane Motion:

r Y(t)

Y

P

r(t) I

K A

I

r= Ir = Ir

A A

+

r

AP

+ A IK

K

I

r

P

Problem: a robot arm consists of two parts, which are simple supported in point A. The lower part rotates anti clock wise with the angular speed

ω

I

. The upper part is powered clock

wise by a flanged engine at the intermediate hinge (angular speed and velocity of the tip S using the angle

ω

M

α =ω

= 2ω ,

t

I

Y

t

S

WM

a

WI

a

0

β =ω

t,

a

(Given;

α

ß X

and angle I

β

t −ω M t )

0

ω

M

). Compute the path

at time t = 0 .

Sol

n

aCos (α + α ) + aCos ( β + α ) t 0 0 t r= aSin ( + ) + aSin ( + ) β t α 0 αt α0 Then velocity

− a ω Sin(α + α ) − a (ω − ω )Sin(β + α ) I t 0 M 0 t I v(t ) = a ω I Cos (α t + α 0) + a (ω I − ω M )Cos ( β t + α 0) − ω Sin(α + α ) − (ω − ω )Sin( β + α ) t 0 M 0 t I ⇒ v(t ) = α I ω I Cos (α t + α 0) + (ω I − ω M )Cos ( β t + α 0) − Sin(α + α ) − Sin( β + α ) t 0 0 t ωI ⇒ v(t ) = α Cos (α t + α 0) Cos( β t + α 0) ω I − ω M Applying ω M = 2 ω I − Sin(α + α ) − Sin( β + α ) t 0 0 t ωI ⇒ v(t ) = α Cos (α t + α 0) Cos (β t + α 0) ω I − ω I − Sin(α + α ) − Sin( β + α ) 1 t 0 0 t ⇒ v(t ) = α ω I Cos (α t + α 0) Cos ( β t + α 0) − 1 − Sin(α + α ) + Sin( β + α ) t 0 0 t ⇒ v (t ) = α ω I Cos (α t + α 0) − Cos ( β t + α 0) Ans Problem: A vertical standing robot is rotating with the angular speed φ about its longitudinal axis. A second arm with length L is welded perpendicular to the axis of rotation. A third arm is connected by a hinge on its free end. Determine the position vector and velocity vector.

A

a

L

Sol

n

The system can be shown as below:

I

Z

K2 Z

K1 Z

K2 Y

K1 Y

IX

K1 X

To find the position vector

IY

K2 X

I

rA = =

A

K1 K1

I

A

I

rO +

A

I

A r K 1 K 1K @ K 2 A

r +A r K 1 K 1 O K 1 K @ K 2 A

Cosφ = Sinφ 0

− Sinφ Cosφ 0

0 1 0 0 0 L + 0 Cosθ − Sinθ a 0 0 Sinθ Cosθ 0 − LSinφ Cosφ − Sinφ 0 0 = − Cosφ + Sinφ Cosφ 0 aCosθ 0 1 aSinθ 0 0 0 0 1

− LSinφ − aSinφCosθ = − Cosφ + aCosφCosθ 0 aSinθ − LSinφ − aSinφCosθ = Cosφ + aCosφCosθ aSinθ

Automation: Automation robotization or Industrial or numerical control is the use of control system, such as computers to control industrial machinery and process replacing human operators. Automation greatly reduce the need for human sensory and mental requirements as well. Automation plays an increasingly important role in the global economy end in the daily experience. Automation Tools: ANN – Artificial Neural Network DCS – Distributed Control System HMI – Human Machine Interface LIMS – Laboratory Information Management System MES – Manufacturing Execution System PAC – Programmable Automation Controller PLC – Programmable Logic Controller SCADA – Supervisory Control And Data Acquisition PLC: Programmable Logic Controller is a digital computer used for Automation of Industrial process, such as control of machinery or factory assembly lines. The PLC is designed for multiple inputs and output arrangements. PLC Component:

Processor or CPU (Central Processing Unit) Rack or Mounting Input Assembly Output Assembly Power Supply Programming Unit or device or PC/Software

Programming Unit (Memory) Volatile Non volatile

Input From Sensor

Input Module

Processor

Output Module

Power Supply

Block diagram of PLC Basic Operation of a PLC:

Program Logic

Input Table

Input System

CPU

Memory Data storage

Output Table

Output System

The operation of a PLC completes three processes: a) Scans or reads from the input device.

To Output Relay System

b) Executes or solves the program logic. c) Update or write to the output device. A system engineer or PLC programmer will first create program logic in a programming device (PC). This logic can be written in ladder logic or FBD (Functional Block Diagram), Instruction list, Sequential Function Chart or any other languages. The programmer will then download the program to the PLC. This temporarily connecting the programmer to the PLC. Once the program is installed or downloaded to the CPU, it is not necessary for the PC to remain connected. Relay: A relay is a simple device that uses a magnetic field to control a switch. When a voltage is supplied to the input coil the resulting current creates a magnetic field. The magnetic field pulls a metallic switch towards it and the contacts touch, closing the switch. The contact that closes when the coil is energized is called Normally Open (N.O). Relay Application:

Fuse

Control Coil

2A

2A

Switch

Pump

Relays are remote control electrical switches that are controlled by another switch or a computer as in a power train control module. Relays allow a small current flow circuit to

control a higher current circuit. Several designs of Relays are in use today, 3-pin, 4-pin, 6-pin etc. Relay Operation: A 4-pin relay has a control circuit and a load circuit. The control circuit has a small control coil while the load circuit has a switch. The coil controls the operation of the switch. Relay Energized (ON): 2

1

4

3

Current flow through the control circuit coil (1 and 3) creates a small magnetic field which causes the switch to close pins 2 and 4. the switch, which is a part of the load circuit is used to control an electrical circuit that may connect to it. Current now flows through pins 2 and 4 when the relay is energized. Relay De-energized (OFF):

2 1

2 1

4 3 Fig: A 4-pin NO Relay

4 3 Fig: A 4-pin NC Relay

Fig: A 4-pin NO Relay in OFF condition When current stops flowing through control circuit pins 1 and 3, the relay becomes de-energized. Without the magnetic field, the switch opens and current is prevented from flowing through pins 2 and 4. The relay is now OFF. Relay Design ID:

2

1

4 3 Fig: A 4-pin NO Relay

2

1

4 3 Fig: A 4-pin NC Relay

Relays are either Normally Open or Normally Closed. Normally Open (N.O) relays have a small switch that remains open until energized, while Normally Closed (N.C) relays are closed until energized. Relays are always shown in de-energized position (no current flow through the control circuit). Normally Open relays are the most common vehicle however either can be used in automotive application. Actual Relay Design

From Power Supply Control Switch Contact Open

Control Coil

To Load

Iron Core

Fig: Actual Relay Design Current flows through the control coil, which is wrapped around an iron core. The iron core intensifies the magnetic field. The magnetic field attracts the upper contact arm and pulls it down, closing the contacts and allowing power from the power source to go to the load. Relay Variation:

1

3 2 Fig: 3 Pin Relay

2

1

4 3 Fig: 4 pin Relay

BOOLEAN LOGIC DESIGN: Basic Operations: AND, OR, NOT SOME Complex Operators: Exclusive OR â&#x20AC;&#x201C; XOR (EOR)

Fig: 5-pin Relay

Not AND – NAND Not OR – NOR AND Operation:

A A B

B

X

X = A.B A B 0 0 0 1 1 0 1 1

X 0 0 0 1

OR Operation:

X A B

X

A B

X = A+B A B 0 0 0 1 1 0 1 1

X 0 1 1 1

X

NOT Operation:

X

A

A 0 1

X = A

X 1 0

XOR Operation: A B

X

A B

X = A ⊕B X = A⋅B + A⋅B

A 0 0 1 1

B 0 1 0 1

X 0 1 1 0

Basic Axioms of a Boolean Algebra: Idempotent:

A.A = A A.A = A

( A + B) + C = A + ( B + C ) Associative: ( A.B ) .C = A.( B.C )

X

X

A+ B = B+ A A.B = B.A

Commutative:

A + ( B.C ) = ( A + B ) .( A + C ) Distributive: A + 1 = 1 A.1 = A Identity:

A+ 0 = A A.0 = 0

A+ A = 1 A. A = 0 Complement: A = A 1 = 0

( A + B ) = A.B Demorgan’s : A.B = A + B Example: Reduce the given equation and also show the Logic Operation:

{ (

)

A = B C. D + E + C + E.C

Sol

}

n

{ ( ) ( = B.C (D + E +1 + E )

A = B C . D + E +C + E.C

}

= B D.C + E.C +C .C + E.C

)

= B.C.(1) = B.C

The Logic Operation of the given equation is given below as reduced equation.

B C

A

Example: Reduce the given Logic Operation shown in Fig:01 and show the reduced Logic Operation and Ladder Diagram:

A C X

B

Fig: 01

Sol

n

From the Logic it can be written X =A + C . B . B A.B.C +

Then

) ( ) (

( (

X = A.C . B . A.B.C +B

)

= A.C . B . A +B +C +B

)

=A.C.B. A +A.C .B.B +A.C .B.C +A.C .B.B =A.B.C +A.B.C +A.B.C +0 =A.B.C

According to the solution, the Logic Operation is given below

C X

A B

According to the solution, the Ladder Diagram is given below

A

B

C

X

Example: In a waste treatment plant (shown in Fig: 01) the system design is such that if all three sensors give sense only then the toxic waste will enter into the burner. If any of the one of the sensor does not sense then the waste will not enter into the burner. Then show the truth table, Logic Operation and Ladder Diagram of the plant:

Toxic Waste

Q

Flame Fuel A B C Exhaust

Fig: 01 Waste Treatment Plant

Sol

n

According to the description of the Waste treatment plant, the truth table is given

below: A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

From the truth table we have

Q = ABC

Then the Logic Operation is as below:

C 0 1 0 1 0 1 0 1

Q 0 0 0 0 0 0 0 1

Q = ABC

A B C

Q

Therefore the Ladder Diagram is as below:

A

B

C

Q

Example: In a waste treatment plant (shown in Fig:01) the system design is such that if any two sensors among the three give sense then toxic waste will not enter into the burner. Then show the truth table, Logic Operation and Ladder Diagram of the plant:

Sol

n

According to the description of the Waste treatment plant, the truth table is given below: A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

C 0 1 0 1 0 1 0 1

From the truth table we have Q = ABC + A BC + ABC + ABC

Then the Logic Operation is as below:

Q 0 0 0 1 0 1 1 1

Q = ABC Q = A BC Q = ABC

Q = ABC

A B C

ABC ABC ABC ABC

Therefore the Ladder Diagram is as below:

Q

A B C

A B C

A B C

A B C

The above system can be reduced as such: Q = ABC + A BC + ABC + ABC

(

)

= BC A + A ++A BC + ABC = BC ++A BC + ABC

(

)

= B C + AC + A BC = B (C + A) + A BC = BC + AB + A BC

(

= BC + A B + BC = BC + A( B +C ) = BC + AB + AC

)

Then the Logic Operation is as below:

Q

C

B

A AC AB

Q

BC

Therefore the Ladder Diagram is as below:

A

B

B

C

A

C

Q

Example: (I) A heating oven with two bays can heat one ingot in each bay. When the heater is ON, it provides enough heat for two ingots. But if only one ingot is present in the oven may become too hot. So a fan is used to cool the oven when it passes a set temperature. (II) A sucker is fitted in the system along with a preset temperature. When the fan is running and the temperature sensor gives sense, then the sucker will be ON. Then show the truth table, Logic Operation and Ladder Diagram for both the case:

Sol

n

Let Ingot 1 – A Ingot 2 – B Fan -Q Temperature Sensor for Sucker – T Sucker - S (I)

According to the description of the oven, the truth table is given below:

A 0 0 1 1

B 0 1 0 1

C 0 1 1 0

From the truth table we have Q = AB + A B

Then the logic operation will as below: A B Q

Hence the Ladder Diagram is as below:

(II)

A

B

A

B

Q

According to the description of the oven, the truth table is given below: Q 0 0 1 1

From the truth table we have S = QT

Then the logic operation will as below:

T 0 1 0 1

S 0 0 0 1

Q T

S

Hence the Ladder Diagram for the complete system is as below:

A

B

A

B

T

S

Burglar Alarm: Consider the design of a Burglar Alarm for a house. When activated to encourage the unwanted guest to leave. This alarm be activated if an unauthorized intruder is detected by window sensor and a motion sensor detector. The window sensor is effectively a loop of wire that is a piece of thin metal foil that incircles the window. If the window is broken that foil breaks breaking the conductor. This behaves like a normally closed switch. The motion sensor is designed so that when a person is detected the output will go ON. As with any alarm an activate/deactivate switch is also needed. Then show the Truth Table, Boolean Algebra, Logic Operation and Ladder Diagram.

Sol

n

Let A = Alarm and Light Switch (1 = ON) W = Window/Door sensor (1 = OFF) M = Motion sensor (0 = OFF) S = Alarm activate switch (1 = ON)

According to the description of the system, the truth table is given below: S 0 0 0 0 1 1 1 1 Hence we have

M 0 0 1 1 0 0 1 1

W 0 1 0 1 0 1 0 1

A 0 0 0 0 1 0 1 1

A = S .M .W A = S .M .W

A = S .M .W

A = S .M .W +S .M .W +S .M .W

( ) = S [(M .W +M .W ) +(M .W +M .W )] = S M .W +M .W +M .W = S .W +S .M

So the Logic Operation is as below:

W S A M

Therefore the Ladder Diagram will be as below:

W

M

PLC Input Card:

S

A

PLC Input Card (24 V ac)

24 V ac

Push Button 00 01 02 03 Sensor

04 05 06 07 Comm

Fig: PLC Input Card

PLC Output Module:

120 V ac Nutral PLC Output Card 24 V dc 00 01 02 03 04 05 06

Motor

07 Comm

24 V dc Comm

MICROCONTROLLER: Micro-Controller: Microprocessor based controller called Micro-Controller. It is also consists of RAM, ROM, CPU and I/O ports. it’s like a baby computer but used for special purpose. The processor used in a computer is not built with RAM, ROM and I/O ports the chip itself. Microcontroller is a Microcomputer in a single chip. The RAM, ROM, I/O and timer, counter are all embedded together on one chip. There are 8 bits, 16 bits, 32 bits micro-controller made by various companies. For application, a microcontroller alone is not enough. Beside a microcontroller, we need a program that would be executed and a few more elements which make up a interface logic towards the elements of regulation. Program writing is a special field of work with microcontrollers and is called ‘Programming’. There are three type of microcontroller chip. Small range – (12 bit) Mid range – (14 bit) Large range – (16-32 bit)

Pin Diagram of microcontroller PIC-16F84A

1 2 3 4 5 6 7 8 9

18

PIC16F84A

RA2 RA3 RA4/TOCKI MCLR Vss RBO/INT RB1 RB2 RB3

17 16 15 14 13 12 11 10

RA1 RA0 OSC1/CLKIN OSC2/CLKOUT Vdd RB7 RB6 RB5 RB4

Fig: Pin diagram of PIC16F84A Pins on PIC-16F84A microcontroller have the following meaning: Pin no.1 RA2 Second pin on port A. Has no additional function. Pin no.2 RA3 Third pin on port A. Has no additional function. Pin no.3 RA4 Fourth pin on port A. TOCK1 which functions as a timer is also found on this pin. Pin no.4 MCLR Reset input and Vpp programming voltage of a microcontroller. Pin no.5 Vss Ground of power supply. Pin no.6 RB0 Zero Pin on port B. Interrupt input is an additional function. Pin no.7 RB1 First Pin on port B. No additional function. Pin no.8 RB2 Second Pin on port B. No additional function. Pin no.9 RB3 Third Pin on port B. No additional function. Pin no.10 RB4 Fourth Pin on port B. No additional function. Pin no.11 RB5 Fifth Pin on port B. No additional function. Pin no.12 RB6 Sixth Pin on port B. ‘Clock’ line in program mode. Pin no.13 RB7 Seventh Pin on port B. ‘Data’ line in program mode. Pin no.14 Vdd Positive power supply pole. Pin no.15 OSC2 Pin assigned for connecting with an oscillator. Pin no.16 OSC1 Pin assigned for connecting with an oscillator. Pin no.17 RA0 Zero pin on port A. No additional function. Pin no.18 RA1 First pin on port A. No additional function. Register File Map:

OO H INDIRECT ADDRESS INDIRECT ADDRESS 80 H O1 H

TMR0

OPTION

81 H

O2 H

PCL

PCL

82 H

O3 H

STATUS

STATUS

83 H

O4 H

FSR

FSR

84 H

O5 H

PORT A

TRIS A

85 H

O6 H

PORT B

TRIS B

86 H

O7 H

E E CON 0

E E CON 1

87 H

7F H GENERAL PURPOSE GENERAL PURPOSE FF H REGISTER REGISTER BANK 0

BANK 1

Note: To use any one port of (RA or RB) as input, make it ‘1’ and make it ‘0’ in order to use it as output. Example: To make RA1 and RA2 as input Binary – 00000110 Hex – 06 Program: BSF 0X03,5 (To enter Bank1) MOVLW b’00110 (For Hex 0X06) MOVWF 0X85 (For TRIS A) BCF 0X03,5 (To return Bank0)

A complete set of program to make an LED ‘ON’ and ‘OFF’ simultaneously:

STATUS TRIS A TRIS B PORT A PORT B

EQU EQU EQU EQU EQU

BSF MOVLW MOVWF BCF

0X03 0X85 0X86 0X05 0X06 STATUS,5 0X00 TRIS A STATUS,5

START MOVLW 0X02 H MOVWF PORT A CALL DELAY MOVLW 0X00 H MOVWF PORT A CALL DELAY GO TO START END

INPUT 5 V

330

0V

Inductive Sensor:

RA1 RA0 OSC1 OSC2 Vdd RB7 RB6

4 MHz

330

RA2 RA3 RA4 MCLR Vss RBO/INT RB1 RB2 RB3

RB5 RB4

PIC16F84A

22 Pf

V

Metal

Fig: Inductive Sensor Inductive Sensors use currents induced by magnetic fields to detect nearby metal objects. The inductive sensor uses coil (an inductor) to generate a high frequency magnetic field. If there is a metal object near the magnetic field, current will flow in the object. This resulting current flow sets up a new magnetic field that oppose the original magnetic field. The net effect is that the change the inductance of the coil in the sensor. By measuring the inductance the sensor can determine when a metal have been brought near by.