56
7/21/2019 Automation and Controls - Nick Dawkins http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 1/56

Automation and Controls - Nick Dawkins

Embed Size (px)

DESCRIPTION

Control Automation

Citation preview

Page 1: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 1/56

Page 2: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 2/56

 

Automation and ControlsA guide to Automation, Controls, PLC’s and PLC

Programming

By Nick Dawkins

 

Page 3: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 3/56

 

©2014

Nick Dawkins

All Rights Reserved

Page 4: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 4/56

 

ContentsINTRODUCTION

PROGRAMMABLE LOGIC CONTROLLERS OR PLC’SBACKGROUND

SELECTION OF A PLC

Cost 

Complexity of the process

Speed of Processing

 Input and Output Requirements

Communication Requirements

 Interface Requirements

TYPES OF PLC’S

LOGIC CONTROLLERS

ALL IN ONE

MODULAR PLC

MAKES AND IDE’S

COMMON MANUFACTURERS AND PROGRAMMING ENVIRONMENTS

HOW DOES A PLC WORK?

SIGNAL TYPES

DIGITAL SIGNALS

ANALOGUE SIGNALS

PLC INPUT DEVICES

TYPICAL INPUTS

DIGITAL SENSORS

 Reflective or Retro-Reflective Sensors.

Capacitive

 Inductive

Colour/Contrast 

ANALOGUE SENSORS

Thermocouples

 PT100’s

 Load Cells

 Potentiometers

ENCODERS

 Incremental Encoders

Page 5: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 5/56

Page 6: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 6/56

 

Page 7: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 7/56

Page 8: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 8/56

Introduction

The whole world has an insatiable desire for manufactured products and devices, so

manufacturers have to be able to build and produce things quickly, and in great numbers.

The solution is to build them using automated production machines. As these machines

have grown ever more complex, so has the field of Automation and Control.

Controls Engineers are always in high demand and the pay can be very good for an

experienced engineer. It can also be very rewarding designing the software, and

automating a process that is tailored to a client’s needs and machinery. Controlled systems

are everywhere in factories making anything from cars to mobile phones. If you’re

looking for a career in this field or just have an interest, then this guide can give you a

glimpse into how these automated systems actually work.

I’d like this book to grow more, so please feel free to contact me if you would like

something expanded upon, clarified or included in the book. I can then either help youdirectly, or add the information to the book itself if it would prove popular.

My controls background started while working at a large container and refrigeration port,before moving onto pharmaceutical manufacturing and high speed packaging andlabelling machines. I then worked on robotic pick and place machines building mobilephones for a Japanese multinational. I’m currently a controls engineer, working onmachine protection systems of a large particle accelerator.

[email protected]

Page 9: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 9/56

Programmable Logic Controllers or PLC’s

Automated machines are controlled and monitored by using a varied combination of

electrical devices that that provide inputs and take outputs to and from a central

controlling computer. In such machines these computers are called PLC’s, which stands

for Programmable Logic Controllers. These are very robust pieces of equipment that are

extremely reliable and rarely crash. They also allow engineers to monitor the controllingsoftware of a machine as it actually runs, check for faults and enable engineers to expand a

machines capabilities further if it needs to be updated or have the process changed in some

way.

PLC stands for Programmable Logic Controller 

They are used for throughout industry to control automated systems such as:

Traffic Lights

Packaging Machinery

Robots

Automated Production Lines

Pick and Place Assembly Lines

Airport Baggage Handling

Automated Warehouses

Page 10: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 10/56

Page 11: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 11/56

Background

Before PLC’s were invented, automation was very limited, and was accomplished with

relay logic. This was a hard wired system of switched relays and timers, used to achieve

an automated task. The wiring was extremely complicated, and fault finding was very time

consuming, causing lots of production delays. It was also very difficult to modify the

wiring if the process needed changing. 

 An example of Relay Logic

The first PLC was commissioned by General Motors, who wanted to reduce complicated

hard wired relay logic and timers into a single electronic unit, thereby speeding up their

production lines and reducing downtime.

The first PLC was made in 1968 by Bedford Associates’ and called the 084 because it

was Bedford Associates’ eighty-fourth project.

The 084 PLC 

Page 12: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 12/56

Selection of a PLC

There are several types of PLC, and their selection is based on several things:

1. Cost

2. complexity of the process

3. Speed of Processing

4. Input and Output Requirements5. Communication Requirements

6. Interface Requirements

Cost

PLC’s range in price from around fifty pounds, up to models costing thousands.

Complexity of the process

If the task is very simple, there is no need to buy a flashy top of the range PLC.

Speed of Processing

Some tasks require a very fast PLC. It may need to use a sensor to count high speed

motor revolutions for instance. A slow PLC would not be able to process these signals fast

enough.

Input and Output Requirements

If the system the PLC will control has lots of sensors, switches and motors, the PLC will

need to have lots of Input and Output options.

Communication Requirements

Does the PLC have to interface to other PLC’s or a central computer? Does it need a serial

link or Ethernet link?

Interface Requirements

Does the machine just have a few stop and start switches, or is it a complex system

requiring a touch screen?

Page 13: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 13/56

Page 14: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 14/56

Types of PLC’S

Logic Controllers

The simplest PLC is called a logic controller. These are very cheap items to control a very

simple process. They are not really considered a true PLC, but a halfway house that has

the ability to control small pieces of equipment that only require a few timers or counters

and simple logic.

This is a simple Logic Controller

 

Page 15: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 15/56

All in One

These are true PLC’s that come as one complete compact unit. They have a fixed amount

of inputs and outputs, both digital and analogue, and can be fully programmed to run

complex tasks. They are generally not very expandable, so a larger one than necessary

must be bought if future changes are planned.

  An All in One PLC 

 

Page 16: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 16/56

 

Page 17: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 17/56

Modular PLC

This type of PLC is built up out of modules, as required for the process. They normally are

built from left to right starting with a power supply module, then the CPU module. After

that you could have Input modules, output modules, communication modules, analogue

modules and counter modules to name but a few.

You can even have remote modules far away from the main PLC rack to save on cablingcosts.

  A modular PLC built into a crate

 

Modular PLC’s are the most common in industry, because they are expandable, and if a

fault develops, only the faulty module would need replacing instead of the wholePLC.

Page 18: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 18/56

Page 19: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 19/56

Makes and IDE’s

There are many manufacturers of PLC’s such as the ones listed below. They all offer

similar capabilities, but some can be easier to program than others. PLC programmers all

tend to prefer certain systems over others. In my opinion, some can give an easier learning

curve, such as an Omron or Mitsubishi PLC, and some can be quite difficult to learn such

as Siemens. A lot depends on the complexity of the process.The manufacturers sell the programming software or IDE (Integrated Development

Environment).

Each IDE will usually program most of those manufacturers’ models of PLC’s but you

should always check compatibility before purchasing. Manufacturers IDE’s are not

interchangeable. You can’t program a Mitsubishi PLC using Omron software for example.

Page 20: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 20/56

Common Manufacturers and Programming Environments

Omron – Programmed using the CX-One IDE

Siemens – Programmed using the Step 7 IDE or the newer TIA Portal IDE

Mitsubishi – Programmed using the GX Developer IDE

Allen Bradley – Programmed using the RSLogix IDE 

Page 21: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 21/56

How does a PLC work?

 

The following section will describe what signals a PLC can process and what types of

devices can be connected to it.

Page 22: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 22/56

Signal Types

Most signalling to and from a PLC in a modern machine is done using low voltage signals

such as 24V DC voltage, and low analogue voltages and current signals. It’s not very

common to switch mains voltages at the PLC itself. High voltage equipment is usually

segregated somewhere else in the control panel. This ensures that no electrical noise can

affect signal cables connected to the PLC.

Page 23: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 23/56

Digital Signals

These are usually 24VDC signals that are either on or off (true or false). They can be

things such as switch outputs or sensor signals into the PLC and relay and contactor

signals or indicator lamps out of the PLC.

Page 24: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 24/56

Analogue Signals

These are variable voltage signals such as 0 to 10V, -10V to +10V, 0 to 5 V or variable

current signal such as 0 to 20mA or 4 to 20mA. These can represent speeds or positioning

signals both into and out from the PLC, or a motor speed setting or valve position.

Page 25: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 25/56

Page 26: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 26/56

PLC Input Devices

Typical Inputs

Aside from simple switches providing inputs to a PLC, you can also connect a range of

sensors.

Page 27: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 27/56

Digital Sensors

Reflective and Retro-Reflective Sensors

These types of sensor emit a beam of invisible light, and look for reflected signals back

when an object blocks the beam. Reflective sensors bounce the beam off of the object

being detected. A retro Reflective sensor bounces a light off of a reflector mounted

opposite the sensor, perhaps on the other side of a conveyor belt, and detects the absenceof the reflection to tell if an object is in the way.

Their range is usually only a few centimetres, but can be a lot more depending on the

sensor used.

 

 A Retro Reflective Sensor and a Reflector

 

Page 28: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 28/56

Capacitive

These types of sensors are good for detecting items made of insulating materials such as

plastic jars. They emit an invisible electric field which is distorted by an object passing

past which then triggers the sensor.

Two Capacitive

Sensors

 

Inductive

These sensors are similar to capacitive sensors but work better on non insulating materialssuch as metal. They are very good at detecting a notch in a spinning cam for example.

 Inductive Sensors

 

Page 29: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 29/56

Colour/Contrast

These are good for detecting colour differences such as a detecting a missing label from a

bottle.

Colour/Contrast Sensor

Sensors usually have to be set-up to ‘see’ an object when fitted. Many have an adjustable

screw in the top to adjust the sensitivity. Some have a digital readout showing the signal

level for a given object. You can then adjust a threshold level that will then trigger the

sensor.

They also can be wired in several ways. Some are only two wires, others can be four or

more. Their output type also has to match the PLC input connection. Inputs can be

‘sinking’ or ‘sourcing’ otherwise known as PNP or NPN. PNP provides a positive signal,

such as 24VDC back to the PLC to trigger the input. NPN provides a 0V or GND back to

the PLC to trigger the input.

Page 30: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 30/56

 

Page 31: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 31/56

Analogue Sensors

Thermocouples

Thermocouples are used to measure temperatures. They come in many ‘types’ depending

on the temperature range that needs to be measured.

 A typical Thermocouple

Page 32: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 32/56

Thermocouples need to be wired with special compensating cable throughout the whole

circuit. This cable is colour coded for different temperature ranges. Different countries

sometimes use different colour cables:

The most common thermocouple ‘type’ is a K type as it spans the most commontemperatures being measured.

 

PT100’s

PT100’s also measure temperatures but do not required special cabling. They come in

three forms, each with a different number of connections, namely 2, 3 and 4 wire versions.

As a general rule, the further away the sensor is from the PLC, the sensor with more wires

is better.

A platinum resistance temperature detector (RTD) PT100 is a device with a typicalresistance of 100 Ω at 0°C. It changes resistance value as its temperature changesfollowing a positive slope with the resistance increasing when temperature rises.

They have been used for many years to measure temperature in laboratory and industrialprocesses, and have developed a reputation for accuracy, repeatability, and stability. ARTD can typically measure temperatures up to 850 °C. The relationship betweenresistance and temperature is relatively linear as shown below:

Page 33: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 33/56

 

The sensors measure temperatures by detecting a change in the resistance of the sensor. As

long cables have a built in resistance which can affect sensor accuracy, using a 3 or 4 wire

sensor negates changes in temperature due to long cable resistances.

 A PT100 Probe

 

Load Cells

Load cells measure weight or the force of a load. They work by measuring resistance

changes within a strain gauge. The higher load, the bigger the resistance change.

 A Load Cell

Page 34: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 34/56

Potentiometers

A potentiometer is a variable resistor that changes is resistance depending on its position.

They are very useful for ascertaining positions. They come in rotary or linear forms.

Rotary models can have one turn or several, and linear can be from around 5cm to around

50cm. A potentiometer connected to a PLC would typically have a 0 Ohm to 10KOhmresistance depending on its position. These can be connected to analogue input modules

where their resistance can be scaled to a voltage range which can be used to calculate a

position.

 A Rotary Potentiometer

 Linear Potentiometers

 

Page 35: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 35/56

Page 36: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 36/56

Encoders

An encoder is usually mounted onto a motor or shaft to give a rotational position. They do

come in linear forms as well, but these are less common.

Incremental Encoders

Incremental encoders emit digital pulses every time their shafts rotate. The number of

pulses per degree of rotation is dependent on the encoder’s resolution. A high resolution

encoder would detect a smaller movement that a low resolution version. As the encoder

rotates the PLC can count these pulses and work out how far something has moved. As

this count can get forgotten, or things can move, the machine would need to move slowly,

or jog, to a known position on powering up before it can run at full speed. This is called

‘homing’, and enables the PLC to reset the counters and count from a known safe position.

 Incremental Encoders

Absolute Encoders

Absolute encoders always know there rotational position and do not need ‘homing’ like

their incremental versions. This means the PLC would know a machines position at all

times regardless of whether things have moved whilst the power is switched off. The

downside is that they normally require more inputs on the PLC.

 Absolute Encoder

Page 37: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 37/56

Typical Outputs

Lamps

These can be easily switched on or off from a single PLC output, for operational

indicators.

 Lamps

Motors

A motor drives different parts of a machine such as a conveyor belt, scroll drives or

carousels which carry items around inside the machine. There are many types of motors

used in industry, but typical ones are usually just activated via a contactor. More complex

types are servo motors or stepper motors which can be moved by a fixed rotational

distance for accurate control.

 

 A Typical AC motor

 

Page 38: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 38/56

Contactors

A contactor enables a low voltage output to directly switch a very large current device on

or off, such as a motor or heating element. A contactor has a coil which needs to be

compatible with a PLC’s output, which is usually 24VDC. The main switch in the coil

needs to be able to stand the current load of the attached device.

 A Contactor

 

RelaysA relay is a small contactor designed for switching smaller current loads. They usually

plug into relay bases, so can be swapped over quickly without the need to disconnect any

cabling.

 A Relay and Relay Base

 

Page 39: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 39/56

Page 40: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 40/56

Communication

PLC’s can communicate with many other systems if they have the correct modules fitted.

Most CPU’s are now fitted with Serial RS232, USB or Ethernet connections. Other

connections are RS485, Profibus (for data transfer between PLC’s) Device-net and many

more.

Serial Port Module

   Ethernet Module

 

Page 41: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 41/56

HMI’s

HMI stands for Human Machine Interface. It allows a machine operator to control a

machine very easily. They can be very simple LCD screens with a few buttons, right up to

a colour touchscreen device. HMI’s are programmed using the manufacturer’s software.

Sometimes this is a separate package that must be purchased, and sometimes it comes as

part of the PLC programming IDE.

They can also have password protected levels, so you would have a simple screen for an

operator to control a machine, but also an expert screen on the same device for helping

engineers to fault-find technical problems.

 LCD Panel  Touchscreen Panel

Page 42: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 42/56

Page 43: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 43/56

PLC Software

Programming Methods

Most proper PLC’s can be programmed in five different ways, or even a combination of

ways.

In the distant past PLC’s had to be programmed in mnemonics which was similar tomachine code. This was very hard to read, and understand. This was replaced by a

programming method called Ladder Logic. This was designed to look similar to electric

circuits, so a programmer could see a signal flow through his code. Ladder Logic is still

very popular as it is arguably the easiest to learn and understand. As time moved on and

systems became more complicated, an industry standard was accepted which consisted of

the programming methods listed below:

The International standard IEC 61131-3 has become popular, and currently defines five

programming languages for programmable control systems:

•  IL (Instruction List or Statement List)

• 

SFC (Sequential Function Chart)

•  LD (Ladder Diagram, or Ladder Logic)

• 

FBD (Function block diagram)

•  ST (Structured Text)

 

Examples of each type of programming

We’ll go into each type of programming method in a moment, but first it’s a good idea to

know how a PLC runs its program.

Program Flow

A PLC usually runs through its program from start to finish, and then repeats this loop. At

the start, the PLC examines the state of every input. It then saves all these input states as

an input memory image. This image of all the inputs is then fixed until the whole program

has completed one cycle. As the program then runs, the logical conditions within the

program are applied and any output changes are saved in an output image. No physical

outputs are switched on or off at this point.

Only when the whole program has completed one cycle, does the output image get

transferred in one go, onto the physical outputs. This happens very quickly, with one scan

usually only taking 2 or 3 milli-seconds. Once the output image has been transferred, the

whole cycle begins again.

It’s very important to understand this because the scan cycle can make things confusing ifthe PLC is programmed poorly. For instance, if you want the machine to start, you would

have the relevant output be switched ON or set to TRUE. However, if later in the same

program an OFF or FALSE condition sets this bit back to zero, the later command would

Page 44: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 44/56

override the first command and the machine would never start. The diagram below shows

the whole cycle.

 

A typical Program has 2.5ms scan period depending on the length of the program and

CPU speed. The scan time can reach 50ms or more if the program is large or it could be

micro-seconds with a fast PLC.

 

IL (Instruction List)

Instruction List was first used years ago when laptops did not exist. Engineers had to

scroll through PLC code line by line with a hand-held programming unit. This made

debugging and fault finding extremely difficult and writing programs even harder.

A Hand-held Programming Unit

 

Page 45: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 45/56

This example shows Statement List on a Siemens PLC

 

Page 46: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 46/56

SFC (Sequential Function Chart)

Sequential Function Charts are very good for repeating sequences, such as traffic lights or

a manufacturing process that is the same every time. In the process below, two pistons are

controlled.

Step 1 waits for the start condition to be made, probably a start button

Step 2 Turns output Q0.2 ON which is Piston A’s solenoid. It then waits until the now

energized Piston A has extended, by detecting INPUT I0.3 which is probably a magnetic

reed switch on the side of the piston.

Step 3 Keeps Piston A ON, and also extends Piston B, and again waits for it to be fully

extended.

Step 4 Maintains both Piston position until a 3 second timer has elapsed before starting

the next step.

Step 5 Turns OFF Piston B but leaves Piston A extended, until Piston B has fully

retracted.

Step 6 Wait for Piston A to retract before starting the whole sequence again.

Page 47: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 47/56

LD (Ladder Logic)

Ladder Logic gives a good visual representation of what it is controlling. Here is a simple

example of a start and stop control for a motor relay.

Inputs and outputs are given memory addresses within the PLC. Here are the addresses for

this circuit:

Address 0.00 Turns ON whenever the machine Start Button is Pushed

Address 1.00 Turns ON whenever the machine Stop Button is Pushed

These two addresses would be PLC Digital Inputs.

Address 2.00 is a Digital Output which would trigger the Motor Relay to start the motor.

 

At the beginning, the Start Button is not made so is in a FALSE state.The symbol below 1.00 is called a NOT gate. Because the Stop button has NOT been

pushed, this condition is TRUE.

The Motor Relay 2.00 is also FALSE because the Output is off.

 

Now look what happens when someone pushes the Start Button. Because 1.00 is TRUE

(The Stop Button has NOT been pushed), the circuit is made right up to the output coil

2.00.

This coil then becomes TRUE, turning the motor ON.

 

Now the operator has let go of the Start Button, the circuit maintains because the Start

Button contact has a parallel contact of the Motor Relay next to it. This allows the motor

to stay on when the Start Button has been released.

Page 48: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 48/56

If this parallel coil was not there, the Motor Relay would turn off as soon as the Start

Button was released, thereby turning OFF the motor. This is what is called a ‘latching

circuit’ because the Output itself holds the circuit in a TRUE condition.

 

So look what happens when the operator pushes the Stop Button. Coil 2.00 then becomes

FALSE and breaks the latch, turning the motor off.

The above is a very simple example of Ladder Logic. As seen below, it can get rather

complicated if the logic needed is complex.

 

Quite complex ladder code can be written using only basic commands as shown

previously.

Ladder Logic can also be used for many complicated tasks, and the Omron software for

example, has over 430 different Ladder commands covering the following areas:

Page 49: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 49/56

 

FBD (Function block diagram)

FBD is a good method of programming too, as it can show lots of information in one view.

Below it is showing the logical conditions necessary for output Q1.1 to turn ON or

become TRUE.

The code is run left to right.

The first two blocks are compare statements. These are asking if one value is greater than

(>) another. In this case address MD214 would contain a number. If this number was

greater than 5.00, this condition would be TRUE.

The block below that, checks if MD22 has a value greater than 29.00.

If both these conditions are TRUE, we move onto the next block.

This next block is an AND gate. It needs all its Inputs to be TRUE before it has an Output.

In this case it needs Q0.6 to be TRUE, M101.04 to be OFF, or NOT TRUE which is

denoted by the small circle.

It also needs to two Inputs from the previous compare blocks.

And it finally needs M10.1 to be NOT TRUE or OFF.

Once ALL these conditions are met, this AND gate will Output to the next block.

The next block means is one or more Inputs TRUE?

If the above blocks Output is TRUE the next block is activated, which is a SET/RESET

Latch. If ALL the previous conditions are made this block would RESET making its

Output FALSE even if the SET side was TRUE.

If the previous conditions are FALSE and M11.0 ( the SET condition) is TRUE, then the

Output from the SET/RESET Latch would be made.

The next block is a simple AND gate, so if the Output from the SET/RESET Latch isTRUE AND M14.3 is TRUE then finally Q1.1 would be activated by the Output from the

previous AND gate!

Page 50: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 50/56

 

Page 51: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 51/56

 

ST (Structured Text)

Structured Text is very much like computer programming on your PC. You wouldn’t

normally write a whole program in this way, but it is very good for writing Functions

(pieces of software that do a specific task, called from the main program), or for writing

complex mathematical calculations which would be difficult and hard to read in Ladder

Logic. The program below is a portion of code I wrote in order to calculate the Median

value of several variables representing temperatures in a bank of computer racks. If the

temperature increased above a set Median alarm level it would activate additional cooling.

 

Page 52: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 52/56

Real Time Monitoring

As shown previously in the Ladder examples and below, a PLC’s program can be

monitored in real time on a laptop by plugging into the PLC, or even remotely if the

communications to the PLC is enabled. This is very useful and enables an engineer to

track down problems, or see what is stopping an output from being energised. The green

lines show the logical trail enabling problems to be found very quickly. The bottom rightshows a watch window. This is where the status of several variables can be seen changing

in real time as the program runs.

 

Page 53: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 53/56

Program Structure

In modern PLC’s the program can be divided into sections to make it easier to navigate the

whole program more easily and find things quicker. Ideas for program sections are given

below:

Housekeeping – A section for initial start-up code.

Input Conditioning – Perhaps scaling analogue inputs here or adding a de-bounce to

inputs.

Main Program – The main logic of your code that sets memory bits to enable devices.

Device Drivers – Where all the outputs are handled or triggered by memory bits.

Communication – A section for all the communication to and from the PLC

Page 54: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 54/56

Fail Safe

If the PLC is controlling something that could injure or kill someone, you need to make

sure the PLC is failsafe. This ensures any loss of power to the PLC would not create any

danger to the user. All drives and moving parts should stop in the event of a fault. If a

sensor fails that could cause danger, the PLC should be programmed to detect this and

trigger an alarm. If machine guarding is opened, the machine must be designed so that itstops immediately.

Page 55: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 55/56

Building experience

The best way to learn PLC programming is to buy a small All in One compact PLC and

ust play with it. Or, there is even software available that can simulate a PLC and

automated equipment, so you can practise for very little cost if you prefer that option.

Some PLC IDE’s software can be hundreds or even thousands of pounds, but many also

sell Lite or trial versions of their software, with some things removed that you wouldn’tneed to begin with anyway such as networking and data sharing.

A good source of used PLC’s is E-Bay, where you could buy a cheap modular PLC and

then buy further modules as you become more proficient. Another option is a cheap

hobbyist type controller such as the Arduino, a small programmable controller built on a

single PCB. This comes with a free IDE and has been used for controlling many hobbyist

devices. Arduino’s are less that £30 and great value, though rarely used in industrial

processes, they can give you a feel for automation.

Good luck exploring the world of automation!

 

Page 56: Automation and Controls - Nick Dawkins

7/21/2019 Automation and Controls - Nick Dawkins

http://slidepdf.com/reader/full/automation-and-controls-nick-dawkins 56/56

End