finnal diploma me 111 control project
TRANSCRIPT
Final Diploma Control Project ME 111
Higher Technological InstituteDepartment of Mechanical Engineering
Prepared by Dr. Mohiy E. Bahgat
Final Diploma Control Project
Mechatronics Final Control Project
1. Control projects :
The student can choose one of three projects :
1. Temperature control system.
2. Water level control system.
3. Pressure control system.
The three projects have the same control components, so, the control system
design will be discussed for the temperature control project as an example.
2. Temperature Control System :
The temperature control project block diagram is displayed in Fig (1) and (2).
Fig (1) - Closed loop temperature control system
Page 2
Final Diploma Control Project
Fig (2) - Temperature control system block diagram
Page 3
Final Diploma Control Project
Types of temperature sensors :
Thermistor RTD PT100 Thermocouple LM35
3. Objectives : To control the temperature of a fluid at any prescribed temperature
degree.
4. Introduction :
Temperature control is one of the basic control processes which use small
elements to achieve its concept. The main parts used among such a project
comprises :
Analog to digital converter ( ADC )
Such IC is used to convert analog signals into binary words. Figure (3)
shows the basic elements of the ADC. The procedure used is that a clock
supplies regular time signal pulses to the analogue to digital converter
and every time it receives a pulse it samples the analog signal. The result
of the sampling is a series of narrow pulses. A sample and hold unit is
then used to hold each sampled value until the next pulse occurs. See
figure (3). The simple analogue to digital converter is IC 0804 which
converts only one analog signal to digital one; the data sheet of its bin
description as it follows :
i) Chip Select (CS) : which is an input to activate the ADC 0804 chip.
Whenever this chip is to be functioned this CS input is activated. For
Page 4
Final Diploma Control Project
ADC 0804 chip select is an active low input. So whenever you want
ADC 0804 chip is to be function this pin is made low.
ii) Write (WR) : which is a control signal to tell the ADC chip to start
the conversion of analog data to binary format, it is an active low
input. When the Chip Select (CS) is at zero logic level, and a low to
high going pulse is applied to write pin of the ADC chip, chip starts
the conversion of the analog signal at its input terminal into 8-bit
binary output. The conversion hence depends on the input clock
(CLKIN) and CLKR inputs.
iii) CLK IN and CLKR : These two pins determines the conversion
time. When an external clock signal is applied for the timing CLK
IN pin is connected to the external clock signal. But there is an extra
feature in ADC 0804 chip. It has its own internal clock generator. If
someone wants to use this internal clock signal CLK IN and CLKR
are connected to resister and capacitor respectively. In this case the
clock frequency is calculated by : f = 1/ 1.1 RC Hz
where R is the resistance value and C is the capacitance value.
Normally we use R=10 KΩ and C=150 pF which are standard
values to get the frequency o 606 KHz with a conversion time of
110 micro seconds.
iii) Read (RD) : which is an input signal and also called output enable.
When the conversion completes the ADC chip 0804 stores the
converted data in its internal registers, to get this data as output, read
(RD) signal has to be applied. For this ADC chip RD is an active
low signal. When the data is to be read a low signal is sent to RD pin
Page 5
Final Diploma Control Project
keeping the CS pin low. The converted 8 bit data is available on the
output pins D0 to D7.
iv) Interrupt (INTR) : which is an output signal given by the ADC chip.
This signal is used as an input signal to microcontroller normally this
signal is at logic high. When the conversion completes the ADC
produces an active low interrupt signal. When this happens to read
the converted data the read signal is to be applied to ADC 0804
keeping CS signal low.
v) Vin (+) and Vin(-) : these are two differential analog input. The
effective Vin is Vin (+) ï؟½ Vin (-). Normally analog signal is
applied to Vin (+) keeping Vin (-) to ground. Vin should not be
exceeded than + 5V.
vi) Vref/2 : this is as reference voltage. To vary the range of signal
voltage this pin is used. This pin is kept at a potential deference half
of the Vin applied. The maximum Vin can be applied is + 5V. When
Vref/2 pin is kept open ADC reads to voltage from 0 to 5V.
vii) D0 to D7 : These are the 8 bit binary output pins of ADC 0804 chip.
ix) VCC : This is a power supply used for the proper functioning of ADC
chip. Normally this voltage is + 5v.
x) Ground (GND) : There are two ground pins in ADC chip representing
the analog ground and digital ground. Analog ground is connected to
the ground of analog signal source and digital ground is connected to
the ground of the Vcc source. This is done to isolate the analog in
signal from transient voltages caused by digital switching of the
Page 6
Final Diploma Control Project
output D0-D7 and for accuracy of the digital output of analog input
signal.
Fig (3) - Analog to digital conversion steps
The IC shape and bin description are shown in figure (4).
Page 7
Final Diploma Control Project
Fig (4) - ADC0804 bin description
Electrically erasable programmable read only memory (EEPROM) :
The EEPROM is one of the main types of programmable ROMS; which has
the ability to erase and rewrite individual bytes in the memory array
electrically During write operation. Internally circuitry erases all of the cells
at an address location prior to writing in the new data. This byte eras ability
makes it much easier to make changes in the data stored in an EEPROM.
The bin description is as follows :
The EEPROM has three control inputs determines the operating mode
according to table (1).
Page 8
Final Diploma Control Project
Table (1) - Ppin configuration
With CE=HIGH the chip is in its low-power standby mode, in which no
operation are being performed on any memory location and the data pins are
high.
To read the contents of a memory location, the desired address is applied to
the address pins; CE is driven low; and output enable pin OE is driven low to
enable the chip outputs data buffers. The write enable pin WE is held high
during a read operation.
To write into (a program) a memory location. The outputs buffers are
disabled so the data to be written can be applied as inputs to the I/O pins. To
begin write operation WE and CE are driven low; OE is driven high. The bin
description of EEPROM IC is shown in figure (5).
Page 9
Final Diploma Control Project
Fig (5) - Example of EEPROM IC AT28C16
BCD to 7- segment decoder
A decoder is a logic circuit that accepts a set of inputs that represents a
binary number and activates only the output that corresponds to that input
number. In other words, a decoder circuit looks at its inputs, determines
which binary number is present there, and activates the one output that
corresponds to that number; all other outputs remain inactive. The diagram
for a general decoder is shown in figure (6) with N inputs and M outputs.
Fig (6) - Decoder block diagram
Page 10
Final Diploma Control Project
a BCD-to-7-segment decoder/driver (7447) being used to drive a 7-segment
LED readout. Each segment consists of one or two LEDs. The anodes of the
LEDs are all tied to Vcc(+5 V). The cathodes of the LEDs are connected
through current-limiting resistors to the appropriate outputs of the
decoder/driver, See Fig (7).
Fig (7) - BCD to 7- segment decoder
Magnitude comparator
The 7485 IC is a 4-Bit Magnitude Comparator which compares two 4-bit
words (A, B), each word having four Parallel Inputs (A0–A3, B0–B3); A3,
B3 being the most significant inputs. The logic symbol is shown in Fig (8).
Fig (8) - Magnitude comparator pin configuration
Page 11
Final Diploma Control Project
Cascading inputs provide a means for expanding the comparison operation to
more than four bits by cascading two or more four-bit comparators.
If 8-bit words are used, the outputs of the first 4-bit comparator (low order bits)
are connected to the carry inputs of the second stage. The result of the overall
comparison is obtained from the outputs of the highest order 4-bit comparator,
whereby the appropriate output goes high. The cascading inputs should be
connected as shown in order for the comparator to produce the correct out puts;
figure (9).
Fig (9) - Two 7485 cascaded to perform an eight-bit
Page 12
Final Diploma Control Project
Isolation stage
OP-Amp is light D.C amplifier with gain ≈ 100,000. This stage is very
useful for isolation and ensure the signal will not have noise or decreases
with time. See Fig (10)
Fig (10) - OP-AMP pin description
It is a silicon chip which has
Inputs ( inverting and noninverting )
+ Voltage supply and - voltage supply
Two offset
One output
Depending on the connection of the Op-Amp the output may vary
Relay
Relay advantages
1) Switching high load with small voltage.
2) Complete isolation
Page 13
Final Diploma Control Project
The relay specified by
1) Relay coil voltage
2) Maximum current for the contact
There are many types of relays; the difference between them is the number
of contacts, voltage and ampere. As an example a five volt relay which has
to contacts one normally closed and the other is normally open; see figure
(2.11-a).
To connect the relay in any circuit; it is better to use switching circuit to
activate the relay coil as it shown in figure (2.11-b); when we apply voltage
value on the base of the transistor the transistor will be switched on and the
current will bass through the coil and the contacts will change there state.
Fig (11) - a) Relay pin description.
b) Relay connection in circuit
Page 14
Final Diploma Control Project
5. Part List :
Resistance (10kΩ Fixed, 2 x 1kΩ Fixed, 10kΩ Variable, 330Ω Fixed)
Capacitors (150 Pf)
7447 BCD to 7-segment decoder
7485 magnitude comparator
Board OPAMP
EEPROM ADC
Rozita Wires
TIP741 transistor Relay
LED
6. EEPROM calibration :
This part will discuss the procedure to make calibration for the EEPROM.
Table (2) - Temperature control calibration procedure
NO. Procedure
1 First connect the ADC input in a voltage divider circuit.
2 Then turn on the pump to supply the tank by water.
3 After that watch the ADC digital output and take the reading of the
temperature at each digital number appears in the output of the ADC.
4 Then after reaching a certain limit turn off the heater and power and
tabulate the readings.
Calibration results:-
Page 15
Final Diploma Control Project
Table (3) - Temperature control calibration results
Actual
Temperature
Temperature Binary code Equivalent
decimal code
25 25 01101100 54
30 30 01001100 50
40 40 00001100 48
50 50 01100100 38
51 51 00100100 36
52 52 01000100 34
54 54 00000100 32
65 65 01101000 22
67 67 00101000 20
70 70 01001000 18
74 74 00001000 16
91 91 01100000 6
After getting these results we should write it on Exedit program to write on the
memory the input output values. The procedure to use the EXedit program will be
as it shown in the next figures
Page 16
Final Diploma Control Project
Page 17
Final Diploma Control Project
7. Layout :
Page 18