Ee457 Studentmanual2015
Ee457 Studentmanual2015
Ee457 Studentmanual2015
EE 457
Student Name :
ID Number :
Course Description:
EE 457 – Applied Control Laboratory 1(0,0,2)
This laboratory is equipped with basic instruments and real time experiments that are necessary to
familiarize the students with the advanced concepts and updated technology in the control field. The
undergraduate experiments are designed to reinforce and expand many concepts covered in the
advanced control course EE 454 and digital control course EE483. Experiments are organized in
several groups of real time applications, such as:
- Data Acquisition and system modeling
- Computer control system using MATLAB
- Digital Control using PLC.
Note: The PLC part in this manual is compiled from previous manual (EE352), while sensor
part is compiled from QNET MECHKIT Lab Workbook. Some improvements are still needed to
enhance this manual. [Sutrisno Ibrahim]
2
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Experiment # P1
In recent years, computers have also taken over the operation of such relay logic
controllers, known as programmable logic controllers (PLCs). Even though originally
designed to control discrete state (ON/OFF) systems, they are capable also to control
analog control loops.
A PLC monitors inputs, makes decisions based on its program, and controls outputs to
automate a process or machine as shown in figure 1.This section is meant to supply
the reader with basic information on the functions and configurations of PLCs.
The input module accepts a variety of digital or analog signals from various field
devices (sensors) and converts them into a logic signal that can be used by the CPU.
The CPU module makes decisions and executes control instructions based on program
instructions in memory. Output modules convert control instructions from the CPU into
a digital or analog signal that can be used to control various field devices (actuators). A
power supply module is needed to convert the main a.c. voltage to necessary voltage
level for the processor and the circuits in the input and output modules. A programming
device is used to input the desired instructions in the memory of the processor. These
instructions determine what the PLC will do for a specific input. An operator interface
device allows process information to be displayed and new control parameters to be
entered. This module is optional and may be not found in some applications.
4. Experiment Steps
1. SIMATIC S7-Software (Step7 lite) installation, which is already done.
2. SIMATIC S7-Hardware configuration
3. Control program implementation using the Step7 lite and then downloading
the program into the CPU of the SIMATIC S7
4. Testing the loaded program in PLC
4
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
4.1. PLC-Software
The corresponding software to the used PLC must be installed on the programming
device like as PC. Then the hardware of the PLC must be defined for the software, this
step is called hardware configuration. Control programs can be implemented in a
Project of the software and then downloaded to the already configured CPU of the
PLC. After providing the CPU with the program, the PLC will be ready to control a
process.
Note that the software Step7 Lite is already installed on the PCs.
Exception in Step7 lite: Slot 3 is reserved for the interface module (IM) you can use to
connect racks stacked on top. If modules are inserted only in the lowest rack, you can
leave a space in the configuration.
5
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
In the example shown above I0.0, I0.1 and Q0.0 represent the first instruction
combination. If inputs I0.0 and I0.1 are energized, output relay Q0.0 energizes. The
inputs could be switches, pushbuttons, or contact closures. I0.4, I0.5, and Q1.1
represent the second instruction combination. If either input I0.4 or I0.5 is energized,
output relay Q0.1 energizes.
Your program is already implemented. You can download it to the CPU to control your
process.
6
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Note that, you can convert your control program from any programming language
(LAD, STL or FBD) into another language by clicking on the view on the toolbar and
selecting the desired language.
closed. I124.2 status bit is logic 1 because the normally closed (NC) overload relay
(OL) contacts are closed. Output Q124.0 is also programmed on the network. In
addition, a normally open set of contacts associated with Q124.0 is programmed on the
network to form an OR circuit. A motor starter is connected to output Q124.0.
Note that, momentarily depressing the Start pushbutton completes the path of current
flow and energizes the motor starter (M).This closes the associated (auxiliary contact
located As marker or memory variable in the PLC) contact Q124.0. When the Start
button, the auxiliary contacts Q124.0 remains closed as the output is energized. The
motor will run until the normally closed Stop button is depressed, or the overload relay
opens the OL contacts, breaking the path of current flow to the motor starter and
opening also its associated contact.
4.4.3. Timers
Timers are devices that count increments of time. Traffic lights are one example where
timers are used. In this example timers are used to control the length of time between
signal changes.
Timers are represented by boxes in ladder logic. When a timer receives logic “1” at the
start input (S), the timer starts to time. The timer compares its current time with the
preset time value (TV). The output (Q) of the timer is logic 0 as long as the current time
is less than the preset time. When the current time is greater than the preset time the
timer output is logic 1. There are three types of timers: On-Delay (ODT), Retentive On-
Delay (ODTS), and Off-Delay (OFFDT).
On-Delay (ODT)
On-Delay timer starts the specified timer if there is a positive edge at the start input (S).
A signal change is always necessary in order to enable a timer. The timer runs for the
time interval specified at input (TV) as long as the signal state at input (S) is positive.
The signal state at output (Q) is “1” when the timer has elapsed without error and the
9
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
signal state at the (S) input is still “1”. When the signal state at input (S) changes from
“1” to “0” while the timer is running, the timer is stopped. In this case the signal state of
output (Q) is “0”.
The timer is reset if the reset input (R) changes from “0” to “1” while the timer is
running. The current time and the time base are set to zero. The signal state at output
(Q) is then “0”. The timer is also reset if there is a logic “1” at the (R) input while the
timer is not running and the RLO (Result of logic operation) at input (S) is “1”. The
current time value can be scanned at the outputs (BI) and (BCD). The time value at
(BI) is binary coded, at (BCD) is BCD coded. The current time value is initial (TV) value
minus the time elapsed since the timer was started.
Timer experiment:
Consider a switch is connected to input I124.0 and a light is connected to output
Q124.0 as shown in the ladder program below.
In this example, When the switch I124.0 is closed (changing its signal state from “0” to
“1”) the timer T1 will be started. The preset time value (TV) has been set to 5. The
associated contact T1 will be closed after 5 seconds and the light will turn on (Q124.0
will be “1”) as long as the switch I124.0 is still closed. If the switch I124.0 were opened
before 15 seconds had passed, the timer is stopped and the light is turned off (if the
signal state of the reset input I124.1 changes from “0” to “1”, the time is reset
regardless of whether the timer is running or not).
4.4.4 Counters
Counters used in PLCs serve the same function as mechanical counters. Counters
compare an accumulated value to a preset value to control circuit functions. Control
applications that commonly use counters include the following:
• Count to a preset value and cause an event to occur
• Cause an event to occur until the count reaches a preset value
A bottling machine, for example, may use a counter to count bottles into groups of six
for packaging.
10
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Counter experiment:
A counter might be used to keep track of the number of vehicles in a parking lot. As
vehicles enter the lot through an entrance gate, the counter counts up. As vehicles exit
the lot through an exit gate, the counter counts down. When the lot is full a sign at the
entrance gate turns on indicating the lot is full.
Up/down counter C1 is used in this example. A switch, connected to the entrance gate,
has been wired to input I124.0. A switch, connected to the exit gate, has been wired to
input I124.1. A reset switch, located at the collection booth, has been wired to input
I124.3. The parking lot has 5 parking spaces. This value has been stored in the preset
value (PV) and the counter will be loaded with this value, when the signal state at the
11
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
set input (S) changes from logic 0 to logic 1. The counter output has been directed to
output Q124.0. As cars enter the lot the entrance gate opens. Input I124.0 transitions
from logic 0 to logic 1, incrementing the count by one. As cars leave the lot the exit
gate opens. Input I124.1 transitions from a logic 0 to a logic 1, decrementing the count
by 1. When the count has reached zero, the output Q124.0 turns off. When a car
enters, incrementing the count to 1, the sign at the output turns on.
5. Review questions
Select the correct answer for question 1 and 2.
1] The ____________ makes decisions and executes control instructions based on the
input signals.
A) CPU
B) Input module
C) Power supply
3] Draw a block diagram for the PLC showing the main functional items, and
enumerate the main steps to control a process with the PLC.
4] For the PLC ladder program shown in the following figure, state what input
conditions have to be met in each case for there to be an output from Q0.0 and Q0.1.
12
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Experiment # P2
Procedure:
• Create new step 7 light software project.
• Open the organization block OB1.
K9
In the symbol table, you assign a symbolic name and the data type to all the absolute
addresses which you will address later on in your program; for example, for input I
124.0 the symbolic name Key 1. These names apply to all parts of the program and are
known as global variables.
• Open the symbol table by clicking on its symbol in the left control menu or
selecting (View >> Symbols) from the menu bar, or by pressing (Ctrl+Alt+Y) on
the keyboard.
• Fill the symbol table as follows:
• Save the symbol table and Exit from the symbol editor.
• To change from absolute addressing to symbolic addressing, select the menu item
(View>>Display>>Symbolic Representation) or press on the symbol in the bar
menu.
13
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Q1) What is the difference between output coil and set coil instructions?
• Create the following ladder diagram in your project, and download it to the
PLC S7, then test its operation.
Q2) What is the logic function for both set and reset operations in the above ladder
diagram?
(SD) (On Delay Timer Coil) starts the specified timer with the <time value> if there is a
positive edge on the RLO state. The signal state of the timer is "1" when the <time
value> has elapsed without error and the RLO is still "1". When the RLO changes from
"1" to "0" while the timer is running, the timer is reset. In this case, a scan for "1"
always produces the result "0."
• Open the timer's folder in the program elements, and check out the different
types of timers. Mark each timer and press F1 to display the help to that timer.
14
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Note: in the above ladder diagram the timer T2 have the following parameters:
• TV: this is the on delay time we will use to delay the input signal at the timer
input (S).
• BI: is the current time value in binary form.
• BCD: is the current time value in BCD form.
We note that when we apply a signal (key1) to the T1(5s delay), output 1 will be
operated after 5 seconds, also at this moment T2 will be initialized, this means that
output 2 will be operated after 12 seconds (T1+T2).
15
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Let us program this on the PLC and test its operation. Insert the following in the symbol
table
Q124.0= Red light.
16
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Then write the following program, and test its operation. Try to explain what happens in
the timers each time.
17
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Experiment # P3
Equipments Required:
Siemens S7 PLC unit, conveyor belt, proximity sensor (B11), photo sensor (B10),
Metallic cylinder, and plastic cylinder.
Theoretical background:
The single track conveyer belt is for connecting two operating stations or units in order
to assemble flexible manufacturing facilities .using automatic handling equipment it can
be combined with any functional unit or operating module. The conveyor belt consists
of a single-track belt that is equipped with an electrical drive and includes an optical
sensor for detecting when work pieces reach the end of the conveyor and an inductive
sensor in the middle of the belt. The mechanical design of the belt employs metal
profiles that allow for additional installation options (sensors, cylinders) to easily be
retrofitted.
Procedure:
• Create new step 7 light software project.
18
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
• Save the symbol table and Exit from the symbol editor.
Write the following program and connect the sensors and motor terminals to the
needed PLC inputs according to the symbol table above. Put the metallic item between
the two sensors and then write the following program in the PLC and test its operation
as follows.
19
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Q1) What happens if you actuate the two operating keys at same time? Why?
Now remove the metallic object, put the Plastic object, and operate the system;
comment.
20
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
[D]: Controlling the conveyor belt periodically with stops at the sensor
locations.
In this practice we want to transfer the metallic cylinder periodically between position
proximity sensor and photo sensor for 5 times, and after that the belt will stop in front of
proximity sensor. In all positions the metallic piece will stop 3 seconds in front of these
sensors.
21
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
22
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Experiment # S1
1. Introduction
Mechatronics engineering is a cross-disciplinary field that combines mechanical
and electronic design in control systems architecture though the application of
computer programming. One of the most useful topics that can be covered in an
introductory mechatronics course is the understanding and application of sensors.
Various sensors are used in all types of industries. For example, in the automotive
industry magnetic field transducers are used for throttle, pedal, suspension, and valve
position sensing. In assembly line and machine automation, optical sensors are used
for non-contact position sensing and safety. Piezo film sensors are installed in
packages to log vibration history of a shipment.
The QNET mechatronics sensors (MECHKIT) trainer is shown in Figure 1.1. It
has ten types of sensors, two types of switches, a push button, and two LEDS. This
QNET module can be used to teach the physical properties of most sensors used
today, and the techniques and limitations of their application.
There are 12 experiments that can be done with the kit: strain gage with flexible
link, pressure sensor, piezo sensor, potentiometer, infrared, sonar, optical position,
magnetic field, encoder, temperature sensor, switches and LEDs, and switch debounce
analysis. The experiments can be performed independently. In order to successfully
carry out this laboratory, the user should be familiar with the LabVIEW to run Visual
Instruments (Vis).
23
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
2. SENSOR PROPERTIES
This section discusses various sensor properties that are often found in
technical specifications.
1. Resolution
The resolution of a sensor is the minimum change that can be detected in the
quantity that is being measured. For instance a sensor that measures angular
position of a motor shaft may only be able to detect a 1 degree change. Thus if
the motor moves 0.5 degrees, it will not be detected by the sensor. Depending
on the precision needed for the application, this may be adequate.
2. Range
Range sensors can only take measurements of a target within a certain
operating range. The operating range specifies a maximum, and sometimes
also a minimum, distance where the target can be from the sensor in order to
obtain an accurate measurement. Sensors with a small range are the magnetic
field and optical position sensors. Sensor with a relatively larger range are
infrared and sonar.
y = ax + b (2.1)
where a is the rate of change and b is the offset. Variable x is the sensor output
signal and y is the measurement, e.g. for the potentiometer x would be the voltage
measured by the sensor and y would be the angular measurement (in either degrees
or radians). Other types of sensors need to be characterized by more complex
relationship such as polynomial
y = ax2 + bx + c (2.2)
24
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
or exponential
y = aebx (2.3)
Figure 3.1: Strain gage measuring deflection of flexible link on QNET mechatronic sensors trainer
deflection of flexible link on QNET mechatronic sensors trainer .
25
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
The virtual instrument used to determine the natural frequency of the flexible link is
shown in Figure 3.4.
26
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
27
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
3.6 Results
Table 3.2 Strain gage results summary
28
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Experiment # S2
4. Pressure Sensor
4.1 Background
A pressure sensor is attached to the plunger on the QNET mechatronic board shown in
Figure 4.1. This is a gage pressure sensor and its measurements are relative to the
atmospheric pressure. The voltage signal generated is proportional to the amount of
pressure in the vessel of the plunger. So as the plunger is pushed further, the air inside
the vessel becomes more compressed and the reading increases. Pressure sensors
can also be used to indirectly measure other values. For example, in the QNET
mechatronics board the position of the plunger head is measured. It can also be used
to measure the amount of volume in a reservoir or the altitude of an aerial vehicle.
29
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
30
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
4.6 Results
Table 4.2 Pressure sensor results summary
31
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
5. Piezo Sensor
5.1 Background
Piezo sensors measure vibration. The piezo sensor on the QNET-MECHKIT trainer,
shown in Figure 5.1, is connected to a plastic band that has a brass disc weight at the
end.
32
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Experiment # S3
6. Potentiometer
6.1 Background
Rotary potentiometers are absolute analog sensors used to measure angular position,
such as a load shaft of a motor. They are great to obtain a unique position
measurement. However, caution must be used as their signal is discontinuous. That is,
after a few revolutions potentiometers will reset their signal back to zero. The
potentiometer on the QNET MECHKIT board is shown in Figure 6.1.
33
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
34
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
6.6 Results
Table 6.2 Potentiometer results summary
7. Infrared
7.1 Background
Infrared (IR) sensors are widely used in robots, automotive systems, and various other
applications that require an accurate, medium-range non-contact position
measurement. An IR sensor is typically composed of an infrared emitting diode (IRED),
a position sensing detector (PSD), and a signal processing circuit. It outputs a voltage
the correlates to the distance of the remote target. The infrared distance measuring
sensor on the QNET MECHKIT board is shown in Figure 7.1. Infrared-based distance
sensors typically have a smaller maximum range than sonar but the resolution is
better.
35
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
2. Open and configure the QNET MECHKIT Infrared VI as described in Section 15.6.
Make sure the correct Device is chosen.
3. Run QNET_MECHKIT_Infrared.vi
4. Turn ON the IR switch to enable the Infrared sensor. The IR ON LED should be lit
bright red. Important: Make sure you turn OFF the IR switch when the experiment
is over. When active, the infrared sensor tends to generate noise in other sensor
measurements.
5. Get a target, such as a sturdy piece of cardboard, that is at least 10 by 10 cm2 with
a reflective colour like white or yellow.
6. Begin with the target close to the IR sensor and slowly move it away.
7. Once its range of operation is found, enter the distance between the target and the
IR sensor in the Target Range (cm) array, as shown in Figure 7.2.
8. Enter the corresponding measured voltage from the IR sensor in the Sensor
Measurement (V) array, as shown in Figure 7.2.
9. Repeat for different target positions. The IR sensor is quadratic. As the
measurements are entered, the coefficients for the second-order polynomial are
generated and the fitted curve is automatically plotted.
10. Record your distance and voltage observations and capture the corresponding
Sensor Readings scope.
Table 7.1 Infrared sensor results
7.5 Results
Table 7.2 Infrared sensor results summary
37
EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University
Labwork Report
Experiment :
Name :
ID :
Results:
38