Вы находитесь на странице: 1из 37

I

PLC BASED ELEVATOR CONTROL SYSTEM DESIGN


HARDWARE: S7 200 SIEMENS PLC
SOFTWARE ENVIRONMENT: STEP 7 MICROWIN
HMI ENVIRONMENT: Win CC


DESIGNED AND IMPLEMENTED BY
DANIEL GAKWAYA.




More on our work at www.blikoon.com

II
Abstract
This paper describes the use of SIEMENS S7-200 Programmable Logic Controller to
monitor and instruct a four-floor elevator system.SIMATIC WinCC has been used to provide
real time inspection of the system. PLCs have proven to be able to withstand harsh
environments and this made them very popular in industrial process control. The combination
of a PLC system and a reliable HMI system such as SIMATIC WinCC just makes things
handier for the design and maintenance engineer. This is not only an advantage for
technically skilled staff since the behavior of the system can be displayed on any windows
based computer system and operators can be warned when errors occur. PLCs and their HIM
systems are very practical technologies of our time and their mastery will no doubt boost the
student skills in his daily technical life since the system is approached from both hardware
and software design perspectives.

Keywords Elevator ,PLC control, WinCC ,HMI .





















III

Table of Contents

Abstract...... ......I
Table of Contents....II
1. Overview.....1
1.1 PLC history....1
1.2 PLC characteristics....2
1.3 How PLC works....3
1.4 PLC programming language..........5
1.5 Human Machine Interface.....8
1.6 PLC applied in Elevator System Applications...9
2. Selection of the PLC model..10
2.1 Considerations in choosing a suitable PLC..10
2.2 Type of I/O and Capacity Needed............10
2.3 Memory and Programming Requirements....11
2.4 S7 200 and Project Specifics.....12
3. Hardware Design...14
3.1 Hardware Configuration....14
3.2 Input module..14
3.3 Output Module.......15
3.4 Elevator Control System Signals....15
3.5 Input / Output Allocation....15
3.6 Control Board.....................................................................................................16
4. Software Design...18
4.1 Design Logic....18
4.2 Overview of Implementation Techniques....19
4.3 Software Flowchart..19
4.4 Register allocation....24
5. Human Machine Interface Design...26
5.1 SOMATIC WinCC Overview26
5.2 Communication between WinCC and the Automation System...26
5.3 Project Specific HMI Design...27
6 System Debug...........................................................................................................29
6.1 Hardware debug...29
6.2 Software debug....30
Summary....31
Acknowledgements...32
Dedication.33
References 34



1
1. Overview
1.1 PLC History
In the late 1960's PLCs were first introduced. The primary reason for designing such a
device was eliminating the large cost involved in replacing the complicated relay based
machine control systems. Bedford Associates (Bedford, MA) proposed something called a
Modular Digital Controller (MODICON) to a major US car manufacturer. Other companies at
the time proposed computer based schemes, one of which was based upon the PDP-8. The
MODICON 084 brought the world's first PLC into commercial production.
When production requirements changed so did the control system. This becomes very
expensive when the change is frequent. Since relays are mechanical devices they also have a
limited lifetime which required strict adhesion to maintenance schedules. Troubleshooting was
also quite tedious when so many relays are involved. Now picture a machine control panel that
included many, possibly hundreds or thousands, of individual relays. The size could be mind
boggling. How about the complicated initial wiring of so many individual devices! These relays
would be individually wired together in a manner that would yield the desired outcome. As can
be seen, there were many problems with this relay based design!
These "new controllers" also had to be easily programmed by maintenance and plant
engineers. The lifetime had to be long and programming changes easily performed. They also
had to survive the harsh industrial environment. That's a lot to ask! The answers were to use a
programming technique most people were already familiar with and replace mechanical parts
with solid-state ones.
In the mid70's the dominant PLC technologies were sequencer state-machines and the
bit-slice based CPU. The AMD 2901 and 2903 were quite popular in Modicon and A-B PLCs.
Conventional microprocessors lacked the power to quickly solve PLC logic in all but the
smallest PLCs. As conventional microprocessors evolved, larger and larger PLCs were being
based upon them. However, even today some are still based upon the 2903. (Ref A-B's PLC-3)
Modicon has yet to build a faster PLC than their 984A/B/X which was based upon the 2901.
Communications abilities began to appear in approximately 1973. The first such system
was Modicon's Modbus. The PLC could now talk to other PLCs and they could be far away
from the actual machine they were controlling. They could also now be used to send and receive
varying voltages to allow them to enter the analog world. Unfortunately, the lack of
standardization coupled with continually changing technology has made PLC communications
a nightmare of incompatible protocols and physical networks. Still, it was a great decade for the
PLC!

2
The 80's saw an attempt to standardize communications with General Motor's
manufacturing automation protocol (MAP). It was also a time for reducing the size of the PLC
and making them software programmable through symbolic programming on personal
computers instead of dedicated programming terminals or handheld programmers. Today the
world's smallest PLC is about the size of a single control relay!
The 90's have seen a gradual reduction in the introduction of new protocols, and the
modernization of the physical layers of some of the more popular protocols that survived the
1980's. The latest standard (IEC 1131-3) has tried to merge plc programming languages under
one international standard. We now have PLCs that are programmable in function block
diagrams, instruction lists, C and structured text all at the same time! PC's are also being used to
replace PLCs in some applications. The original company who commissioned the MODICON
084 has actually switched to a PC based control system.
1.2 PLC characteristics
In this section we use the SIEMENS S7 200 to describe some of the characteristics of
PLCs; it should be known that these can be easily extended to other manufacturers PLCs since
the concepts and the design goals are mostly alike.
The Micro PLC SIMATIC S7-200 is truly in a class of its own: its both compact and
highly powerful especially considering its real-time response its fast, features great
communication options and come with easy-to-operate software and hardware. But theres
more; the Micro PLC SIMATICS7-200 has a compact modular design for customized
solutions which arent too large, but flexible enough to be expanded any time in the future. All
this makes the SIMATIC S7-200 a great choice for open-loop control in the lower
performance range. Become one of the thousands of S7-200 customers that constantly benefit
from Siemens PLC innovation and lower cost of ownership.

SIMATIC S7-200 delivers consistently economical solutions. The entire system family
features powerful performance, optimum modularity and open communications. In addition,
the SIMATIC S7-200 programming tools make your job even easier: this Micro PLC is easy
to program allowing fast and easy realization of applications and the add-on software
libraries accelerate special function configuration even more. This Micro PLC has been in
successful use in millions of applications around the world in both stand-alone and
networked solutions.

PLCs not only are capable of performing the same tasks as hard-wired control, but are
also capable of many more complex applications. In addition, the PLC program and electronic
communication lines replace much of the interconnecting wires required by hard-wired
control. Therefore, hard-wiring, though still required to connect field devices, is less intensive.
This also makes correcting errors and modifying the application easier. Some of the additional

3
advantages of PLCs are as follows:
Smaller physical size than hard-wire solutions; as we have seen earlier in this paper, PLCs
came in to replace mechanical relay systems which were very common back in the 60s.PLCs
themselves had a significantly big size, but thanks to recent advancements in semiconductor
technologies, the smallest PLC available today can have the size of one physical mechanical
relay and from this we can understand the phenomenal shift in the effectiveness and cleanness
of designs achieved through PLCs.
Easier and faster to make changes; comparing the amount of work to what should have to
be done when mechanical relays were still in use, the complete wiring redesign in no longer
necessary and we only need to change the software inside the PLCs CPU and a few wire
connection adjustments on Input/output ports of the PLC and we are ready to go.
PLCs have integrated diagnostics and override functions. These come in handy when
errors have occurred.
Diagnostics are centrally available. In contrast to systems where only the central control
computer featured diagnostics capabilities, each PLC device has its own built-in diagnostics
routines .This improves the reliability of the system since for example in case of network
outage the end device can still run diagnostics without the need to access the main server
device.
Applications can be immediately documented. This is possible as a result of the ease of
connection of input and output modules to the PLC.
Applications can be duplicated faster and less expensively. Since a great deal of work is
done by the program burned into the PLC memory, just by copying the control program into
another PLC device all that is left is to do some simple wiring and the same project is being
applied in two or more different locations in a remarkably short time.

1.3 How PLC works
There are four basic steps in the operation of all PLCs: which continually take place in a
repeating loop: Input Scan, Program Scan, Output Scan and Housekeeping.









Fig 1.1 PLC Working Cycle
Input Scan: Detects the state of all input devices that are connected to the PLC
Program Scan: Executes the user created program logic.
Output Scan: Energizes or de-energize all output devices that are connected to the PLC.

4
Housekeeping: This step includes communications with programming terminals, internal
diagnostics etc...

CHECK INPUT STATUS: First the PLC takes a look at each input to determine if it is
on or off. In other words, is the sensor connected to the first input on? Then the second input?
Then the third and so on. It records this data into its memory to be used during the next step.
EXECUTE PROGRAM: Next the PLC executes your program one instruction at a time.
Maybe the program says that if the first input was on then it should turn on the first output.
Since it already knows which inputs are on/off from the previous step it will be able to decide
whether the first output should be turned on based on the state of the first input. It will store
the execution results for use later during the next step. UPDATE OUTPUT STATUS: Finally
the PLC updates the status of the outputs. It updates the outputs based on which inputs were
on during the first step and the results of executing your program during the second step.

Based on the example in step 2 it would now turn on the first output because the first
input was on and your program said to turn on the first output when this condition is true.
After the third step the PLC goes back to step one and repeats the steps continuously. One
scan time is defined as the time it takes to execute the 3 steps listed above.

The basic elements of a PLC include input modules or points, a central processing unit
(CPU), output modules or points, and a programming device. The type of input modules or
points used by a PLC depends upon the types of input devices used. Some input modules or
points respond to digital inputs, also called discrete inputs, which are either on or off. Other
modules or inputs respond to analog signals. These analog signals represent machine or
process conditions as a range of voltage or current values. The primary function of a PLCs
input circuitry is to convert the signals provided by these various switches and sensors into
logic signals that can be used by the CPU.

The CPU evaluates the status of inputs, outputs, and other variables as it executes a
stored program. The CPU then sends signals to update the status of outputs. Output modules
convert control signals from the CPU into digital or analog values that can be used to control
various output devices. The programming device is used to enter or change the PLCs
program or to monitor or change stored values. Once entered, the program and associated
variables are stored in the CPU. In addition to these basic elements, a PLC system may also
incorporate an operator interface device to simplify monitoring of the machine or process.

In our case the input module will be composed of an array of switches that help us to
input Logic ones or Logic zeros to the PLC; the output module is made of LEDs to display the
status of the system; our programming device is the SIEMENS provided STEP 7 MicroWin
and the operator interface is a WinCC based Human Machine Interface, herein referred to ad
HMI.



5










Fig 1.2 PLC Working Principle Block Diagram
1.4 PLC Programming Language
Various languages are used for programming PLCs:
1.4.1 Ladder diagram (LD)
Ladder diagram is a graphic programming language derived from the circuit diagram of
directly wired relay controls. The ladder diagram contains contact rails to the left and the right
of the diagram; these contact rails are connected to switching elements (normally open /
normally closed contacts) via current paths and coil elements.






Fig 1.3 Ladder program section

1.4.2 Function block diagram (FBD)
In the function block diagram, the functions and function blocks are represented
graphically and interconnected into networks. The function block diagram originates from the
logic diagram for the design of electronic circuits.






Fig 1.4 FBD Program Section



6
1.4.3 Sequential function chart (SFC)
The sequential function chart is a language resource for the structuring of
sequence-oriented control programs. The elements of the sequential function chart are steps,
transitions, alternative and parallel branching. Each step represents a processing status of a
control program, which is active or inactive. A step consists of actions which, identical to the
transitions, are formulated in the IEC 1131-3 languages. Actions themselves can again contain
sequence structures. This feature permits the hierarchical structure of control program. The
sequential function chart is therefore an excellent tool for the design and structuring of control
programs. Since Ladder Diagram is the most used method to program PLCs and particularly
our method in this project, a closer look at how some of the hardware functions are achieved
is necessary.
1.4.4 Ladder Logic
Ladder Logic or Ladder Diagrams is the most common programming language used to
program a PLC. Ladder logic was one of the first programming approaches used in PLCs
because it borrowed heavily from the Relay Diagrams that plant electricians already knew.
The symbols used in Relay Ladder Logic consist of a power rail to the left, a second power
rail to the right, and individual circuits that connect the left power rail to the right. The logic
of each circuit (or rung) is solved from left to right. The symbols of these diagrams look like a
ladder - with two side rails and circuits that resemble rungs on a ladder. The picture above has
a single circuit or "rung of ladder.

If Input1 is ON (or true) - power (logic) completes the circuit from the left rail to the
right rail - andOutput1 turns ON (or true).If Output1 is OFF (or false) - then the circuit is not
completed and logic does not flow to the right - and Output 1 is OFF. There are many logic
symbols available in Ladder Logic - including Timers, Counters, Math, and Data Moves- such
that any logical condition or control loop can be represented in Ladder Logic. With just a
handful of basic symbols - a Normally Open Contact, Normally Closed Contact, Normally
Open Coil, Normally Closed Coil, Timer, Counter - most logical conditions can be
represented .With just the Normally Open Contact and Normally Open Coil - a surprising
array of basic logical conditions can be represented.

1.4.4.1 Normally Open Contact.
This can be used to represent any input to the control logic - a switch or sensor, a contact
from an output, or an internal output. When "solved" the referenced input is examined for an
ON (logical 1) condition. If it is ON, the contact will close and allow power (logic) to flow
from left to right. If the status is OFF, the contact opens and power will not flow from left to
right.



7


1.4.4.2 Normally Open Coil
This can be used to represent any discrete output from the control logic. When "solved"
if the logic to the left of the coil is TRUE, the referenced output is ON (logical 1).




Fig 1.5 (a) Normally Open Contact Fig 1.5 (b) Normally Open Coil

1.4.4.3 Solving a Single Rung
Suppose a switch is wired to Input1, and a light bulb is wired through Output1 in such a
way that the light is OFF when Output1 is OFF, and ON when Output1 is ON. When Input1 is
OFF (logical 0) the contact remains open and power cannot flow from left to right. Therefore,
Output1 remains OFF (logical 0).When Input1 is ON (logical 1) then the contact closes,
power flows from left to right, and Output1 becomes ON (the light turns ON).





Fig 1.6 Contacts Powering a Coil

1.4.4.4 The AND Rung
The AND is a basic fundamental logic condition that is easy to directly represent in
Ladder Logic. Suppose a switch is wired to Switch1, a second switch is wired toSwitch2, and
a light bulb is wired through Light1 in such a way that the light is OFF when Light1 is OFF,
and ON when Light1 is ON. In order for Light1 to turn ON, Switch1 must be ON, AND
Switch2 must be ON. If Switch1 is OFF, power (logic) flow from the left rail, but stops at
Switch1. Light1 will be OFF regardless of the state of Switch2.If Switch1 is ON, power
makes it to Switch2. If Switch2 is OFF, power cannot flow any further to the right, and Light1
is OFF. If Switch1 is ON, AND Switch2 is ON - power flows to Light1 solving its state to
ON.

1.4.4.5 The OR Rung
The OR is a logical condition that is easy to represent in Ladder Logic. Suppose a switch
is wired to Switch1, a second switch is wired to Switch2, and a light bulb is wired

8
throughLight1 in such a way that the light is OFF when Light1 is OFF, and ON when Light1
is ON. In this instance, we want to the light to turn ON if either Switch1 OR Switch2 is ON. If




Fig 1.7(a) the AND Configuration Fig 1.7(b) the OR Configuration

Switch1 is ON - power flows to Light1 turning it ON. If Switch2 is ON - power flows
through the Switch2 contact, and up the rail to Light1 - turning it ON. If Switch1 AND Switch
2 are ON - Light1 is ON. The only way Light1 is OFF is if Switch1 AND Switch2 are OFF.
These same contacts and coils can in any vendors programming software. The particular one
we will be using in our project is the SIEMENS provided STEP 7 MicroWin.






Fig 1.8 Steps 7 MicroWin Interface.
1.5Human Machine Interface
A human machine interface (HMI) is an interface which permits interaction between a
human being and a machine. Human machine interfaces vary widely, from control panels for
nuclear power plants to the screen and input buttons on a cell phone. Designing such interfaces
is a challenge, and requires a great deal of work to make the interface functional, accessible,
pleasant to use, and logical. Some engineers specialize in developing human machine interfaces
and changing the ways in which people interact with machines and systems.
Two components are needed in a human machine interface. The first is an input. A human
user needs some way to tell the machine what to do, to make requests of the machine, or to
adjust the machine. Examples of input devices include keyboards, toggles, switches, touch
screens, joysticks, and mice. All of these devices can be utilized to send commands to a system
or even an interlinked set of systems.
The interface also requires an output, which allows the machine to keep the human user
updated on the progress of commands, or to execute commands in physical space. On a

9
computer, for example, users have a screen which can display information. A robot, on the other
hand, may move in response to commands and store data on a hard drive so that people can see
how the robot responds, learns, and navigates the world. Outputs can also include things as
simple as status lights which alert people when toggles or switches have been activated.
The technology behind the human machine interface is constantly improving. Researchers
have developed interfaces which can be controlled with the mind, for example, seeing
applications for this technology among stroke patients and other people with severely restricted
modes of communication. Likewise, outputs have become much more sophisticated over time.
As many people have noted, a poorly designed human machine interface can be extremely
frustrating. On one end of the scale, the interface may be buggy or nonfunctional, causing
difficulty because it does not work as intended. On the other end of the scale, the interface
works, but it is designed in such a way that it is confusing and challenging to operate because it
is not intuitive for users. The art of designing intuitive interfaces requires a deep understanding
of how humans interact with their environment and an awareness of the psychology of
designing interfaces in a way which will be accessible to a broad spectrum of humans. What
works for an engineer in a human machine interface, for example, might not be as easy for a
member of the general public.
1.6 PLC Applied in Elevator System Applications
With latest developments in science and technology, PLC technologies have been widely
applied in industrial control. ). A lot of factory production lines, processing equipment, ship
loading and unloading device, the operation of the elevator are controlled by the PLC, as long
as the scheduled control tasks are compiled in the form of a string of instructions and stored in
the memory. It is the job of PLC to drive the output devices in response to input signals
present at its Input ports.

PLC application in elevator systems is also very mature. PLC act as the master
controller, on one hand it collects a variety of input signals of the elevator, including the
location of the elevator, state of the signal of internal and external command button, the door
lock signal, the door zone signal, forced to slow down ,the signal within the wells and fire
signals. On the other hand, based on signals it has such as the elevator floor signal and speed
signal, switch gate signal, the directional relay and brake relay it runs its calculations to
control the operation of the elevator.
Conditional branches are usually used in elevator applications; the program is broken into
several functional blocks such as normal acceleration, steady speed, slow down and the like.
On power on it starts its working cycle and scans for inputs and decides what to do based on
the program burned into its memory.



10


2. Selection of the PLC model
When an engineer is embarking on any program of automation, it must be remembered
that the controller is only a tool used to perform the necessary tasks. The actual task of
implementing automation is therefore paramount, often involves many methodologies in its
system design phase. Once the specifications are established, the job of selecting a suitable
controller will then become most important as this would determine how at ease the
automation program might continue. There is a massive range of PLC systems available today,
with new additions or replacements continually being produced with enhanced features of one
types or another. Advances in technology are quickly adopted by manufacturers in order to
improve the performance and market status of their products. However, irrespective of make,
the majority of PLC in each size range is very similar in term of their control facilities. Where
significant differences are to be found is in the programming methods and languages, together
with differing standards of manufacturer support and backup.

2.1 Considerations in choosing a suitable PLC
With the vast choice of equipment now available, the engineer can usually obtain similar
systems from several original equipment manufacturers (OEM). When the specification
requires certain types of function or input/output, it is possible that one system from a single
manufacturer standing out as more superior or cost effective than the other; but normally this
is rarely the case. To determine the most suitable PLC to be used in the automation task, there
are several basic considerations to be made:
Necessary input/output capacity;
* Types of I/O required;
*Size of memory required;
* Speed and power required of the CPU and instruction set
* Manufacturer's support and backup.

All these topics are to a large extent interdependent, with the memory size being directly
tied to the amount of I/O as well as program size. As the I/O and memory size rises, this takes
longer to process and requires a more powerful, faster central processor if scan times are to
remain acceptable.

2.2 Type of I/O and Capacity Needed
Normally this I/O requirement is the engineer's very first consideration in selecting the
PLC to be used. Commonsense tells us that the I/O sections of a PLC system must have
enough termination points to connect all signal and control lines for the process. These
termination points on the I/O sections must therefore conform to the basic system

11
specifications with regard to:
* Voltage levels and current loadings;
*The number and type of I/O points required per module (or unit in the case of self-contained
PLC);
* Isolation required between the controller and the target process;
*The need for high-speed I/O, or remote I/O, or any other special facility;
* Future needs of the plant in terms of both expansions potential and installed spare I/O
points;
* Power supply requirements of I/O points: any need for an on-board power supply unit to
drive input transducers or output actuators.

In certain cases there may be a need for signal conditioning modules to be included in
the system, with obvious space demands on the main or remote racks. When the system is to
be installed over a wide area, the use of a remote or decentralized form of I/O working can
give significant economies in cabling the sensors and actuators to the PLC
2.3 Memory and Programming Requirements
Depending on the type of PLC being considered, the system memory may be
implemented on the same card as the CPU, or alternatively on dedicated cards. This latter
method is the more adaptable, allowing memory size to be increased as necessary up to the
system maximum, without a reciprocal change in CPU card. As stated in the previous section,
memory size is normally related to the amount of I/O points required in the system. The other
factor that affects the amount of memory required is of course the control program that is to
be installed. The exact size of any program cannot be defined until all the software has been
designed, encoded, installed and tested. However, it is possible to accurately estimate this size
based on average program complexity. A control program with complex, lengthy interlocking
or sequencing routines obviously requires more memory than one for a simple process.
Program size is also related to the number of I/O points, since it must include instructions for
reading from or writing to each point. Special functions required for the control task may also
require memory space in the main PLC memory map to allow data transfer between cards.

Finally, additional space should be provided to allow for changes in the control program,
and for future expansion of the system. There is often a choice of available memory type -
RAM or EPROM. The RAM is the most common; allowing straightforward and rapid
program alterations both before and after the system is installed. RAM contents are made
semi-permanent by the provision of battery backing on their power supply. RAM must always
be used for I/O and data functions, as these involve dynamic data. EPROM memory can be
employed for program storage only, and requires the use of a special EPROM
eraser/programmer to alter the stored code. The use of EPROMs is ideal where the several
machines are controlled by identical programmable controllers running the same program.
However, until a program has been fully developed and tested, RAM storage should be used.
Microcomputers are often used as program terminals or development stations. The large

12
amounts of RAM and disk storage space provided in these machines allow the development
and storage of many PLC programs, including related text and documentation. Programs can
be transferred between the microcomputer and the target PLC for testing and alteration.
EPROM programming can also often be carried out via the microcomputer.
2.4 S7 200 and Project Specifics

































Fig 2.1 S7 200 Parameters

The above tables highlight different parameters to consider choosing the appropriate s7

13
200 PLC devices for a particular project and we will use them to pick one for our project. It
will involve four floors. Inputs will be achieved using push-buttons and outputs will be LEDs
to display different statuses of the system.Fig2.2 helps us organize all these data. The left side
of the figure shows each floor and its I/O signals; the right section shows signals inside the lift
vehicle.














Fig 2.2 Elevator System Input/output Signals

There is an elevator call PB at the outside on each floor. Inside the vehicle, we have a
manual door open PB, a manual door closure PB and four destination request input PBs. In
total our system requires 10 input ports. Next, we analyze the system in terms of output ports.
We need four signals to point out the lift vehicle location; by this we mean whether it is on the
first floor, or the second floor and the like. Two signals are needed to tell the lift direction
(whether it is going up or down) and two other signals for the door statuses(whether it is
opening or closing).All of the above taken into account , our PLC should have 8 output ports
at least. To be more precise, we will choose a PLC CPU that has at least 10 digital inputs and
8 digital outputs. Considering these I/O requirements and other parameters such as response
time, memory and others, we conclude that the CPU 224 of the S7 200 family will do fine for
our project.











14
3. Hardware Design
3.1 Hardware Configuration
Fig 3.1 shows the wiring diagram of the S7 CPU 224 PLC that we have chosen for our
project.











Fig 3.1 CPU 224 Hardware configuration
From its specification table we know that it has 14 input pins and 10 output pins and it
matches the I/O requirements of our project. For proper operation it must be connected to a
120/240 V AC power supply as shown in the top-right corner of Fig 3.1.A 24V DC power
supply is also necessary for proper operation of Input/output modules.1L, 2L and 3L labeled
pins are connected to the (+) pin of the DC power supply and 1M, 2M and 3M labeled pins
are connected the (-) pin of the DC power supply. This configuration allows the Input pins to
source and the output pins to sink.
3.2 Input module
Inputs are achieved by an array of Normally Open push buttons that connect directly to
the Input pins of our PLC. When the Push Button is not pushed (open), no voltage is present
at the Input and this condition is recognized as logic 0 by the PLC input circuitry. When
pushed, a 24V level is present at the Input and this condition is recognized as logic 1 by the
PLC input circuitry.






Fig3.2 Input Circuitry

The presence of logic 1 is characterized by the turning ON of the green LED
corresponding to the Input port of the S7 200 PLC. When logic 0 is present the LED just turns

15
OFF .Fig 3.2 conveys the concept of the input module
3.3 Output module
LEDs will be used to indicate the state of the output pins. An LED in its ON state
indicates the logic 1 at the output pin and an LED in its OFF state indicates the logic 0 at the
output pin.






Fig 3.3 Output Circuitry
Fig3.3 conveys the concept of the output module. Note the presence of the current
limiting resistor to prevent the destruction of LEDs by over current.

3.4 Elevator Control System signals
In this section, a detailed analysis of different signals in our project is carried out.
Reference to Fig 2.2 is recommended for clarity. First we analyze the input signals (achieved
through normally open push buttons)
*1F Elevator Call Push Button: the function of this PB is to instruct the elevator to come to
the 1F and pick up a passenger. The 2F, 3F and 4F PB respectively have the same function.
*Manual door open PB: When pushed, this PB instructs the door of the elevator to open, wait
for some seconds and the close. Details on how this is achieved will be covered in the
software section of this paper.
*Manual door closure PB: When pushed, this PB instructs the system to close the door. This
feature allows the passenger to force the door closure when no other passengers are present.
Next we cover the output signals;
*1F Indicator : When ON ,this signal says the lift vehicle is located at the first floor at that
particular time, other signals on respective floors serve the same purpose.
*Direction indicators: These signals say whether the lift vehicle is moving UP or DOWN
*Door open/closure indicators: These indicate whether the door is opening or closing.

3.5 Input / Output Allocation
The next two tables show how we have allocated our different signals to the Input and
Output pins of the PLC.





16
Table 3.1 Input Allocation Table 3.2 Output Allocation











3.6 Control Board
For simplification purposes, we have taken the Input module, the output module and the
power supply module of our design and boiled them down on one board as shown in Fig 3.4.


















Fig 3.4 Hardware Input/output board
No. function Output
pin
0 1
st
floor indicator Q0.0
1 2
nd
floor indicator Q0.1
2 3
rd
floor indicator Q0.2
3 4
th
floor indicator Q0.3
4 Down direction Q0.4
5 Up direction Q0.5
6 Door closing Q0.6
7 Door opening Q0.7
No. function Input pin
0 Go to the 1
st
floor I0.0
1 Go to the 2
nd
floor I0.1
2 Go to the 3
rd
floor I0.2
3 Go to the 4
th
floor I0.3
4 4
th
floor elevator call I0.4
5 3
rd
floor elevator call I0.5
6 2
nd
floor elevator
call
I0.6
7 1
st
floor elevator call I0.7
8 Manual door open I1.0
9 Manual door closure I1.1

17
The left section of the board contains respective floor signals: floor indicator LEDs and
direction indicator LEDs. We have the elevator call PB in the bottom-left corner of each floor.
On the right of the 4F we have signals inside the lift vehicle. In addition to the floor indicator
LEDs we also have the door open/closure indicators, door open/closure PBs and destination
request PBs. On the top-right corner of the board is a connector that allows for connection to
the PLC I/O ports and we have the 24V DC power supply in the bottom-right corner of the
board. Fig 3.5 shows details in hardware connections
















Fig 3.5 Project hardware connections



















18
4. Software Design
4.1 Design Logic
Since we are dealing with a four floor control system, the control software has been
designed in such a way that each floor has its own control software block; in this way tasks
will be performed in accordance with the particular location of the lift vehicle. This helps us
to be logically organized and, in addition, determine what routine to run in response to a
particular input signal at different locations of the lift vehicle.
























Fig 4.1 Software Block Diagram
Each block of the above mentioned blocks has been itself divided into 3 minor blocks
and these are: Block register initialization, Destination scan and Push Button Scan.

4.1.1 Block register initialization
This blocks function is to make sure all the starting parameters are in the desired states
when we enter a particular floor block. Let use an example to be more specific; when we are
on the First floor, we need to set our location to this floor .When the system is just powered on,

19
the vehicle should be in a static state (not moving) and it doesnt make sense to say that the
direction is up or down since there is no motion at all. The doors are sealed and at the moment
the system hasnt been instructed to go anywhere. The above mentioned information has to be
input in the controller in form of instructions .These instructions have been organized into one
set that we refer to as Register Initialization block since they are input in the system by
assigning values to registers.
4.1.2 Destination scan
Having analyzed the Register Initialization block, we can say that its sole role is to tell
the system where it is, or to set the starting point in the particular floor block. The next job is
to check whether there are instructions to go anywhere .If there are any destination request the
system should run routines to go to that particular destination. If no requests are available, the
system should keep looping in this section, looking for a destination until it finds one.
4.1.3 Push-Button scan
So far, the system knows its position or location and it knows how to look for a
destination; in this section we are concerned with finding a way to give the system a
destination. From the hardware design section we remember that signals are input through
Push-Buttons. Depending on the location of the lift vehicle, when a particular destination
request PB is pushed, appropriate registers should be set .With the destination set ,the
Destination Scan block should find it and appropriate routines should be run to go to the
required destination.
4.2 Overview of Implementation Techniques
In any kind of programming style that we might be using, tasks are achieved through
assigning values to registers or setting/resetting bits in different registers. This project is not
an exception to that. For example, the Register Initialization block is composed of a series of
bit set/reset instructions or assignments of a full byte value to a particular register. Travels
from floor to floor or door open/closure delays are achieved through timers.
4.3 Software Flowchart
The flowchart in Fig4.2 achieves the first floor register initialization and destination
scan. To keep it simple and clear we assume that for the choice diamond we have a NO at the
bottom and a YES on the right.










20







Fig 4.2 1F Initialization and scan Flowchart



21

Fig 4.3 2F Initialization and scan Flowchart.



22



Fig 4.4 3F Initialization and scan Flowchart.




23





Fig 4.5 4F Initialization and scan Flowchart




24


Fig 4.6 Push button scan Flowchart



25
It should be noted that we have only provided the push button scan for the 4F only; this
was intended to avoid repetitions but the logic is the same for other floors.

4.4 Register allocation
In this section, we allocate some specific registers that will be used in our project. Also
their functions will be introduced briefly.

Position register: this register tells us the current location of the lift vehicle.4 bits are reserved
and bit3 ,bit 2 ,bit 1 and bit0 relate to 1F,2F,3F and 4F respectively.MB0 provided by the S7
200 system has been used for this purpose.
Destination Registers Updest and Downdest: When a destination request PB is pushed, a
corresponding bit is set in the appropriate destination register. 4 bits are reserved and bit3, bit
2, bit 1 and bit0 relate to 1F, 2F, 3F and 4F respectively.MB1 and MB2 provided by the S7
200 system have been used ad Updest and Downdest respectively.

Floor Control Register: program control has been achieved by energizing some coils and
leaving others OFF depending on the pursued goal. For example, if the lift is located on the 1F,
we energize the initialization block, the destination scan bloc and the PB scan block of the
1F.Other floor control bits are left in their OFF state at this time. It should be noted that the
same applies to the 2F, 3F and 4F respectively. Bit 1, 2, 3 and 4 of the MB5 Register have
been used to control the 1F, 2F, 3F and the 4F respectively.

Motion control: The function of these bits is to tell whether the lift vehicle is in motion or not.
Also, when it is in motion, we need to know if it is moving up or down. Bit 0 of MB3 has
been used for motion control and bit1 of the same byte has been used for motion direction
control.

On top of the above mentioned registers and bits, a great number of other registers have
been used for other purposes such as latching, temporary storage and the like. Numerous
timers and in particular 10 ms resolution timers have been used for delay purposes. For
example passage from floor to floor has been achieved using timer delays.











26
5. Human Machine Interface Design
5.1 SIMATIC WinCC Overview
Among many available HMI options today, we have chosen to use the SIEMENS
provided SIMATIC WinCC as our HMI solution. SIMATIC WinCC is a scalable process
visualization system with powerful functions for monitoring automated processes. WinCC
provides complete SCADA functionality under Windows for all sectors from single-user to
distributed multi-user systems with redundant servers and cross location solutions with web
clients. Following are some of its outstanding features:
* Universally applicable
Solutions for all sectors
Meets requirements according to 21 CFR Part 11
Multilingual for worldwide use
Can be integrated in all automation and IT solutions
* All operating and monitoring functions onboard
* can be configured easily and efficiently
*Continuously scalable also via the Web
* Open standards for easy integration
* Integrated Microsoft SQL Server for data archiving as Information hub
* Increased production transparency through Plant Intelligence
* Expandable using options and add-ons
* Part of Totally Integrated Automation

It offers multiple editors in its windows explorer windows that we use in our designs.
Some of these are The Graphic Designer, Tag Management Editor, Menu and Toolbar Editor,
Alarm and Logging Editor and the like. The reader can refer to SIEMENS literature for more.

5.2 Communication between WinCC and the PLC
For successful communication between WinCC and the Automation System which is the
S7 200 PLC in our case, we need to configure channels, channel units and connections:

Channels: channels are specialized communication drivers. The channels allow the supply of
process values from the automation system to the process tags. WinCC provides a variety of
channels to connect different automation systems. In WinCC, you can also use channels, via
which values are transferred to the automation system from WinCC. You will control the
process via these channels.

Channel Units: The channels have different channel units for the different communication
networks. This channel unit is then used to access to a certain type of automation system. A
channel unit serves as an interface with exactly one underlying hardware driver and therefore

27
to exactly one communication processor in the computer.
Connections: In channel units, you will configure connections to the various automation
systems. Each connection describes the interface to an individual, defined automation system.
The data exchange will take place via the connections in Runtime.








Fig 5.1 WinCC and Automation System Communication Block Diagram

In our case we used the OPC Channel and passed through the SIEMENS provided S7
200 PC Access software to configure our connections. This allows us to communicate with the
automation system the same way we do from Step 7 MicroWin. Physical connections are
made through the PC/PPI Cable.













Fig 5.2 Physical Connections

5.3 Project Specific HMI Design.
The operation of this interface is very similar to the one we have designed in the hardware
section .The meanings of the colors are as follows; red means that the indicator LED is ON
and black means that the indicator LED is OFF. We also have the System power LED that
goes ON when the system goes in run mode as a result of power-on. The blue circle is a PB
that allows us to exit the HMI runtime. You should never push that button unless you wish to
stop monitoring the system. PBs and indicators inside the lift vehicle is self explanatory.


28




















Fig5.3 Human Machine Interface.











29
6. System Debug
In computers, debugging is the process of locating and fixing or bypassing bugs (errors)
in computer program code or the engineering of a hardware device. To debug a program or
hardware device is to start with a problem, isolate the source of the problem, and then fix it. A
user of a program that does not know how to fix the problem may learn enough about the
problem to be able to avoid it until it is permanently fixed. When someone says they've
debugged a program or "worked the bugs out" of a program, they imply that they fixed it so
that the bugs no longer exist.
Debugging is a necessary process in almost any new software or hardware development
process, whether a commercial product or an enterprise or personal application program. For
complex products, debugging is done as the result of the unit test for the smallest unit of a
system, again at component test when parts are brought together, again at system test when the
product is used with other existing products, and again during customer beta test, when users try
the product out in a real world situation. Because most computer programs and many
programmed hardware devices contain thousands of lines of code, almost any new product is
likely to contain a few bugs. Invariably, the bugs in the functions that get most use are found
and fixed first. An early version of a program that has lots of bugs is referred to as "buggy."
Debugging tools (called debuggers) help identify coding errors at various development
stages. Some programming language packages include a facility for checking the code for
errors as it is being written.
6.1 Hardware Debug
The hardware debug phase involved testing each hardware module component for
proper operation. As in any circuit test, we have to make sure that the system is safely
powered; we made sure that the system has a 220V; 50Hz AC power supply and a 24V DC
power supply .These should be connected following standard safety measures. Each Light
Emitting Diode has been tested for proper operation. Here the current limiting resistors must
be checked since they are critical to the operation of the system. If not carefully chosen the
LEDs may burn out as a result of over current.

We should also be sure that the power supply has the capability to power the system.
The power supply used for this system can provide up to 3.5A.This should be more than
enough for our system since each LED needs 8~15 am or current to light properly and the
maximum number of LEDs that can be ON simultaneously is 5. To be practically sure that the
hardware module will work without problem when connected to the actual PLC we have
tested it with a simple program to power one of the output ports that we have connected to the
1F indicator LEDs for example. With this test successful, the hardware module was approved
for proper operation and we were confident to be able to approach any further dysfunction as
the situation requires.

30
6.2 Software Debug
Software debugging is the process by which developers attempt to remove coding defects
from a computer program. It is not uncommon for the debugging phase of software
development to take 60-70% of the overall development time. In fact, debugging is responsible
for 80% of all software project overruns. Ultimately, a great amount of difficulty and
uncertainty surround the crucial process of software debugging.
This is because at each stage of the error detection process, it is difficult to determine how
long it will take to find and fix an error, not to mention whether or not the defect will actually be
fixed. In order to remove bugs from the software, the developers must first discover that a
problem exists, then classify the error, locate where the problem actually lies in the code, and
finally create a solution that will remedy the situation (without introducing other problems!).
Some problems are so elusive that it may take programmers many months, or in extreme cases,
even years to find them. Developers are constantly searching for ways to improve and
streamline the process of software debugging. At the same time, they have been attempting to
automate techniques used in error detection. Over the years, debugging technology has
substantially improved, and it will continue to develop significantly in the near future.
Since we have used the Ladder programming technique in our project we have not come
across any hard-to-solve grammatical error. This is because it is a straightforward technique and
the system warns you at any wrong move you might want to make. Several logical errors have
occurred though; and we had to find a way around this if we wanted our project to be successful.
The approach that worked was to design the software in blocks and run as many tests as
we can. Each time we were going to make a major change, we introduced a new version. This
allowed us to come back to the last best version every time we did something catastrophic.








31
Summary
This project involves using the S7 200 PLC to control a four floor elevator system. The
basic functions of the elevator system have been emulated. As part of hardware design, a
module for input/output has been designed and its purpose is to provide us with different
statuses of the system. The SIEMENS provided Step 7 MicroWin software package have been
used for software design and the Ladder programming technique was used ;also, the S7 200
PLC simulator tool was used for quick test purposes or in case the PLC hardware was not
available. Software and hardware were tested together and possible remedies have been carried
out for problems that occurred.
After successful operation of hardware and software sections of our design, it was time for
Human Machine Interface design. Again, the SIEMENS provided SIMATIC WinCC v7.0 was
used.V1.0 PC Access was used to configure communication between WinCC and our
automation system (PLC).Hardware, software and HMI designs were tested together and their
operation was approved. Since no design is ever perfect, subsequent dysfunction may occur but
we are confident to come up with appropriate remedies.














32
Acknowledgements
This is the time I thank those without whose help this piece of work would never have
been achieved. I would like to thank each and every member of the 23s; these are a group of
23 young Rwandans who, in February of 2007 boarded a flight to China, with one goal in
mind; undertaking their undergraduate studies and being useful to their communities in one
way or another. It has been a daunting task, but with their support be it moral or intellectual I
was able to overcome challenges that came into my way. It is with great respect that I
recognize their support.

I am grateful for the support offered by the International Student Center of Beijing
Institute of Technology in many ways. Particularly I would like to thank Professor Wu for the
devotion with which he does his job which involves being in charge of undergraduate students
at BIT. He has always been there when we needed him and his contribution in my studies at
BIT will be deeply appreciated. I would also like to thank teacher Hou, who is in charge of
international students in the Department of Automation at BIT. I was never disappointed
whenever I went to her for academic assistance and this will always be remembered.

The classmates I had at my mayor of Electrical Engineering and Automation were just
amazing! They have assisted me from my sophomore year up to this time when I am finishing
my undergraduate studies. I particularly appreciate their assistance in many lab classes that I
have attended .Since I had language difficulties I was not always up to speed with the
presented material and they always had their ways to keep me moving forward. In this regard,
I would like to thank Jiang Cheng Long, Liu Hong Yao, Li Tian Ya, Liang Yu, Li Ye Yang, Xu
Lin Yu, Bao Rui and many others. Their support is not neglected in any way.

Lastly I am deeply indebted to the knowledgeable professionals who have guided me
through my graduation project.Li Bao Kui has been a key player in all this. He has assisted me
technically and he always had his ways to try and push me to perfection. Fei Qing was kind
enough to provide valuable suggestions whenever consulted and Hu Hao Ping did a great job
reviewing my paper and point out changes that would make it better.












33
Dedication
This piece of work is dedicated to my humble and wise mother Nzabamwita whose
character I will always be trying to emulate and my zealous father Mukuralinda whose
confidence I inherited a slice. Their union is one of the strongest I had the honor to know of
and I will consider myself a success if I get anywhere close to them.





































34
References
[1] Programmable Logic Controllers, W.Bolton, Elsevier-Newnes, 2009
[2]S7-200 System Manual, Siemens literature
[3] http://www.plcs.net/chapters/history2.htm
[4] http://www.scribd.com/doc/49006620/Summer-Training-Project-Report-PLC
[5] http://www.wisegeek.com/what-is-human-machine-interface.htm
[6]WinCC Getting started guide, Siemens literature
[7]Electronic Devices, Electron Flow Version, Thomas Floyd, Fifth Edition, Pearson
Education, 2005
[8] s7-200 plc , ; ; () |
| 9787115222091 | 2010-05-01
[9] s7-200 plc () | | 9787111216506 | 2007-07-01
[10] PIC Microcontrollers, an Introduction to Microelectronics, Second Edition, Martin Bates,
Newnes, 2004
[11] S7-200 PLC (3 ), () ,
, 2008
[12] WinCC , , , 2009
[13] Wincc , ; ; ; () |
* | 9787111261636 | 2009-04-01
[14] : , () David j.agans () | () |
| 9787115240576 | 2011-01-01
[15] Siemens PLC training - S7-200 PLC
trainer,http://www.bin95.com/Training_Equipment/s7-200-siemens-plc-training.htm

Вам также может понравиться