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

Chair of Machine Tools

Prof. Dr.-Ing. Christian Brecher

Excercise 3

Mechatronics and control for production plants

Topic:

PLC and Motion Control

Assistant
responsible:

Jerome Flender, M.Sc.


J.Flender@wzl.rwth-aachen.de
WZL, 53B R401
Phone: 0241 / 80-27458

Content
1.

Symbols

2.

Introduction

3.

Fundamentals information processing

4.

5.

6.

3.1.

Theorems of boolean algebra [1-6]

3.2.

Karnaugh maps

Tasks information processing

4.1.

Task 1

4.2.

Task 2

4.3.

Task 3

Introduction electrical controls, PLCs [1,7]


5.1.

Structure and signal flow of electrical control

5.2.

Electrical controls

12

5.3.

Tasks of a PLC

13

5.4.

Structure and modules of a PLC

5.5.

Functionality of a PLC

Tasks machine controls

10
10

14

16
18

PLC and Motion Control, Mechatronics and control for production plants

7.

6.1.

Task 4

18

6.2.

Task 5

18

6.3.

Task 6

19

6.4.

Task 7

19

6.5.

Task 8

20

References

22

PLC and Motion Control, Mechatronics and control for production plants

1. Symbols
Symbol

Dimensions

Terms

Voltage

A
B
C
D

input of a logic element


input of a logic element
input of a logic element
input of a logic element

X
Y
Z

input of a logic element


input of a logic element
input of a logic element

S
R
Clk

setting input
re-setting input
clock input

output of a 7-segment display

b
c
d
e
f
g

output of a 7-segment display


output of a 7-segment display
output of a 7-segment display
output of a 7-segment display
output of a 7-segment display
output of a 7-segment display

F
Q

output of a logic element


output of a logic element

Q
X

inverted output of a logic element


irrelevant output of a logic element

PLC and Motion Control, Mechatronics and control for production plants

2. Introduction
Information processing devices are based on the processing of variables which can
assume two values or states. These variables, which are internally represented by
two physical or electrical states, are called binary variables.
Binary information can be processed internally in logic networks. These contain
switching elements which realize logical functions like, for example, AND or OR functions. Logic networks link the states of input variables (signals at the inputs) with output variables (signals at the outputs). Output variables may be used as input variables.

This exercise deals with fundamental methods for describing such networks and for
realizing them technically with simple function modules.
In addition, an introduction to PLC programming will be given based on the principles
of boolean algebra.

PLC and Motion Control, Mechatronics and control for production plants

3. Fundamentals information processing


3.1.

Theorems of boolean algebra [1-6]

Boolean Algebra Symbols:


Character:

Function:

OR-Function

AND-Function

NOT(X)

PLC and Motion Control, Mechatronics and control for production plants

3.2.

Karnaugh maps
Karnaugh-Veitch-map

Truth table

corresponding
A

0
13

B
1

15

1
14

12

1
6

0
4

1
11

D
5

0
9

1
7

16

10

1
3

F3 =

BD + AD

Nr.

10

11

12

13

14

15

16

Step 1: Composing a Karnaugh map


The amount of input variables defines the size (= number of fields) of a Karnaugh
map. Remember: 2Number of input variables = required amount of fields for a Karnaugh map.
The labeling along the axis of a map is arbitrary. Still, every variable must be equally
included in normal and negated form. Futhermore, only one direct neighbour of a field
may differ. Figure 3-1 gives an example of an incorrect axis labeling.

PLC and Motion Control, Mechatronics and control for production plants

Figure 3-1: Incorrect labeling of the axis


Due to a misplacement of the input variable C, it is surrounded by two differing
neighbouring fields which is not valid. Analogue: D in right-bottom corner.
Step 2: Filling in the Karnaugh map
Given a truth table, focus on all lines where the output function is true (= 1). Then
watch out for the field in the Karnaugh map which matches the values of all input variables and mark it 1. Continue for all lines of the truth table where the output function is true (= 1). All remaining fields are to be marked 0. If the truth table contains
Dont care states, mark them .
Schritt 3: Forming groups
Once all fields of the map are marked, you then need to form groups. This step is
essential for deriving the disjunctive normal form of the function. Remember: wrong
groups result in an incorrect disjunctive normal form.
When building groups, obey to the following rules:

Each entry 1 of the map must join at least one group

There shall no 0 be included in a group

Valid sizes of a group are 2n fields ( n 0 ).

Only direct horizontal or vertical neighbouring fields may be considered for a


group. Diagonal fields are not valid.

The size of a group (number of included fields) has to be as big a possible.

PLC and Motion Control, Mechatronics and control for production plants

Form as less groups as possible.

Dont care states must be converted into a 1, if serving the rule of forming as big
groups as possible.

Groups may cross the edges of a karnaugh map (spatially fold the karnaugh map
in mind, such as the fields end up as direct neighbours).

A field may join more than one group.

Dont Care states dont necessarily have to be in a group.

Formed groups shall be marked by differently coloured frames.


Step 4: Deriving the minimized disjunctive normal form
Once all groups are complete, remember the boolean theorems. Sequentially process all groups and take a closer look at the included variables. According to the
boolean theorems, all input variables which appear in a negated form as well as normal form are to be ignored. Write down the included variables of a group and proceed to the next groups. The terms are linked using a logical OR (+). Upon completion, the derived solution cant be simplified any further but possibly slightly rearranged by factoring out.

PLC and Motion Control, Mechatronics and control for production plants

4. Tasks information processing


4.1.

Task 1

Prove by means of algebraic transformation but without using theorem 10 - that

X Y X Z X Y Z .

4.2.

Task 2

Consider the following circuit:

1
1

Determine the logical equation for Q = f(A,B)


a) using a truth table
b) using the theorems of Boolean algebra
c) What ist the resulting function?

4.3.

Task 3

The functionality of a door lock is described by the following truth table.


Input 1 (A)

Input 2 (B)

Input 3 (C)

Input 4 (D)

Output (Q)

PLC and Motion Control, Mechatronics and control for production plants

Using a Karnaugh map, please derive the disjunctive normal form of the function Q.

PLC and Motion Control, Mechatronics and control for production plants

5. Introduction electrical controls, PLCs [1,7]


In order to control machines and plants, it is necessary to process a wide range of
process signals reliably. The task of the control system is to read in the signals from
the controlled machine, to determine the required control signals by means of logical
operations, and to output them to the final control elements.
In the past, such control systems were realized exclusively with switching elements
equipped with a number of contacts, e.g. relays, contactors or contactless switching
elements (semi-conductors). Because the sequence of functions of such controls is
fixed by the way in which the components are wired, they are referred to as hardwired controls (HWC). They are now used especially for relatively simple control
tasks (applications with fewer than 5 relays) and safety-critical applications (e.g.
presses).
In Programmable Logic Controllers (PLC), the control sequence is no longer determined by a particular wiring of the components, but by a control programme.
After outlining the method of operation and the various types of stored-programme
controls, the following sections describe in detail how these controls are programmed.

5.1.

Structure and signal flow of electrical control

The task of a control system is to read in a variety of signals from a process, e.g.
from a controlled machine, to determine the necessary control signals by means of
logical operations and to output them to the final control elements (actuators). The
controlled process may be a simple machine component, e.g. a feed drive for a machine table, but it may also be a complete manufacturing system, e.g. a machining
centre or a transfer line.
Figure 5-1 depicts the structure and signal flow of an electrical control system.

10

PLC and Motion Control, Mechatronics and control for production plants

Control
Signal conditioning

Signal processing

Signal conditioning
(amplification)

&
Output level

Input level
Signal
flow
Switch

Push-Button

Light Barrier

M
Valve

Lamp

Motor

Display

Production system

Figure 5-1: Structure and signal flows of an electrical control system [1]
The process signals are first read in at the input level. Signals may emanate either
directly from the process, e.g. as sensor signals, or externally from the operator. The
signalling devices are, for example, sensors detecting machine states or process
feedbacks (temperature and pressure sensors, angle encoders etc.) or the operating
elements of a machine tool like push-button controls and switches (e.g. for tailstock
quill forward/backward, cooling lubricant on/off etc.).
Before signals can be processed in the logic section of the control system, it is usually necessary to decouple them electrically and to match them to the control system
voltage level. Opto-couplers or relays are used to decouple and adjust the signals.
The core of the control system is the actual signal processing unit. The output signals
are generated from the input signals by means of logical operations, the logic being
specified by the controlled process. Technical realization of the logical operations is
either electromagnetic, by means of relays, electronic through the use of semiconductor elements, or implemented by means of a program / computer.
In order to address the elements at the output level (e.g. motors, valves, display elements etc), signals frequently need to be amplified. This is done with the aid of suitable electronic amplifying circuits. In the case of relay control systems, however, the
switching power of the relay is frequently adequate. If high powers are required, contactors are used.

11

PLC and Motion Control, Mechatronics and control for production plants

5.2.

Electrical controls

As mentioned before, boolean combinations can be realized in different ways, distuinguishing two types of electrical controls: programmable logic controllers (PLC)
and hard wired programmed logic controllers.
Unlike PLCs, hard wired programmed logic controllers realize the actual control functionaliy by means of their component structure (such as relais and semiconductor
elements). As for physical connections (clamping, soldering or screws) the control
functionality can only be changed by physical alterations, describing a hard wired
controller. Until now, hard wired programmed logic controllers have almost been
completely replaced by PLCs.
As for PLCs, all control functions are executed by a (software) program which is in
the internal memory of the PLC, thus uncoupling hardware design and application.
Depending on the type of control, the content of memory may be changed any time
(RAM, battery-based CMOS-RAM, EEPROM) without any physical effort. Once,
read-only hardware components are mounted (ROM, PROM, EPROM), software alterations may only be applied by changing the memory hardware.
However, hard wired programmed logic controllers are still used for simple control
applications as well as high-security plants (e.g. molding). Depending on the amount
of relais or contactors used (roughly about 5-10), PLCs can be employed economically. Still, if the current exceeds certain limits, e.g. for the main spindle motors, contactors remain an essential element as PLCs can not directly operate very high voltages.
Figure 5-2 shows a use case for hard wired programmed logic controllers which is a
circuit for changing the rotational direction of an AC motor. You can easily identify the
self-holding circuit as well as the interlocking contacts. Relais A1 triggers (closes) the
contact a1. Even after releasing the button S2, relais A1 remains active and the motor keeps running in left-hand motion (self holding circuit). Concurrently, right-hand
motion is blocked via the interlocking contact a1 until the motor is switched off by using button S1.

12

PLC and Motion Control, Mechatronics and control for production plants

Steuerstromkreis
Control
circuit
L1
S1

Self holding contacts


"Selbsthaltekontakte"

Aus
Off

S2

a1

Links
Left

S3

a2

rechts
Rechts

Interlocking
"Verriegelungscontacts
kontakte"

a2

Laststromkreis
Load circuit
L1
L2
L3
N

A1

A2

a1
UVW

A1
N

Linkslauf
Left-hand
movement

A2
Rechtslauf
Right-hand
movement

M
3~

Figure 5-2: Circuit for changing rotational direction of an AC motor using relais
technology [1]
A further categorization leads to operation and sequence controls. Operation controls
are strictly restricted to boolean combinations of input signals covering AND-, OR-,
NOT-, NOR- oder NAND-functions whereas no particular order of execution will be
followed. A typical use case for an operation control is the operation mode of an AC
motor according to Figure 5-2.
On the other hand, sequence controls are also used for many applications. Sequence
controls define a strict sequential order of execution. The temporal matching of functional elements represents an essential characteristic of those controls. While operation controls allow an arbitrary oder of execution, sequence controls only proceed
with the next step upon completion of the relevant transition.

5.3.

Tasks of a PLC

Figure 5-3 reviews the tasks which PLCs can perform on machine tools.

13

PLC and Motion Control, Mechatronics and control for production plants

Control of the
functional units

Monitoring and
diagnosis
time monitoring
plausibility monitoring
error display (texts or graphics)
...

logical operations
interlocking functions
function sequences
...

User interface to
machine operator

Data interface with


other controls

(task sharing with NC)


input elements
(push-buttons,switches, ...)
display elements
(lamps, text displays, ...)
...

coupling with NC
communication with host
computer or other PLC systems
...

Special tasks
tool management
factory data capture
...

Figure 5-3: PLC tasks on machine tools


The main task of the PLC is to control and monitor the mechanical function units, including not only the logical operations (AND, OR, NOT etc.) and the interlocking functions (e.g. interlocking a machine tool door while a part is being machined) but the
time and plausibility monitoring of individual sub-assemblies (e.g. swivel time monitoring of the tool changer or pair monitoring of limit switches).
The PLC also controls numerous functions of the machine control panel (e.g. switching drives on and off, cooling lubricant feeding, chip removal). In addition, PLCs are
now also used to log, condition and transmit process data or to manage the tools
available in the machine. The PLC is moreover usually responsible for exchanging
information with the numerical control (NC) on a machine tool. For example, switching instructions contained in NC blocks are forwarded to the PLC for execution. The
PLC can also communicate with a host computer or with PLCs on other machines
(e.g. each work-station in an integrated transfer line controlled by its own PLC).

5.4.

Structure and modules of a PLC

Figure 5-4 gives an overview of the basic PLC structure, incorporating input/output
components and processing elements.

14

PLC and Motion Control, Mechatronics and control for production plants

Analogue and digital


signals

Analogue and digital


signals

Valve
Switch

Input
components

Key
button

Output
components

Lamp

Bus system
M

Light barrier

ROM

RAM

CPU
(Word-, Bitprocessor)

EPROM

Motor

Display

Communication
interface

Power
supply

V.24, RS 485, Ethernet

Figure 5-4: Hardware components of a PLC [1]


Sensors and actuators are directly connected via plug- or clamping connectors to the
corresponding input/output components of a PLC. The main task of the input components is to adapt the voltage level of any connected periphery or actuators (e.g.
24 V = or 220 V ) to the voltage level of the PLC (5 V =). Besides, incoming signals
are being dejamed galvanically isolated. Integrated diodes represent all signal states
for debugging purposes.
The output components of a PLC also perform galvanic isolation and employ diodes
for a visual representation of the sensor signals. An output amplifier increases the
internal system signals, providing the required voltage for connected actuators (usually 24 V =). If the provided current is not sufficient (0,5 up to 2 A) for direct control of
the actuators, additional power contactors are considered.
The core of any PLC is the processing section consisting of one or more processors
(CPUs) and various internal memory modules. Most PLCs are based on single core
CPUs (internally: Word- and Bitprocessor) whereas new generations also employ
multi core CPUs.
The memory can be distinguished between system-, program- and data memory. The
operating system of a PLC which controls reading and processing of the user program or monitoring the cycle time is stored in an internal system memory (ROM) and
can not be changed by the user. External PCs are used to perform the programming
of the system and then transmitted to the RAM of the PLC via serial or ethernet connections. Tested programs can then be stored into EPROM or battery-buffered RAM

15

PLC and Motion Control, Mechatronics and control for production plants

and set as the default boot project. Results and data which are geenrated at runtime
are temporarily stored into the RAM.

5.5.

Functionality of a PLC

In a PLC system, the control program stored as a sequence of instructions in the


programme memory is normally executed as a cycle. This means that the entire programme runs continuously, irrespective of changes in signal states. If the last instruction in the programme has been executed, the PLC starts again with the first instruction, although jump instructions also allow it to jump forwards or backwards in the
programme (see Figure 5-5). In order to improve the programme structure, it is also
possible to sub-divide it into a number of encapsulated sub-routines or modules.

1st instruction
2nd instruction
3rd instruction

Programme
length
jump instruction
jump

Memory
length

last instruction

Source: Weck 95

Figure 5-5: Cyclic programme runs in a PLC [1]


A PLC normally works with a process map. At the beginning of a cycle, the signal
states of all inputs are logged and transferred to the input mapping memory. This input state map remains constant throughout the cycle. During the run, the stored values are processed according to the users programme, transferred to the output
mapping memory for interim storage and then transmitted together to the output terminals. Because, depending on the length of the programme and the device, a cycle

16

PLC and Motion Control, Mechatronics and control for production plants

of this kind may be repeated at intervals of a few milliseconds, a sufficiently fast response to all process changes is ensured. In order to obtain a comparative value for
the processing speed of different PLCs, the speed is referred to the processing of 1 K
(= 1024) instructions. (Customary values are between 0.1 and 5 ms).
Apart from normal cyclic programme processing, larger modern PLCs also allow
event- or interrupt-controlled as well as time-controlled processing. In eventcontrolled processing, a signal emanating from the process, e.g. actuation of the
emergency power-off switch, aborts cyclic processing of the programme to carry out
a special programme, e.g. an emergency power-off routine which shuts down the
machine reliably. If the main programme has not been interrupted completely, the
processor can continue performing the cyclic programme from the point where it was
interrupted, once the special routine has been completed.
In time-controlled processing, cyclic programme processing can be interrupted by an
internal time signal (wake up alarm) in order to perform a special routine. As with
event-controlled processing, the cyclic programme then resumes at the point where it
was interrupted.

17

PLC and Motion Control, Mechatronics and control for production plants

6. Tasks machine controls


6.1.

Task 4

The relay circuit used to control a feed drive and depicted in Figure 6-1 is given. The
feed drive permits three movements: rapid feed forward, rapid feed backward and
feed forward, each switched by a push-button control.

p S1 Lubrication
pressure

m1

p S2 Hydraulic

a2.1
a3.1

a1.1

S3 Rapid feed backward


ON

S4 End position - back


reached

M1 Help relais

A1 Rapid feed backward

a1.2
S5 End position - front
reached

S6 Rapid feed forward


ON

a3.2

A2 Rapid feed forward

S7 Feed forward
ON

a2.2

A3 Feed forward

Figure 6-1: Realizing a feed control in relay technology


Briefly explain the difference between an operation and a sequencing control and
state which of these two types of control is represented by the feed control system in
Figure 6-1.

6.2.

Task 5

The circuit in Fig. 1 includes self-holding and interlocking functions for the individual
movements (rapid feed forward, rapid feed backward, feed forward). Which contacts
perform interlocking and which perform self-holding?

18

PLC and Motion Control, Mechatronics and control for production plants

6.3.

Task 6

Infer from the circuit diagram in Figure 6-1 the logical equations for the three movements (rapid feed forward, rapid feed backward, feed forward). Use the switch (S1 to
S7) and relay (M1 and A1 to A3) designations given in the figure.

Rapid feed backward:


A1 =
Rapid feed forward:
A2 =
Feed forward:
A3 =

6.4.

Task 7

In the following the relay control in Figure 6-1 is to be replaced by a PLC. Therefore,
a PLC programme has to written according to the equations of task 6.
The push buttons (S) and relays (A) are allocated to the inputs (E), outputs (A),
and labels (M) as follows:
S1 up to S7 =
A1 up to A3 =
M1
=

I1 up to I7
Q1 up to Q3
M1

Write the PLC program as an Instruction List (IL) for the rapid feed backward
movement (Q1).

Write the PLC program as a Function Block Diagram (FBD) for the rap-id feed
forward movement (Q2).

19

PLC and Motion Control, Mechatronics and control for production plants

Write the PLC program as a Ladder Diagram (LD) for the feed forward movement (Q3).

6.5.

Task 8

Figure 6-2: Control of a sequenced packaging plant


As it is shown in the figure above two light barriers are installed on the conveyor. The
first light barrier (LS1) is installed in the robot-work-cell and the second one (LS2)
near to the scale module. If no package is detected between the transmitter and the
receiver, a true-signal is sent by the light barrier.
To start the sequence the operator has to push an empty package into the robot work
cell. If the empty package is detected, the robot starts packaging six bottles in exactly
six seconds. Afterwards the operator shifts this package onto the scale module and
this control element determines the actual weight of the package (Gp). If it is equal to
a predefined weight G1, the package is shifted along path B1; otherwise the packing
is shifted along path B2 to examine the package manually. The switchgear for the
path selection is controled by a pneumatic cylinder (see picture).

20

PLC and Motion Control, Mechatronics and control for production plants
pressure
on

cylinder

valve

pressure
source

Figure 6-3: Functionality of a pneumatic cylinder


If the package has to be moved along path B1, the cylinder gets a "0"-signal and
moves left-hand. The package is moved along path B2 if the cylinder gets a high signal (logical "1 "-signal).
Please write a control program using SCL.

21

PLC and Motion Control, Mechatronics and control for production plants

7. References
[1]

Weck, M.: Werkzeugmaschinen und Fertigungssysteme Band 4,


VDI-Verlag, Dsseldorf, 1996.

[2]

Boole, G.: The Mathematical Analysis of Logic.


Basil Blackwell, Oxford, 1965

[3]

Dworatscheck, S.: Grundlagen der Datenverarbeitung.


de Gruyter-Verlag, Berlin, 1986

[4]

Wolf, G.: Digitale Elektronik.


Franzis-Verlag, Mnchen, 1977

[5]

Eckl, Ptgens u. Walter: A/D- und D/A-Wandler; Grundlagen, Prinzipschaltungen und Applikationen.
Franzis-Verlag, Mnchen, 1990

[6]

Tietze u. Schenk: Halbleiter-Schaltungstechnik.


Springer-Verlag, Berlin, 1993

[7]

John, K-H., Tiegelkamp, M.: SPS-Programmierung mit 61131-3,


Springer Verlag, 2009

22

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