Академический Документы
Профессиональный Документы
Культура Документы
SEVENTH SEMESTER
(2013 Regulation)
Prepared by,
Mr. M. Shanmugam, M.E., (PhD)
Assistant Professor,
Department of Mechanical Engineering,
Saveetha Engineering College, Chennai
NAME : ____________________________
YEAR/SEM : ____________________________
SECTION : ____________________________
1
Shanmugam M
SYLLABUS
0032
OBJECTIVES:
• To know the method of programming the microprocessor and also the design,
modeling & analysis of basic electrical, hydraulic & pneumatic Systems which
LIST OF EXPERIMENTS:
using Software.
2
Shanmugam M
LIST OF EXPERIMENTS
CYCLE I:
CYCLE II:
ADDITIONAL EXPERIMENTS
3
Shanmugam M
INDEX
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
4
Shanmugam M
INTRODUCTION TO MECHATRONICS SYSTEM
OBJECTIVE:
To study about the important features, applications and components of
Mechatronics system.
MECHATRONICS DEFINITION:
5
Shanmugam M
The integration across the traditional boundaries of mechanical
engineering, electrical engineering, electronics and control engineering has to
occur at the earliest stages of the design process if cheaper, more reliable; more
flexible systems are to be developed.
6
Shanmugam M
Schematic Layout of Hydraulic System
7
Shanmugam M
An actuator is provided to convert the liquid energy into mechanical force
or torque to do useful work. The actuator is the actual working element of the
system. The actuators can be either cylinders (to provide linear motion) or hydro
motors (to provide rotary motion).
Fluid-transfer piping:
The hydraulic Piping is provided to carry the compressed liquid from one
place to another.
8
Shanmugam M
A Prime mover, usually an electric motor, is used to drive the compressor.
Valves:
Valves are refitted in the system to control air direction, pressure, and
flow rate.
Actuator:
An actuator is provided to convert the air energy into mechanical force or
torque to do useful work.
Fluid-transfer piping:
Piping is provided to carry the compressed air from one place to another.
9
Shanmugam M
BASIC SYMBOLS USED IN HYDRAULIS AND PNEUMATIC SYSTEM:
10
Shanmugam M
11
Shanmugam M
12
Shanmugam M
13
Shanmugam M
14
Shanmugam M
15
Shanmugam M
DESIGN OF SIMPLE PNEUMATIC CIRCUIT
EXP NO: 1 DATE:
PROBLEM
A double acting cylinder is used for clamping and de-clamping work part in a
drilling machine. To actuate the cylinder for clamping and de-clamping, a
manually operated valve to be operated. Design a circuit.
AIM
To design a simple pneumatic circuit which can clamp and de-clamp the work
part in drilling machine when actuated manually.
APPARATUS REQUIRED
Double acting
Air supply
cylinder & FRL
unit
Manually operated
5/2 valveand Hoses
Fittings
CIRCUIT DESCRIPTION
Compressed air supply is given through the FRL unit to the manually operated
directional control valve. The output ports of the DC valve are connected to the
cylinder ports. In normal condition the cylinder is in the retracted condition
(de-clamping).
When the manually operated valve is pressed, the left side configuration of the
valve is come into operation and the pressurized air enters into the cover end
of the cylinder causing the cylinder to move forward. This clamps the work
part and after completing the drilling operation, the operator actuates the
valve to the other side. This now gives air to the piston end of the cylinder
retracts for de-clamping the work part.
RESULT
A circuit for the given problem is designed, constructed using the available
components and tested successfully.
16
Shanmugam M
1. Simple Pneumatic Circuit
17
Shanmugam M
EXTENSION AND RETRACTION OF SINGLE ACTING AND DOUBLE
PNEUMATIC CYLINDER USING DCV
AIM:
To design and assemble a circuit that extends and retracts a single acting
spring return and double acting pneumatic cylinder using the Directional
Control Valve (DCV) in Pneumatic Trainer Kit.
APPARATUS REQUIRED:
Connecting Tubes,
Single Acting Spring return Cylinder,
Double Acting Cylinder,
3/2 Hand Levered Spring Return DCV,
4/2 Hand Levered Spring Return DCV and
FRL Unit
PROCEDURE:
RESULT:
Thus the single acting and double acting cylinder was operated using DCV in
Pneumatic Trainer Kit.
18
Shanmugam M
2a. Extension and Retraction of single acting pneumatic cylinder using DCV
19
Shanmugam M
CONTROLLING THE SPEED OF THE CYLINDER USING METERING
IN AND METERING OUT VALVE CIRCUIT
PROBLEM
Design a simple double acting cylinder circuit used for applications like feed a
drill bit and boring machine. The speed control of forward and return stroke
should be possible to get a positive feed control. The cylinder is actuated by a
manually operated valve.
AIM:
To control the speed of double acting cylinder using Metering In valve circuit in
Pneumatic Trainer Kit.
APPARATUS REQUIRED:
Connecting tubes
Double Acting Cylinder
Flow Control Valve
4/2 Hand Levered Spring Return DCV
FRL Unit
PROCEDURE:
RESULT:
Thus the speed of double acting cylinder was controlled using Metering In
and Metering Out valve circuit in Pneumatic Trainer Kit.
20
Shanmugam M
3a. Controlling the Speed of the Cylinder using Metering In valve circuit
3b. Controlling the speed of the cylinder using Metering Out valve circuit
21
Shanmugam M
OPERATION OF DOUBLE ACTING CYLINDER WITH LOGIC GATES
AIM:
APPARATUS REQUIRED:
Connecting tubes
Double Acting Cylinder
4/2 Pilot Operated DCV
3/2 Hand Levered DCV
Two Pressure Valve
FRL Unit
PROCEDURE:
RESULT:
Thus the double acting cylinder using AND/OR logic circuit was operated
in Pneumatic Trainer Kit.
22
Shanmugam M
4a. Operation of double acting cylinder with AND logic circuit
23
Shanmugam M
DESIGN OF CONTINUOUS CYCLE CIRCUIT
PROBLEM
A double acting cylinder is used to feed material for a punching press. For every cycle one
blank to be fed to the press. The cylinder has to start and stop its continuous operation when
a push button valve is operated. Design a circuit.
AIM
To design a continuously operating circuit as per the given requirement.
APPARATUS REQUIRED
The double acting cylinder gets power supply for its forward and return motion
from the pilot operated 4/2 directional control valve. The lever operated valves
are used as limit switches for the sensing of the end of the either stroke. These
valves are named as a0 and a1.The output from the limit switches are connected
as the pilots for operating the DC valve. The input power for the DC valve and
limit switches are given from the FRL unit through the manually operated 3/2
valve. The actuation of limit switches cause the cylinder motion as follows
a0 Cylinder forward motion
a1 Cylinder return motion
Initially let us assume the cylinder is in the return condition (a0 actuated) and
the manually operated valve in closed condition. If the manually operated valve
is actuated to open condition, air is allowed to pass to DC valve and limit
switches. This leads to the air output in a0 and this causes the cylinder forward
position. As the cylinder starts its forward movement, a0 is released and at the
end of the stroke a1 pressed. This leads to the reversal of the DC valve and the
cylinder starts its return motion. At the end of return stroke a0 got pressed and
this actuates the DC valve and the cylinder moves forward. This cycle continues
until the manually operated valve is moved to closed position.
RESULT
A circuit for the given problem is designed, constructed using the available
components and tested successfully.
24
Shanmugam M
5. Continuous Cycle Circuit
25
Shanmugam M
DESIGN OF SEQUENTIAL CIRCUIT (PNEUMATICS)
PROBLEM
Two Pneumatic cylinders are used for loading and unloading of components.
The operating sequence of the cylinders is A+ B- A- B+. Design a circuit.
AIM
To design a pneumatic circuit for the given sequence.
COMPONENTS REQUIRED
Double acting cylinder
Pilot operated 4/2 valve
Air supply & FRL unit
Manually operated 3/2 valve
Lever operated 3/2 valve
Fittings and Hoses
Automation Studio Software
PROCEDURE:
CIRCUIT DESCRIPTION
Two cylinders are named as A & B. The corresponding limit switches are a0 &
a1, and b0 & b1 for home and extended positions respectively. The directional
control valves for each cylinder are named as X & Y respectively and the
cylinders are connected to them. The DC valves and individual limit switches
are given with power from the FRL unit through a manually operated valve.
The output from the limit switches are given as pilot to the DC valves, to make
the respective cylinder to move. Manually operated 3/2 valve works as a start
switch. The output from each limit switch will create movement of cylinders as
follows
a1 B--
b0 A-
a0 B+
b1 A+
26
Shanmugam M
condition and the cylinder B is in the extended condition. So limit switches a0
& b1 are in actuated condition and power comes to corresponding DC valves.
The manually operated valve is in closed condition initially. If the manually
operated valve is actuated to open
Condition, air is supplied to direction control valves and limit switches. Since
the limit switch b1 is in pressed condition the air goes to actuate the direction
control valve X and the cylinder moves forward. This causes the release of a0
and pressing of a1 at the end of the stroke. The output from a1 goes to Y as
pilot and shift it position. This gives power to the return stroke of cylinder B.
At the end of return stroke, b0 is pressed and the DC value X reversed. This
makes the cylinder A to return and at the end a0 is pressed. Due to this pilot Y
is reversed and B moves forward and at the end b1 is pressed. Thus the
cylinders A & B operate continuously until the manually operated valve is put
in close condition.
6. Sequential Circuit with pneumatic control for the given sequence A+ B- A- B+.
RESULT
The given circuit is designed, constructed with the available components and
checked for working.
27
Shanmugam M
DESIGN OF ELECTRO PNEUMATIC CIRCUIT
AIM
APPARATUS REQUIRED
Air from FRL unit is given to the DC valve. Two pressure ports of the valve are
connected to the two ports of the cylinder. Individual solenoid is energized by
pressing separate push buttons, as shown in the electrical circuit. In the
normal condition the cylinder is in the retracted position. Circuit is operated by
24 V D.C power supply.
When the push button1is pressed, the solenoid A gets energized and the DC
valve is moved to its actuated condition. The air from the valve goes to the
cover end and the cylinder moves forward. Even after the push button is
released and solenoid de-energized, since there is no spring to return, the valve
and the cylinder remain at the same position. When the push button 2 is
pressed, the solenoid B is energized and that side of DC valve comes into effect.
This makes the cylinder to return. The next cycle starts when push button 1 is
pressed.
RESULT
The given circuit is designed, constructed with the available components and
tested successfully.
28
Shanmugam M
7. Electro Pneumatic Circuit
29
Shanmugam M
SINGLE CYCLE AUTOMATION OF MULTIPLE CYLINDERS IN
SEQUENCE (A+B+B-A-) USING ELECTROPNEUMATIC KIT
AIM:
APPARATUS REQUIRED:
PROCEDURE:
RESULT:
Thus the single cycle automation of multiple cylinders was operated sequence
(A+B+B-A-) in Electro Pneumatic Trainer Kit.
30
Shanmugam M
8. Single cycle automation of multiple cylinders in sequences (A+B+B-A-) in
Electro Pneumatic Trainer Kit.
31
Shanmugam M
DESIGN OF PLC CONTROLLED ELECTRO PNEUMATIC CIRCUIT
EXPT NO: 9 DATE:
PROBLEM
Design a PLC controlled circuit to activate a piercing cylinder. The cylinder has
to be activated only if the work piece is sensed by the three sensors. If any two of
the three sensors sense the presence of the work part, the piercing cylinder can
be activated.
AIM
To design a circuit to activate a cylinder with PLC control.
APPARATUS REQUIRED
Double acting cylinder
5/2 solenoid controlled pilot operated spring return valve
Sensors
PLC and required electrical cables
FRL unit
Fittings and Hoses
Electrical Power supply (24 volts)
Interface box between PLC and sensors
CIRCUIT DESCRIPTION
The compressed air from the FRL unit is connected to the cylinder through the
DC valve. The DC valve is operated by the pilot pressure which is controlled by
the solenoid. The valve is spring return, so when the solenoid is energized, the
valve actuated the piercing cylinder moves forward.
PLC PROGRAMME
The inputs to the PLC are the output from 3 sensors. The inputs are named as
I0.0, I0.1 and I0.2 respectively. The PLC output is taken in the port 0.0 and it is
given to the solenoid. The programme is written in ladder logic in such a way
that, if any two of the three inputs goes to PLC the output is got from the PLC.
When the work piece is placed in its position, if it is in correct position any two of
the three sensors will sense the work piece and this is given as input to the PLC.
Due to this an output is obtained from the PLC which energizes the solenoid.
This leads to actuate the DC valve and finally the cylinder.
RESULT
32
Shanmugam M
9. PLC Controlled Electro Pneumatic Circuit
33
Shanmugam M
DESIGN OF SIMPLE HYDRAULIC CIRCUIT
AIM
APPARATUS REQUIRED
Pressurized oil from the pump is given to the DC valve through the relief
valve. If the manually operated valve is pressed, the oil flows to one side of the
cylinder depending on the connection and the cylinder makes its movement.
During return stroke the oil is allowed to come out through the flow control
valve and this controls the speed (like meter out valve) of the cylinder in the
return stroke.
RESULT
The given circuit is designed, constructed with the available components and
checked for working.
34
Shanmugam M
10. Simple Hydraulic Circuit
35
Shanmugam M
HYDRAULIC CIRCUIT USING HYDRAULIC MOTOR
AIM
APPARATUS REQUIRED
CIRCUIT DESCRIPTION
The two ports of the direction control valve is connected to the two input ports
of the hydraulic motor. The valve used here is closed centre, solenoid operated
string return 4/3 valve. The pressurized oil and tank are connected to the
centre position of the DC valve. When one push button (PB1) is operated
solenoid A is energized and when another push button (PB2) is pressed,
solenoid B is energized. They generate clockwise and anticlockwise movement
in the motor respectively. The pressure line is fitted with a relief valve for
safety.
The pressurized oil from the pump initially goes to the DC valve and when the
valve is in neutral position, oil cannot go anywhere because the valve is closed.
So the pressure developed will be more than the set pressure of the relief valve
and the oil will be relieved to the tank through relief valve. When PB1 is
pressed, the solenoid A energizes and the oil go to the motor and create
clockwise rotation in the motor. If the PB1 is released, then the spring takes
the valve to its neutral position. Now the motion of the motor stops. When PB2
is pressed, the oil is directed by DC valve, in such a way that it creates
anticlockwise rotation in the motor.
RESULT
Given circuit is designed, constructed and checked successfully.
36
Shanmugam M
11. Hydraulic Circuit using Hydraulic motor
37
Shanmugam M
STUDY AND ANALYSIS OF HYDRAULIC SYSTEM MODEL USING
MATLAB SOFTWARE
AIM:
SOFTWARE USED:
MATLAB 7.0
PROCEDURE:
RESULT:
Thus the analysis of hydraulic system model using MATLAB for a given set of
parameters was studied and output characteristics of the given model were
taken by simulation.
38
Shanmugam M
12. Hydraulic cylinder model
39
Shanmugam M
Figure: Pressure
Variation
40
Shanmugam M
ASSEMBLY LANGUAGE PROGRAMMING OF 8085
MICROPROCESSOR FOR SIMPLE ARITHMETIC OPERATIONS
OBJECTIVE
To add two 8 - bit numbers in memory and store the result in memory.
Theory:
The first data is brought to Accumulator A and the second one in any one of the
other registers, say B. The addition is done using ADD. The result is then stored
at 4152. The ADD instruction affects flags depending on result.
Example: The two data to be added are at 4150 and 4151. The result is stored at
4152.
Data : (4150) = 23
(4151) = 35
Result : (4152) = 58.
FLOW CHART
41
Shanmugam M
PROGRAM
LDA 4150 ; (4150) => (A) = 23
MOV B,A ; (A) => (B)
LDA 4151 ; (4151) => (A) = 35
ADD B ; (A) + (B) => (A)
STA 4152 ; (A) => (4152) = 58
HLT
OBJECT CODES
PROCEDURE:
1. Key in the opcodes from the address specified.
2. Enter data at 4150 and 4151 as specified in the Example.
3. Execute the program and check for the result at 4152.
4. Change data at 4150 and 4151 and execute each time and check for result.
8 BIT DATA SUBTRACTION
OBJECTIVE
To subtract two 8-bit numbers in memory and to store the result also in memory.
THEORY
In this experiment, the HL register pair is first initialized to the start address of
memory at which
42
Shanmugam M
the data is stored. Then data is brought to accumulator A and the other one is
subtracted from
memory itself. The result from A is then stored into memory again using the HL
register. The
SUB instruction sets and clears flags according to result.
EXAMPLE
Let the data to be subtracted be 24 from 49.
Data : (4150) = 49
4151) = 24
Result : (4152) = 25
FLOW CHART
PROGRAM
LXI H, 4150 ; Initialise memory pointer to 4150
MOV A, M ; (4150) => (A) = 49
INX H ; Point to next data.
SUB M ; (4151) => (A)
INX H ; Point to next location.
MOV M,A ; (A) => (4152)
HLT ;
43
Shanmugam M
OBJECT CODES
PROCEDURE
1. Key in the opcodes from the address specified.
2. Enter data that is needed for execution at 4150 and 4151.
3. Execute the program and check for results at 4152.
4. Try changing data and check for results each time.
8 - BIT MULTIPLICATION
THEORY
44
Shanmugam M
(4155) = 14
93 x 23 = 1419.
FLOW CHART
PROGRAM
LDA 4152 ;Load Multiplier
MOV B,A ;Get the multiplier to B
LXI D, 0000
LHLD 4150 ;
XCHG ;Load multiplicand in DE
LOOP : DAD D
DCR B
JNZ LOOP ;If not zero loop again.
SHLD 4154 ;Else store result.
HLT
45
Shanmugam M
OBJECT CODES
PROCEDURE
1. Key in the opcodes from the address specified.
2. Enter data at 4150 through 4153 for execution.
3. Execute the program and check for results at 4154 and 4155.
4. Try changing data and check results each time.
46
Shanmugam M
8 -BIT DIVISION
OBJECTIVE
To divide two 8- bit numbers and to store the result in memory again.
THEORY
Division is done here using the method of repeated subtraction. The dividend is
loaded to
register A and divisor to register B. Subtract divisor from dividend until the
dividend is less than
the divisor. Count number of times of subtraction. That count is the quotient and
the dividend
now becomes the remainder.
EXAMPLE
The divisor and the dividend are at locations 4150 & 4151. The quotient &
remainder will be
stored at locations 4152 & 4153.
Data : (4150) = 08 - Divisor
(4151) = 2A - Dividend.
Result : (4152) = 02 - Remainder
(4153) = 05 - Quotient.
FLOW CHART
47
Shanmugam M
PROGRAM
LDA 4150 ; Load divisor
MOV B,A ; to B.
LDA 4151 ; Load dividend to A.
MVI C,00 ; Initialise quotient = 0.
CMP B
JC LOOP
LOOP1: SUB B ; Dividend - Divisor.
INR C ; Quotient = Quotient + 1.
CMP B ; Is Dividend < Divisor.
JNC LOOP1 ; If not repeat again.
LOOP : STA 4152 ; Yes, then store remainder.
MOV A,C
STA 4153 ; Store quotient.
HLT
OBJECT CODES
PROCEDURE
1. Key in the opcodes from the address specified.
48
Shanmugam M
2. Enter data for execution at 4150 and 4151.
3. Execute the program and check for results at 4152 and 4153.
4. Try changing data and check for results each time you execute.
OBSERVATION:
ADDITION:
SUBTRACTION:
MULTIPLICATION:
DIVISION:
Thus the addition, subtraction, multiplication and division of two numbers was
performed using the 8085 microprocessor.
49
Shanmugam M
ASSEMBLY LANGUAGE PROGRAMMING OF 8085 MICROPROCESSOR
FOR SORTING
ALGORITHM:
50
Shanmugam M
JNC LOOP1 ; No interchange
if Kth >= (K+1)th
MOV D,M ; Interchange if out of order
MOV M,A
DCX H
MOV M,D
INX H
MVI B,01 ; Flag = 1
LOOP1 : DCR C ; Count down
JNZ LOOP
DCR B ; Is Flag = 1 ?
JZ START ; Do another sort, if yes
HLT ; If FLAG = 0, stop execution
OBJECT CODES
PROCEDURE
1. Key in the opcodes from the address specified.
2. Enter data for execution from 4150 through 4156.
3. Execute the program and check for results.
4. Try changing data and repeat again.
51
Shanmugam M
ARRANGE IN DESCENDING ORDER
ALGORITHM:
52
Shanmugam M
FLOW CHART
53
Shanmugam M
OBJECT CODES
PROCEDURE
1. Key in the opcodes from the address specified.
2. Enter data for execution from 4150 through 4156.
3. Execute the program and check for results.
4. Try changing data and repeat again.
OBSERVATION:
A. ASCENDING ORDER
INPUT OUTPU
MEMORY DATA MEMORYT DATA
LOCATIO LOCATIO
4200
N N 420
4201 0
420
4202 1
420
4203 2
420
4204 3
420
4
54
Shanmugam M
B. DESCENDING ORDER
INPUT OUTPU
MEMORY DATA MEMORYT DATA
LOCATIO LOCATIO
4200
N N 420
4201 0
420
4202 1
420
4203 2
420
4204 3
420
4
RESULT:
55
Shanmugam M
ASSEMBLY LANGUAGE PROGRAMMING OF 8085 MICROPROCESSOR
FOR CODE CONVERSION
EXAMPLE
Let the ASCII number be at location 4150 and the result be stored at 4151.
Data : (4150) = 35
Result : (4151) = 05.
Data : (4150) = 3A
Result : (4151) = FF.
So if the decimal number got is not a valid one, FF will be stored as the result to
indicate the
error.
56
Shanmugam M
FLOW CHART FOR ASCII TO DECIMAL
PROGRAM
LXI H, 4150 ; Point to data.
MOV A, M ; Get operand.
SUI 30 ; Convert to decimal.
CPI 0A ; Check whether it is a valid decimal number.
JC LOOP ; Yes, store result.
MVI A,FF ; No, make result = FF.
LOOP :INX H
MOV M, A
HLT ; (A) => (4151)
OBJECT CODES
57
Shanmugam M
PROCEDURE
1. Key in the opcodes from the address specified.
2. Enter data at 4150.
3. Execute the program and check at 4151 for result.
4. Try changing data and check result each time at 4151.
(b) BCD TO HEX CONVERSION
OBJECTIVE
To convert two BCD numbers in memory to the equivalent hex number.
THEORY
Out of the two BCD digits at 4150 and 4151, the one at 4150 is the MSD. The
logic is to
multiply the MSD by ten using repeated addition. Then add the LSD to it.
EXAMPLE
The BCD digits are at locations 4150 and 4151 and result will be stored at 4152.
Data : (4150) = 02 (MSD)
(4151) = 09 (LSD)
Result : (4152) = 1D H = 29 D
FLOW CHART
PROGRAM
LXI H, 4150 ; Initialise memory pointer to 4150
MOV A, M ; (A) = (4150) - (MSD)
ADD A ; MSD X 2.
MOV B,A ; Save MSD X 2.
ADD A ; MSD X 4.
ADD A ; MSD X 8.
ADD B ; MSD X 10.
58
Shanmugam M
INX H ; Point to LSD
ADD M ; Add to form hex equivalent.
INX H ; (A) => (4152)
MOV M, A
HLT
OBJECT CODES
PROCEDURE
1. Key in the opcodes from the address specified.
2. Enter data at 4150 and 4151 for execution.
3. Execute the program and check for result at 4152.
4. Try changing data and check result each time.
OBJECTIVE
To convert the hex number in memory to its equivalent decimal number.
THEORY
In this experiment, the hex number is converted to its equivalent decimal
number using the
following logic. First count the number of hundreds, the number of tens and
units present in that
hex number. Using these three, add up to get the equivalent decimal number.
For example, take
59
Shanmugam M
the hex number A9 and converting it we get
A9
- 64 Hundreds = 01
45
Sine 64 (100 decimal) cannot be subtracted from 45, number of hundreds = 01.
Now count tens.
45
- 0A Tens = 01
3b
- 0A Tens = 02
31
- 0A Tens = 03
27
- 0A Tens = 04
1d
- 0A Tens = 05
13
- 0A Tens = 06
09
Now from 09, 0A cannot be subtracted. Hence tens = 06. Therefore the decimal
equivalent of
A9 is 169.
EXAMPLE
Let us work with A9 in this program.
Data : (4150) = A9
Result : (4151) = 01
(4152) = 69
A9 H = 169 D
60
Shanmugam M
FLOW CHART
61
Shanmugam M
PROGRAM
LXI H, 4150 ;Point to data.
LXI B, 0000 ;Initialise Hundreds = 0,
Tens = 0.
MOV A, M ;Get hex data to A.
LOOP : SUI 64
JC LOOP1
INR B ;Hundreds = Hundreds + 1.
JMP LOOP
LOOP1 :ADI 64 ;If subtracted extra, add it clear carry flag.
LOOP2 :SUI 0A
JC LOOP3
INR C ;Tens = Tens + 1.
JMP LOOP2
LOOP3 :ADI 0A ; If subtracted extra, add it again.
INX H ; A = Units.
MOV M,B ; Store Hundreds.
MOV B,A ; Combine Tens in C and
MOV A,C ; units in A to form a
RLC ; single 8-bit number.
RLC
RLC
RLC
ADD B
INX H
MOV M, A ; Store Tens and units.
HLT
62
Shanmugam M
OBJECT CODES
PROCEDURE
1. Key in the opcodes from the address.
2. Enter data at 4150 for execution.
3. Execute the program and check for result.
4. Try changing data and check for result at 4151 and 4152 each time.
63
Shanmugam M
(d) HEX TO BINARY FORM
OBJECTIVE
To convert an 8-bit hex number to its binary form and store in memory.
THEORY
First get the data and rotate it right. Depending upon carry store either 0 or 1 in
memory. Do the
rotation 8 times for the 8 bits in that number.
EXAMPLE
Let the data be 5A.
Data : 5A = 0101 1010 B
Result : (4150) = 0 (LSB)
(4151) = 1
(4152) = 0
(4153) = 1
(4154) = 1
(4155) = 0
(4156) = 1
(4157) = 0 (MSB)
PROGRAM
LXI H,4150 ; Initialise Memory pointer
MVI B,08 ; Counter for 8-bits
MVI A,5A
LOOP :RRC ; Check least significant bit
JC LOOP1
MVI M,00 ; Store zero if no carry
JMP COMMON
LOOP1:MVI M,01 ; Store one if there is a carry
COMMON: INX H
DCR B ; Check for counter
JNZ LOOP
HLT
64
Shanmugam M
OBJECT CODES
PROCEDURE
1. Key in the opcodes from the address specified.
2. Execute the program and check for results at locations 4150 through 4157.
3. Try changing data and check for results each time.
OBSERVATION:
a. ASCII TO DECIMAL
INPUT OUTPU
MEMORY DATA MEMORYT DATA
LOCATIO LOCATIO
N 420 N 430
1 1
65
Shanmugam M
b. HEXADECIMAL TO BINARY
INPU OUTPU
MEMORY T DATA MEMOR T
DATA MEMORY DATA
LOCATIO Y LOCATIO
N 4200
LOCATIO 4204
N
4200 N 4201 4205
4202 4206
4203 4207
c. BINARY TO HEXADECIMAL
INPUT OUTPU
MEMORY DATA MEMORYT DATA
LOCATIO LOCATIO
N 415 N
0
415 415
1 2
d. HEXADECIMAL TO DECIMAL
INPUT OUTPU
MEMORY DATA MEMORYT DATA
LOCATIO LOCATIO
N 415 N
0
415 415
1 2
RESULT:
Thus the assembly language programs for various code conversions are
executed using 8085 microprocessor.
66
Shanmugam M
STUDY OF 8051 MICROCONTROLLER AND STEPPER MOTOR
EXPT NO: DATE:
AIM:
The study the fundamentals of 8051 microcontrollers and stepper motor.
MICROCONTROLLER:
A microcontroller is an integration of a microprocessor with memory and
input, output interfaces and other peripherals such as timers on a single chip.
A microcontroller may take an input from the device it is controlling and
control the device by sending signals to different components in the device.
A microcontroller is often small and low cost. The components may be
chosen to minimize size and to be as inexperience as possible.
Another name for a microcontroller is embedded controller. They can
control features or action of the product.
Register in microcontroller:
A microcontroller contains a group of registers each type of register having
a different functions.
Accumulator:
The accumulator (A) is an 8 bit register where data for an input to the
arithmetic and logic unit is temporarily stored. So the accumulator register is a
temporary handling register for data to be operated on by the arithmetic and
logic unit also after the operation the register for holding the result.
B Register:
In addition to accumulator an 8 bit B-register is available as a general
purpose register when it is not used for the hardware multiply/divide operation.
Data pointer (DPTR):
The data pointer consists of a high byte (DPH) and a low byte (DPL). Its
function is to hold a 16 bit address. It may be manipulated as a 16 bit data
register. It serves as a base register in direct jumps, lookup table instructions
and external data transfer.
Stack pointer:
The stack refers to an area of internal RAM that is used in conjunction
with certain opcode data to store and retrieve data quickly. The stack pointer
register is used, by the 8051 to hold as internal RAM that is called top of stock.
The stack pointer register is 8 bit wide. It is increased before data is stored
during PUSH and CALL instructions and decremented after data is restored
during POP and RET instruction. The stack pointer is initialized to 07H after a
reset. This causes the stack to begin at location 08H.
Program counter:
67
Shanmugam M
The 8051 has 16 bit program counter. It is used to hold the address of
memory location from which the instruction to be fetched. 8051 is a 16 bit hence
it can be address up to 216 byte i.e. 64k of memory. The PC is the only register
that does not have an internal address.
Internal RAM:
The 8051 has 128 bytes internal RAM. It is addressed using RAM address
register
First thirty two bytes from address 00H to 1FH of internal RAM
constitute 32 working registers. They organized into four banks of eight
registers each. The four register banks are numbered 0 to 3 and consist of
eight registers named R0 to R7. Each register can be addressed by name
or by its RAM address.
Only one register bank is in use at a time. Bits Rs0 and Rs1 in the PSW
determine which bank of register is currently in use.
Register banks when not selected can be used as general purpose RAM.
PIN diagram of microcontroller:
The 8051 microcontroller is available in a 40 pin dual in-line (DIL)
package arrangement. It is important to note that many pins of 8051 are used for
more than one function.
The function of each of the pins is as follows.
PORT 0 (pins 32-39):
Port 0 pins can be used as I/O pins. The output drives and input buffers of
port 0 are used to access external memory address, time multiplexed with the
data being written or read. Thus port 0 can be used as multiplexed address data
bus.
PORT 1 (pins 1-8):
Port 1 pins can be used only as I/O pins.
PORT 2 (pins 21-28):
The output drives of port 2 are used to access external memory. Port 2
outputs the high order byte of the external memory address when the address is
16 bits wide otherwise port 2 is used as I/O ports.
68
Shanmugam M
AD0 to AD7 lines are multiplexed. To determine these lines and for
obtaining lower half of an address, an external latch and ALE of 8051 is used.
RST (Reset pin 9):
This pin is used to reset 8051. For proper reset operation, reset signal
must be held high at least for two machine cycles, while oscillator is running.
PSEN (Program Store Enable pin29):
It is the active low output control signal used to activate the enable signal
if the external ROM/EPROM. It is activated every six oscillator periods while
reading the external memory.
Thus this signal acts as the read store to external program memory.
STEPPER MOTOR
A motor in which the rotor is able to assume only discrete stationary
angular position is a stepper motor. The rotary motion occurs in a stepwise
manner from one equilibrium position to the next.
Construction features:
A stepper motor could be either of the reluctance type of or permanent
magnet type. A PM motor consists of multiphase stator and two part permanent
magnet rotor variable reluctance motor has magnetized rotor. PM stepper motor
is the most commonly used type. The basic two phase stepper motor consists of
two pairs of stator poles. Each of four poles has its own winding.
The excitation of any one winding generates a north pole and a South Pole
gets attracted and the torque induced at the diametrically opposite side. The
rotor magnetic system has two end faces.
The left face is permanently magnetized as south and the right face as
North Pole faces.
The north pole structure is twisted with respect to the south pole structure
so that south pole precisely between two north poles. In an arrangement where
there are four stator poles and three pairs of rotor poles, there exist 12 possible
stable position in which a south pole if the rotor can lock with a north pole of the
stator. From this is can be noted that the step size is
= 360 (Ns*Nr)
Ns number of stator pole
Nr number of pairs of rotor poles
Generally step size of the stepper motor depends up on rotor poles. There
are three different schemes available for stepping a motor. They are
1. Wave scheme
2. 2 phase scheme
3. Half stepping or missed scheme
69
Shanmugam M
Wave switching scheme:
Anticlock wise Clock wise
Step A1 A2 B1 B2 Step A1 A2 B1 B2
1 1 0 0 0 1 1 0 0 0
2 0 0 0 1 2 0 0 1 0
3 0 1 0 0 3 0 1 0 0
4 0 0 1 0 4 0 0 0 0
REPRESENTATION:
70
Shanmugam M
which pairs into X, X¯, r, r¯. The rotor rotational speed and the direction of turn
can be controlled by this control.
Speed control of a stepper motor:
The requirement is to use a microcontroller to drive a stepper motor in
both forward and reverse directions of shaft rotation and to implement a two
speed arrangement switches are to be used to produce the two speeds and a
reversal of shaft rotation.
Generally a stepper motor has four sets of coils; one end of each coil may
be connected together and then connected to DC supply. The remaining four ends
may be driven through transistors either separately or in integrated circuit form.
A four bit code sequence continuously applied to the drive circuit from the
microcontroller port causes the motor shaft to rotate in angular steps. Stepper
motor has step angles of 1.8 degree step revolution and turning force may be
improved by using a step down gear box. The stepping code sequence may be
obtained from the motor manufacturer or distributor. The program in this
example was a common four step sequence of A,9,5,6 that it sent continuously
would cause the motor shaft to rotate.
RESULT:
Thus the fundamentals of microcontroller and stepper motor were studied
71
Shanmugam M
RUN THE STEPPER MOTOR AT DIFFERENT SPEED
EXPT NO: 16a DATE:
AIM:
To run a stepper motor at different speed by using 8051 assemble
language
APPARATUS REQUIRED:
Stepper Motor
Interface Board
PROCEDURE:
1. Switch ON the micro controller
2. Initialize the starting address
3. Enter the mnemonics code in the microcontroller
4. Reset the microcontroller
5. Execute the program
PROGRAM:
TO RUN A STEPPER AT DIFFRENT SPEED IN BOTH PORTS
72
Shanmugam M
412F 22 RET
4130 END
4500 09, 05, 06, 0A TABLE: DB 09, 05, 06, 0A
RESULT:
Thus the program to run the stepper motor at different speed was derived
using 8051 assembles language and was verified.
73
Shanmugam M
RUN THE STEPPER MOTOR IN FORWARD AND REVERSE
DIRECTION
EXPT NO: 16b DATE:
AIM:
To run a stepper motor in forward and reverse rotation using 8051
assembly language
APPARATUS REQUIRED:
Stepper Motor
Interface Board
PROCEDURE:
1. Switch ON the micro controller
2. Initialize the starting address
3. Enter the mnemonics code in the microcontroller
4. Reset the microcontroller
5. Execute the program
PROGRAM:
PROGRAM FOR FORWARD & REVERSE ROTATION IN 8051
PAGE1
2 $MOD52
4100 7C33 3 START : MOV R4, #33H
4102 904144 4 L2 : MOV DPTR, #FORWARD
4105 12411C 5 LCALL L1
4108 DCF8 6 DJNZ R4, L2
410A 124113B 7 LCALL DELAY
410D 7C33 8 MOV R4, #33H
410F 904148 9 L3 : MOV DPTR, # REVERSE
4112 12411C 10 LCALL L1
4115 DCF8 11 DJNZ R4, L3
4117 12413B 12 LCALL DELAY
411A 80E4 13 SLMP START
411C 7804 14 L1 : MOV R0, #04H
411E E0 15 LOOP : MOVX A, @DPTR
411F C083 16 PUSH 83H
4121 C082 17 PUSH 82H
4123 90FFC0 18 MOV DPTR,
4126 7A04 19 MOV #OFFCOH
R2, #04H
74
Shanmugam M
4128 7905 20 L7 : MOV R1, # 05H
412A 7BFF 21 L6 : MOV R3, # 0FFH
412C DBFE 22 L4 : DJNZ R3, L4
412E D9FA 23 DJNZ R1, L6
4130 DAF6 24 DJNZ R2, L7
4132 F0 25 MOVX @DPTR, A
4133 D082 26 POP 82H
4135 D083 27 POP 83H
4137 A3 28 INC DPTR
4138 D8E4 29 DJNZ R0, LOOP
413A 22 30 RET
413B 7D01 31 DELAY : MOV R5, #01H
413D 7A05 32 L9 : MOV R2, #01H
413F DAFE 33 L8 : DJNZ R2, L8
4141 DDFA 34 DJNZ R5, L9
4143 22 35 RET
4144 0905060A 36 FORWARD : DB 09H, 05H, 06H, 0AH
414B 0A060509 37 REVERSE : DB 0AH, 06H, 05H, 09H
RESULT:
Thus the program to rotate the stepper motor in forward and reverse direction
was derived using 8051 assemble language and was verified.
75
Shanmugam M
TRAFFIC LIGHT CONTROLLERS WITH 8085
AIM:
APPARATUS REQUIRED:
A SAMPLE SEQUENCE:
1. (a) Vehicles from south can go to straight or left.
(b) Vehicles from west can cross the road.
(c) Each pedestrian can cross the road.
(d) Vehicles from east no movement.
(e) Vehicles from north can go only straight.
76
Shanmugam M
(b) Vehicles from north can go only left.
(c) South pedestrian can cross the road.
(d) Vehicles from south, no movement.
(e) Vehicles from east can go only straight.
BIT ALLOCATION:
PATH REPRESENTATION:
77
Shanmugam M
CONTROL ----- 0F (FOR
8255 PPI) PORT A -----
0C
PORT B ----- 0D
PORT C ----- 0E
PROGRAM:
78
Shanmugam M
4128 7E MOV A, M Move M content
to accumulator
4129 D3 OUT 0E Load port C into output
412B CD CALL DELAY1 port DELAY address
Call
412E EB XCHG Exchange content of HL
with DE pair
412F 13 INX D Increment D register
4130 23 INX H Increment H register
4131 CD CALL OUT Call specified address
4134 EB XCHG Exchange content of HL
with DE pair
4135 7E MOV A, M Move M content
to accumulator
4136 D3 OUT 0E Load port C into output
4138 23 INX H port
Increment H register
4139 7E MOV A, M Move M content
to accumulator
413A D3 OUT 0C Load port A into output
413C CD CALL DELAY1 port
Call DELAY address
413F C3 JMP REPEA Jump to specified
4142 7E OUT MOV T M
A, address M content
Move
to accumulator
4143 D3 OUT 0E Load port C into output
4145 23 INX H port
Increment H register
4146 7E MOV A, M Move M content
to accumulator
4147 D3 OUT 0D Load port B into output
4149 23 INX H port
Increment H register
414A 7E MOV A, M Move M content
to accumulator
414B D3 OUT 0C Load port A into output
414D CD CALL DELAY port DELAY address
Call
4150 C9 RET Return to accumulator
4151 E5 DELAY PUSH H Push the register H
4152 21 LXI H,001F Load 00 1F in HL
register pair
4155 01 LXI B,FFFF Load FF FF in DE
register pair
4158 0B DCX B Decrement B register
4159 78 MOV A, B Move B content
to accumulator
415A B1 ORA C OR content of C
with accumulator
415B C2 JNZ LOOP Jump to LOOP if no
415 2B DCX H zero
Decrement H register
E
415F 7D MOV A, L Move L content
to accumulator
4160 B4 ORA H OR content of H
with accumulator
79
Shanmugam M
4161 C2 JNZ L1 Jump to L1 if no zero
4164 E1 POP H Pop the register H
4165 C9 RET Return from subroutine
4166 E5 DELAY PUSH H Push the register H
4167 21 1 LXI H,001F Load 00 1F in HL
register pair
416A 01 LXI B,FFFF Load FF FF in DE
register pair
416D 0B DCX B Decrement B register
416E 78 MOV A, B Move B conten to
accumulat t
416F B1 ORA C OR
or of C wit
conte h
4170 C2 JNZ LOOP2 Jump
nt to LOOP2 if no
4173 2B DCX H zero
Decrement
accumulatorH register
4174 7D MOV A, L Move L conten to
accumulat t
4175 B4 ORA H OR
or of H wit
conte h
4176 C2 JNZ L2 Jump
nt to L2 if no zero
4179 E1 POP H Pop the register H
accumulator
417A C9 RET Return to subroutine
417B 12 27 44 10 DATA
2B 92 10 9D SEQ
84 48 2E 84 DB
4187 48 4B 20 49 DATA_
04 E
RESULT:
Thus an assembly language program to simulate the traffic light at an
intersection using a traffic light interfaces was written and implemented.
80
Shanmugam M
SPEED CONTROL OF DC MOTOR
EXPT NO: 18 DATE:
AIM:
To control the speed of the PMDC motor using Versamax Micro PLC.
APPARATUS REQUIRED:
Speed Control Module Trainer
Versamax Micro PLC
PC
RS-232 Cable
12V DC Motor
Patch chords
THEORY
Anatomy Of A Feedback Control System
PID CONTROLLER
One of the most powerful but complex controller mode operations combines the
proportional, integral and derivative mode. This system can be used for virtually
any process condition. The block diagram of a PID controller is,
81
Shanmugam M
The variable ( ) represents the tracking error, the difference between the
desired input value ( ) and the actual output ( ). This error signal ( ) will be sent
to the PID controller, and the controller computes both the derivative and the
integral of this error signal. The control signal ( ) to the plant is equal to the
proportional gain ( ) times the magnitude of the error plus the integral gain (
) times the integral of the error plus the derivative gain ( ) times the derivative
of the error.
This control signal ( ) is sent to the plant, and the new output ( ) is obtained.
The new output ( ) is then fed back and compared to the reference to find the
new error signal ( ). The controller takes this new error signal and computes its
derivative and its integral again, ad infinitum
PROCEDURE:
1. Load the versapro software in PC
2. Open the versapro software.
3. PLC kit is switches ON
4. Interface PC to PLC through RS-232 cable.
5. Open the new folder and draw the ladder logic program.
6. Connect the PLC
7. Select the correct hardware configuration [PLC Sl.No]
8. Store the program to PLC.
9. Using patch chards, connect the PLC analog output to the input of the
PWM(i.e analog output of the speed control module trainer kit).
10. Using patch chards connect the speed control module trainer kit along
input to PLC analog input.
11. Run the program
12. Check the motor speed [1500 rpm].
82
Shanmugam M
TABULATION:
S.No Setpoint SP Process Controlled Kp Ki Kd Speed
variable variable CV
PV
RESULT:
Thus the speed of the PMDC motor was controlled using Versamax Micro
PLC.
83
Shanmugam M
STUDY OF VARIOUS TYPES OF TRANSDUCERS
EXPT NO: 19 DATE:
AIM
To study the features and types of transducers
THEORY
Sensor
Note that a transducer and a sensor are not the same. In the above given example
of thermocouple. The thermocouple acts as a transducer but the additional
circuits or components needed like the voltmeter, a display etc together from a
temperature sensor. Hence the transducer will just convert the energy from one
form to another and all the remaining work is done by the additional circuits
connected. This whole device forms a sensor. Sensors and transducers are closely
related to each other.
TYPES OF SENSORS
Sensors are classified based on the nature of quantity they measure. Following
are the types of sensors with few examples.
84
Shanmugam M
Acoustic and sound sensors
e.g.: Microphone, Hydrophone.
Automotive sensors
e.g.: Speedometer, Radar gun, Speedometer, fuel ratio meter.
Chemical Sensors
e.g.: Ph sensor, Sensors to detect presences of different gases or liquids.
Environmental Sensors
e.g.: Rain gauge, snow gauge, moisture sensor.
Optical Sensors
e.g.: Photo diode, Photo transistor, Wave front sensor.
Mechanical Sensors
e.g.: Strain Gauge, Potential meter (measures displacement).
Further classification can be done based on the principle of operation and nature
of output signal (analog or digital).
85
Shanmugam M
Types of Sensors
TRANSDUCER
86
Shanmugam M
transducer as it converts electrical signal to pressure waves (sound).But an
electrical transducer will convert a physical quantity to an electrical one.
TYPES OF TRANSDUCER
There are of many different types of transducer, they can be classified based on
various criteria as:
Types of Transducer based on Quantity to be Measured
Flow transducers
Piezoelectric
Chemical
Mutual Induction
Electromagnetic
Hall effect
Photoconductors
Active Transducer
Active transducers are those which do not require any power source for their
operation. They work on the energy conversion principle. They produce an
electrical signal proportional to the input (physical quantity). For example, a
thermocouple is an active transducer.
Passive Transducers
87
Shanmugam M
Transducers which require an external power source for their operation is called
as a passive transducer. They produce an output signal in the form of some
variation in resistance, capacitance or any other electrical parameter, which
than has to be converted to an equivalent current or voltage signal. For
example, a photocell (LDR) is a passive transducer which will vary the resistance
of the cell when light falls on it. This change in resistance is converted to
proportional signal with the help of a bridge circuit. Hence a photocell can be
used to measure the intensity of light.
88
Shanmugam M
ADDITIONAL EXPERIMENTS
PROBLEM
AIM
APPARATUS REQUIRED
Three cylinders are named as A, B & C. The corresponding limit switches are
a0 & a1, b0 & b1 and c0 & c1 for home and extended positions respectively.
The directional control valves for each cylinder are named as X, Y & Z
respectively and the cylinders are connected to them. The DC valves and
individual limit switches are given with power from the FRL unit. The output
from the limit switches are given as pilot to the DC valves, to make the
respective cylinder to move. To have control on starting of the cycle (i.e. A+)
the signal from the last actuated switch is given to the corresponding pilot
through a manually operated spring return 3/2 valve, which works as a start
switch. The output from each limit switch will create movement of cylinders as
follows
a1 C-
c0 B+
b1 A-
a0 C+
c1 B-
b0 A+ (Through manually operated valve)
Compressed air through FRL unit enters to the direction control valves and limit
switches. At the home condition the cylinders A & B are at the retracted
89
Shanmugam M
condition and the cylinder C is in the extended condition. So limit switches a0, b0
& c1 are in actuated condition and power comes to corresponding DC valves. The
output from b0 is now available at starting valve. To start the cycle the starting
valve is pressed for a while and released. If the starting valve is pressed the
output from the valve goes to actuate DC value X which causes the cylinder A
move forward. Now the limit switch a0 is released and at the end of the stroke
limit switch a1 is pressed. This causes supply of pilot pressure to the DC valve Z
and this causes the cylinder C to retract. This causes limit switch c1 released
and at the end of the stroke, c0 is pressed. Air coming out of c0 is actuating the
value Y and this causes the cylinder B to move forward. The forward motion of
the cylinder B releases the limit switch b0 and at the completion of the stroke
the switch b1 is actuated. This gives the pilot supply to valve X at the opposite
side and this lead to the retraction of the cylinder A. At the end of the stroke the
limit switch a0 is pressed and the value C is actuated to move the cylinder C
forward. This, at the end of the stroke presses the limit switch c1 and this leads
to the movement of cylinder backwards which is the last stroke of the cycle. At
the end of the cycle the limit switch b0 is pressed and the power comes to the
manually operated valve. As the manually operated valve is returned back to the
closed position by the spring after the hand pressure is released, the cycle stops
here waiting for another pressing of the start switch to start the next cycle.
RESULT
The given circuit is designed, constructed with the available components and
checked for working.
90
Shanmugam M
91
Shanmugam M
DESIGN OF AND / OR LOGIC FUNCTIONS
2. PROBLEM
AIM
COMPONENTS REQUIRED
1. Double acting 1
2. AND Valve
Cylinder 1
3. OR Valve 1
4. 4/2 DCV 1
5. Push button DCV 3
6. FRL Unit 1
DESCRIPTION
The input from the compressor is given to the FRL unit to get desired pressure
level. Then it is connected to input of directional control valve, Push buttons.
The output of two push button is connected to AND valve and output of AND
valve is given to the input of OR valve and another input is from the push
button. Output of OR valve is given to the directional control valve. The two
ends of double acting cylinder is connected to directional control valve.
WORKING
When both the push button of AND valve is pressed, then only we get the
extension and retraction of the cylinder. Where as in the case of OR valve, one
push button is pressed which is enough for the getting the extension and
retraction of the cylinder.
RESULT
Thus the logic AND and OR circuit were constructed and verified.
92
Shanmugam M
AND / OR logic functions circuit
93
Shanmugam M