Programmable logic controller

advertisement
© Dr.-Ing. Wehling - TUD
1
Programmable logic controllers
5 Industrial control technique – PLC
Industrial systems largely depend on automatic controls.
Additionally to the superior, central process control systems, which visualize
processes and plant conditions, control, steer and regulate, individual plants and
asset areas are supervised and steered very frequently by PLC (Programmable logic
controller) devices.
PLC devices were specially developed for industrial tasks of automation.
They are specially characterised by their robustness, reliability, high speed of
operation and flexible usefulness.
- PLC devices are microprocessor-controlled
- Not only controls but also regulations can be realized (even at the same
time) with only one device.
- Also analogue input signals are possible (they are converted internally into
digital signals)
- For this suitable input modules are needed.
- The term CPU refers to the complete central unit of the device and not only
to the microprocessor.
- sub-assembly: CPU, input- as well as output modules and frequently as a
also modular bus systems
actuators
end device (Effector organs)“
sensor
„sensory organs“ They react to the respective plant conditions and
supply the input signals of the PLC.
operand
Illustrations of input and output situations as well as internal
conditions (variable, e.g. indicator) of the PLC. With the operands
are implemented operations, accordingly the program.
© Dr.-Ing. Wehling - TUD
2
PLC programs are always cyclically processed contrary to PC programs. The cycle
time is an important size. It depends on the length of the program. The longer a
program is, the longer is also the cycle time.
During the current cycle, changes of input and/or output situations cannot be
considered. The linking of intermediary results with in the meantime changed input
and/or output situations would lead to absurd results at the end of the program cycle.
The control mechanism steers and coordinates the entire operational sequence of
the AD`s (automation device = CPU, bus modules and I/O Modules).
- it calls successively instructions up from the program memory
- it selects the respective operands
- it arranges the corresponding links
The operations are implemented by the calculator
Only at the beginning of the cycle the input conditions will be read into the buffer and
are only spent the end of the cycle the output situations (the final linking results) from
the result memory into the output memory.
The CPU (central unit) the PLC contains:
- Program memories
- Buffer for input conditions, operand, VKE
- Output memory
- Control unit
- Calculator
With PLC-devices structured programming is possible.
Without this possibility of structuring, PLC-programs would become very fast
extremely unclear. PLC-programs can be arranged into subtasks, which can be put
down in modules.
Organisational modules often serve a predefined purpose
For examples and practical exercises in this meeting is a PLC used of the type
Simatic S5 of the manufacturer Siemens. This PLC was and is still - especial in
Germany - very common. Besides exists a multiplicity of further manufacturers, like
Klöckner-Möller, Mitsubishi...
© Dr.-Ing. Wehling - TUD
3
With the Simatic S5 for example the OB 21 is processed uniquely with the start of the
program. This OB can thus are used in order to specify the initial state of the steered
plant (basic positions of actuators, initial values of operands).
The term VKE designates not only the result of the linking, but also the memory, in
which this result is stored.
The programming in AWL is manufacturer specific. A uniform programming language
for the devices of all manufacturers does not exist!
The programming language for the series Simatic S5 is called STEP 5
An AWL program is a program sequence in form of a chain of instructions.
Instruction in STEP 5: An instruction consists of an operation with the corresponding
operand.
Structure of a STEP 5 command
Examples for operations
and related operators
AND-relation
OR-relation
Negation
Allocation
(not storing)
U
O
N
=
Examples for operands and related
attributes
Input
E
Output
A
Flag
M
Example: AND-relation of two inputs. Setting of VKE as an output
U E0.0
U E0.1
=A2.1
Step 1
Step 2
Step 3
Read the state of the inputbit 0.0
AND-relation with the state of the inputbit 0.1
Allocation of the outcome to the outputbit 2.1
© Dr.-Ing. Wehling - TUD
4
AND-Relation
FUP (function plan)
Ladder diagram
The analogy of the ladder diagram-representation with circuit diagrams will lead to
the term “network“ for elementary program blocks, like represented (see above). The
term „network “cannot be used only in connection with the Ladder Diagramrepresentation, but also with FUP and AWL. The subdivision into networks offer the
possibility of a further structuring of PLC programs.
PLC-programs can become unclear because of the fact, that very often must be work
with a large number of operands.
A useful medium is, in this connection, the production of a „allocation map“.
Task: In a manufacturing shop laminations must be inserted manually into a
stamping machine. The stamping machine has a foot switch for operation the stamp
and two further switches. These switches are attached at the machine in a way that
they cannot be operated together with one hand. They guarantee that both hands of
the engine driver are outside of the working area, while the stamp drives down
(pressing forces according to several tons weight are possible!). Only the operation of
both safety-switches together, the machine works.
Solution: The two
safety switches and
the foot switch must
be linked with an
AND-relation with one
another.
© Dr.-Ing. Wehling - TUD
5
Allocation map
In- / Output PLC
E0.0
sensor / actuator
safety switch left
E0.1
safety switch right
E0.2
A3.0
foot-operated switch
stamp
(initial) state
Left hand on switch:
E0.0 = 1
Right hand on switch:
E0.1 = 1
starting stamp: E0.2 = 1
stamp in use: A3.0 = 1
Step5 - Programm U E0.0
U E0.1
U E0.2
= A3.0
BE
End of the Module - instruction
OR- Relation
FUP
Ladder diagram
O E0.0
O E0.1
= A2.1
AWL:
STEP 5 commands
NOT- Relation
FUP
Ladder diagram
UN E0.0
= A2.1
AWL:
STEP 5 commands
© Dr.-Ing. Wehling - TUD
6
Simple task: Filling of a container with a pump, which switches off
automatically with reaching the target level
Task:
- Production of a allocation map
- Program in FUP and AWL
MSR-F48
Æ
Arithmetic rules of the Boolean algebra part 1
MSR-F49
Æ
Arithmetic rules of the Boolean algebra part 2
- The theorems of de Morgan should remember well! They are often very useful with
the simplification and conversion of complex links. The theorems can be proven
easily with Boolean tables.
MSR-F50
Æ
Arithmetic rules of the Boolean algebra part 3 Reduction rules
- The reduction rules can be clarified very well by circuit diagrams, in which the
different links are represented by series connection and parallel connections of
switches.
- Note to the first rule: brackets are not necessary →see foil necessary 48 („AND prior
OR“)
- Note to the second rule: By dissolving brackets with the distributive law and the
following simplification of the resulting expression (E1 ∧ E1 = E1) you will get the first
reduction rule.
- Note to the third rule: This connection arises as a result of dissolving brackets with
the distributive law and the following simplification of the resulting expression,
because E1 ∧ E1 = 0
Logic controls
Æ
If a control links the state of the inputs with the state
of the outputs of the control unit, without determining the progression of the
steps of process , this is the logic control.
Logic controls can also include the storage - and timing element.
- The most simple form of this kind of controls are (statical) combinatorical circuits,
which means logic operations between the access- and initial condition of the logic
control without the use of elements that dependent on time or storing. At
combinatorical circuit the initial conditions depend on the active access conditions.
- Logic controls, with storing elements, have a „memory“ for temporary signal
conditions (Æ hold elements). They change on a temporary, exterior signal the inside
condition, that furthermore persists over the (short) signal-time.
© Dr.-Ing. Wehling - TUD
7
- Basically one could also use dependent on time elements in the logic control, for
example if a certain output must be connected with time-delay dependent on the
input conditions. In such cases the logic control receives a dynamic character.
Programme configuration
Æ
A Step5 – Programme consists of a list of comments of programmeblocks (networks).
Æ
A programme-block of that kind consists fundamentally of load- and/or
composition-operations and always ends with at least one allocationoperation.
Æ
The PLC-Programme can (and should!) be organised in components.
One component (OB, PB, etc.) consists of programme-blocks (network),
that are stringed together and ends with the component-end-instruction
BE.
Æ
The OB1 is provided for the main-programme.
Hold elements
Æ
Question (students):
How may the hold elements be
realised with known basic logical compositions?
Answer: By feedback of the initial conditions of an input of a OR
– elements.
Besides of the displayed resolution there are other resolutions, for example the RSFlipflops
In the programming language Step5 hold elements can be realised really easy
by storange allocation operations. Therefore the operator S is used to set and
R is used to reset of the outputs or markers.
Marker: Markers are a kind of operand, which can be used as spaceholders, similar
to flags in a assembler- programmes.
The subcribtion of the marker occur analog to the otherr operands (in-, output), for
example M0.7
© Dr.-Ing. Wehling - TUD
8
Simple logic controls – an example
Scenario
In a industrial zone determine two plants, in which dangerous
substances a thermally handled.
These substances are relatively harmless in a cold condition, but they develop a lot
of heavy hazardous gases during heating. On this account the internal pressure of
the construction must always be smaller during the operation then the external
pressure.
Each of the two plants sends two signals:
the plant in use or off-state
pressure difference enough or inadequate
Alarm messages On each of the plants a signal-lamp is installed, which indicates a
plant-breakdown, if the respective plant is in use, which means activated and if the
pressure difference is inadequate (Æ danger by emission of damp gases).
These alarm messages must keep on after a temporary
breakdown. First, if the plant has been checked and the cause of the breakdown was
removed, the signal-lamp can be blanked by operating a confirmation-scanner.
In the process master display decrees another signal-lamp, which signals if in one of
the plants (or both) a breakdown has occurred (collective alarm). This signal-lamp
expires first if both plants decree in normal mode and the specific fault on the plants
was receipted . (A separate confirmation of the collective alarm shouldn’t be
necessary.)
Comment
This example discribes a simple processing of the signals at the plants.
Simple logic controls – an example – Solution using Step5
Allocation map
operand
E0.0
E0.1
E0.2
E0.3
E0.4
E0.5
A2.0
A2.1
A2.2
denotation
operation plant 1
pressure difference
plant 1
alarm accept plant 1
operation plant 2
pressure difference
plant 2
alarm accept plant 2
single alarm plant 1
single alarm plant 2
collective alarm
(basic)condition
plant 1 going: E0.0 = 1
pressure difference plant 1 OK: E0.1 = 1
scanner, accept: E0.2 = 1
Plant 2 going: E0.3 = 1
pressure difference plant 2 OK: E0.4 = 1
scanner, accept: E0.5 = 1
breakdown plant 1: A2.0 = 1
breakdown plant 2: A2.1 = 1
breakdown: A2.2 = 1
Step5 - Programme
U E0.2
R A2.0
U E0.5
R A2.1
confirmation scanner plant 1
single alarm plant 1 reset
confirmation scanner plant 2
single alarm plant 2 reset
© Dr.-Ing. Wehling - TUD
U E0.0
UN E0.1
S A2.0
U E0.3
UN E0.4
S A 2.1
O A 2.0
O A 2.1
= A 2.2
BE
9
plant 1 going
pressure difference plant 1
inadequate
single alarm plant 1 set
plant 2 going
pressure difference plant 2
inadequate
single alarm plant 2 set
single alarm plant 1
single alarm plant 2
collective alarm
End of progamme module
If a PLC should control a present downspout of processing steps, one has to use the
so-called step chain programming.
Attributes
Step chains have a lot of characteristic attributes:
- A step chain consists of a fixed sequence of single steps.
Thus the overall process has to be structured in single steps.
- By every time always only one single step of a step chain is active.
remark: Of course at the same time it can processed several sequence.
- A following step can only be activated, if the relay terms are satisfied.
It always belongs to the relay terms conditions that the first step is still
active, but it is completely processed. If all relay terms are satisfied,
then the last step will be deactivated and finally the proceeding step is
activated.
- The single steps are indicated with markers.
This means, every single step will be attached with a marker. This
marker terms as step-marker. The activation and deactivation of the
single steps occur by setting or as the case may be by resetting of the
associated step-markers.
The structure of a step chain can graphically be described in form of a storyboard:
(DIN 40719)
© Dr.-Ing. Wehling - TUD
10
Formalism in Step 5
The programming of a step chain can occur certain and
clear, if the configuration of the programme-blocks is standardised for the single
steps. The programme of the step chain is a progression of the standardised blocks.
Successive an approved and field-tested assembly of such programme blocks will be
displayed. It is about a very secure method that may be used like a „cooking recipe”.
1. Query of conditions
for switching
U Mx.y-1
Querying: Step y-1
(previous step) active?
U Ea.b
Querying: Are all others
conditions for switching
fulfilled?
U Ec.d
R Mx.y-1
2. Switching
S Mx.y
U Mx.y
Deactivating step y-1
(previous step)
Activating: step y (the new
step)
Checking: step y (the new
step) active?
S Ae.f
3. Running the action
R Ae.g
= Ae.h
...
Commands to actors
© Dr.-Ing. Wehling - TUD
11
Each step has to be programmed this way.
Final comments
The remarks of the chapter above represent an introduction to the PLC-Technology,
its application areas and possible usage and some basic programming-techniques.
Beside of the discussed main functions, modern PLC-devices Neben den hier
behandelten Grundfunktionen have a great variety of further functions, for example
counters (forward, backward), timing elements (Start-, release delay, etc.), Control
algorithms (PID-Algorithm), realtime clocks and so on.
The possibilities of the PLC-programming reach far beyond the main techniques
mentioned here.
The PLC-series SIMATIC S5 of the company Siemens has expired lately. In many
plants PLC-devices of this series are still in use, but in the next years almost all of
them will be replaced. The subsequent series of the company Siemens is called
SIMATIC S7 and is programmed in the programming language Step7.
Concering the future of PLC-technology one can state that a tendency exists that
industry computers and PLC frow together. The classical PLC will not keep its
significance on the long term that it had in the past decades and at the present time
still has.
Many „end devices“ are already widely programmable today and can be remote
monitored as well. They are able to react on a variety of outer signals on their own,
without a seperate control device being necessary.
The same applies to measuring equipment and data collecting devices. These units
today possess a variety of the above mentioned attributes as well, which enable
autonomous steering- and control-processes.
Download