EE 457 Applied Control Laboratory, Assignments of Electrical Engineering

EE 457 – Applied Control Laboratory, Electrical Engineering Department, King Saud University. 3. Experiment # P1. PLC (S7) Hardware and Software.

Typology: Assignments

2021/2022

Uploaded on 08/01/2022

fabh_99
fabh_99 🇧🇭

4.4

(53)

543 documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
King Saud University
College of Engineering, Electrical Engineering Department
EE 457
Applied Control Laboratory
Student Name :
ID Number :
[Updated: Feb, 2015]
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download EE 457 Applied Control Laboratory and more Assignments Electrical Engineering in PDF only on Docsity!

King Saud University

College of Engineering, Electrical Engineering Department

EE 457

Applied Control Laboratory

Student Name :

ID Number :

[Updated: Feb, 2015]

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.

Textbooks: LAB Notes are prepared including a complete set of experiments. Co-requisite: EE 456. [ Course description is taken from EE KSU new plan, 2008 ]

Contents of this manual:

PLC

Experiment #P1: PLC (S7) Hardware and Software

Experiment #P2: S7 Advanced Programming Techniques

Experiment #P3: Control of Conveyor System Using PLCs and Sensors

DATA ACQUISITONS (SENSORS)

Experiment #S1: Introduction and Strain Gage Sensor

Experiment #S2: Pressure and Piezo Sensors

Experiment #S3: Potentiometer and infrared sensors

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.1. Fundamental elements in a PLC

Typically a PLC system has five basic elements:

  • Input modules: 5 V, 24 V, 110 V, 240 V DC
  • Output modules: relay type (ac and dc switching), transistor type (dc switching), or triac type (loads with ac power supply)
  • Central processing module (CPU) + memory
  • Power supply module
  • Programming device
  • Operator interface (optional)

Figure P1.2: PLC elements

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.

3. Required equipment for the experiment

The aim of this first experiment is to understand the functionality of the PLC SIMATIC S7. For that experiment you need the following equipment:

  • SIMATIC S7 device
  • Suitable software for programming the PLC
  • Programming device (PC)

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 S
  4. Testing the loaded program in PLC

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.

4.2. Hardware configuration 4.2.1. Basic Procedure for Configuring Hardware Starting the Hardware Configuration When you have implemented a new project, open the workspace for configuring and assigning parameters to modules by double-clicking the " Hardware " symbol.

Workspace for Configuring The workspace for configuring a programmable controller consists of the following areas:

  • The graphical overview, in which the racks are realistically represented with modules.
  • Table(s) which represent individual racks, but which contain additional information about the modules (order number and addresses, etc.), in contrast to the graphical overview.
  • The "Hardware Catalog" from which you select the required hardware components, for example, modules and interface submodules.

4.2.2. Basic Steps for Configuring a Station Independent of which structure a station has – you always configure using the following steps:

  1. Select a hardware component in the “Hardware Catalog”.
  2. Copy the selected component using drag & drop
    • To a slot on the rack in the graphical view or
    • To a row in the configuration table that represents the structure of the rack.

Tips – Inserting modules

  1. Copy the selected component on the rack in the graphical view beginning from the left to right, insert the power supply module, CPU, input module, output module.
  2. Modules must be inserted without leaving empty slots between them. Otherwise, they cannot be supplied with power via backplane bus.

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.

4.3. Implementing a control program A program consists of one or more instructions that accomplish a task. Programming a PLC is simply constructing a set of instructions. There are several ways to look at a program such as ladder logic, statement lists, or function block diagrams.

4.3.2. Statement list (STL) A statement list (STL) provides another view of a set of instructions. The operation, what is to be done, is shown on the left. The operand, the item to be operated on by the operation, is shown on the right. A comparison between the statement list shown below, and the ladder logic shown on the previous page, reveals a similar structure. The set of instructions in this statement list perform the same task as the ladder diagram.

Figure 4: Statement list

4.3.3. Function Block Diagram (FBD) Function Block Diagram (FBD) provides another view of a set of instructions. Each function has a name to designate its specific task. Functions are indicated by a rectangle. Inputs are shown on the left-hand side of the rectangle and outputs are shown on the right-hand side. The function block diagram shown below performs the same function as shown by the ladder diagram and statement list.

Figure 5: Functional block diagram

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.

4.4. Implementation of the experiment After you have configured the hardware (see 4.2), you have to develop the following basic software modules:

  1. Basic logic operation
  2. Motor start and stop circuit
  3. Timers
  4. Counters

4.4.1 Basic logic operation The following programming example demonstrates an OR operation for the results of two AND operations. Two normally closed contact closures are placed in the first branch and two normally open contact closures are placed in the second branch. They were assigned addresses I124.0, I124.1, I124.2 and I124.3 respectively. If the signal state of both inputs I124.0 and I124.1 is “0” or the signal state of I124.2 and I124.3 is “1”, the output Q124.0 will be “1”. Except that the output Q124.0 will be “0”.

Figure 6: An example for basic logic operation

4.4.2. Motor start and stop circuit The following example involves a motor start and stop circuit. The line diagram illustrates how a normally open and a normally closed pushbutton might be used in a control circuit. In this example a motor started (M) is wired in series with a normally open momentary pushbutton (Start), a normally closed momentary pushbutton (Stop), and the normally closed contacts of an overload relay (OL).

Figure 7: Motor start/stop components

Motor start and stop experiment: A normally open Start pushbutton is wired to the first input (I124.0), a normally closed Stop pushbutton is wired to the second input (I124.1), and normally closed overload relay contacts (part of the motor starter) are connected to the third input (I124.2). The first input (I124.0), second input (I124.1), and third input (I124.2) form an AND circuit and are used to control normally open programming function contacts on the network. I124.1 status bit is logic 1 because the normally closed (NC) Stop Pushbutton is

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.

Figure 10: On-Delay timer

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. 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.

Figure 11: Counters in packaging application

Counters are represented by boxes in ladder logic. Counters increment/decrement one count each time the input transitions from off (logic 0) to on (logic 1). The counters are reset when a RESET instruction is executed. There are three types of counters: up counter (CU), down counter (CD), and up/down counter (CUD) as shown in the following figure.

Up/Down Counter (CUD) If the set input (S) changes from logic 0 to logic 1, the counter is preset with the value at the input (PV). If the signal state of (CU) changes from logic 0 to logic 1, the value of counter (C no.) will be incremented by one – except when the value of (C no.) equal to “999”. If (CD) changes from logic 0 to logic 1, the value of counter (C no.) will be decremented by one - except when the value of (C no.) equal to “0”. The output Q is “1” if the current value (C no.) is not equal to zero.

Figure 12: Up-Down counter

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

Experiment # P

S7: Advanced Programming Techniques

1. Objectives

Upon the completion of this experiment, the student should be able to:

  • Introduction to Siemens PLCs programming and Step-7 light software tools (Symbol table, Set, reset operations, and memory flags).
  • Familiarization with Siemens PLCs timers and counters.
  • Study of some actual example in programming of the PLC.

Procedure:

  • Create new step 7 light software project.
  • Open the organization block OB1.

[A]: Programming with Symbols Absolute Addresses Every input and output has an absolute address predefined by the hardware configuration. This address is specified directly; that is, absolutely for example I 124. is an absolute address. The absolute address can be replaced by any symbolic name you choose.

K 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.

Note: We refer to the “result of logic operation” By RLO.

[B]: Set & Reset Coil The Set Coil instruction is executed only if the RLO = 1. If the RLO = 1, this instruction sets its specified address to 1. If the RLO = 0, the instruction has no effect on the specified address. The address remains unchanged. The Reset Coil instruction is executed only if the RLO = 1. If the RLO = 1, this instruction resets its specified address to 0. If the RLO = 0, the instruction has no effect on its specified address. The address remains unchanged.

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?

[C]: Other PLC Timers Timers have an area reserved for them in the memory of your CPU. This memory area reserves one 16-bit word for each timer address. The ladder logic instruction set supports 256 timers.

(SD) (On Delay Timer Coil) starts the specified timer with the

  • 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.

Q3) From the help, explain the operation of the SP timer.

  • Create the following ladder diagram, and then test its operation.

[E]: Comparison Instructions

  • Create the following ladder diagram, and then test its operation using the PLC.
  • Try to test other types of comparator.

[F] Designing Traffic Light system Using PLC. We are going to control traffic light system using plc with the following sequence. 1- The red light is on for specific time. 2- Both red and yellow lights are on for specific time. 3- Both red and lights turn off and the green light turns on. 4- The green light is on for specific time. 5- The green light turns off and the yellow light is turned on for a specific time. 6- The yellow light turns off and the red light turns on again.

Let us program this on the PLC and test its operation. Insert the following in the symbol table Q124.0= Red light.

Q124.1 = Yellow light. Q124.2= Green light.

Then write the following program, and test its operation. Try to explain what happens in the timers each time.

Q5) what is the function of the external input I 124.0?

Fill the symbol table bellow.

  • Save the symbol table and Exit from the symbol editor.

[A]: Simple operation of the conveyor belt. The following figure shows a conveyor belt that can be activated electrically. Two start buttons (key1 and key2) is used to move the conveyor belt in both directions, and one button is used to stop it. The proximity sensor is used to detect metallic cylinder only and photo sensor is used to detect both of the cylinders, such that when the cylinder reaches the sensor, the conveyor belt stop.

Fig.1 The conveyor belt.

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.

-Actuate Key1 and see what happens; comment. -Actuate key 2 and see what happens; comment. -Actuate the two keys at the same time and note the operation of the conveyer belt, comment.

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.

B) Alternating movement of the conveyor.

  • Create the following ladder diagram in your project, and download it to the PLC S7, then test its operation.

This program will operate the conveyer in the alternating movement.

  • Put the metallic cylinder between the two sensors.
  • Actuate key1 and note what happens, write that in your notes and try to explain the logic of operation.
  • Now actuate key2 and note that the conveyer will stop.

Q2) What is the function of B11, B10, and key1?

[C]: Controlling Storage Area with Counter and Comparators. In this part, the conveyor belt is used to deliver items to a temporary storage area and to transport these items from that storage area. Using a proximity sensor, we must keep track of the number of items in the storage area (5 times). When the conveyor belt is on in the right direction, it delivers items to the storage area, while when it is on in the left direction, it transport items from the storage area.

  • Put the metallic item between the two sensors.
  • Write the following program in the PLC.
  • Test the operation of this circuit and write your notes.