+ All Categories
Home > Documents > Capp Microcont Plc

Capp Microcont Plc

Date post: 06-Dec-2015
Category:
Upload: kranthi142434
View: 241 times
Download: 1 times
Share this document with a friend
Description:
capp_microcont
Popular Tags:
23
CAPP - Three Approaches: Variant, Generative, and the Hybrid Computer Aided Process Planning, (CAPP), is a production orginazation activity that determines how a product is to be manufactured. This is a cornerstone in the manufacturing process. A major part in determining the cost of components and the best combination of manufacturing tools and processes. This directly affects production efficiency, product quality, and company competitiveness. CAPP is a crucial link between design and manufacturing. Even with today's technology and the everknown importance of process planning, this activity is still very labor intensive. One leans heavily on experinece and intuition that gives the required insight to the different manufacturing processes and possibilities within a company. However, the dependency upon intuition often eliminates a thorough analysis and optimization a process plan. This can result in delays and increased costs. CAPP takes on the role of standardizing processes, reducing generation time, and attempts to ensure consistant quality. The Variant Approach The traditional approach to process planning. Here, a part drawing is examined and then similar parts produced in the past are identified. For the previous parts, process plans are examined and then modified to suit the new part at hand. The primise: Similarities between certain producs imply that those parts can be manufactured in more or less the same way. This is the exact route that manual process planning, involving intuition, takes. Computer logrithm strenghtens the identification of 'families' with codes and definitions. Within small corporations, such 'families' of parts are not difficult to identify. The disadvantage of variant planning is that the process plan only caters for a rough outline plan that still needs to be adapted. The main drawback with this approach is that constructing computerized classification systems have yet to be found error free. Generative Planning With the generative planning approach, the computer program incorporates metal cutting know-how and the geometric vision of the part. The process plans are generated by making use of algorithms, decision logic, formulas and geometry based data to perform unique processing decisions to take the part from raw material to a finished state. Here there is no referral to previous plans. Part specificatons, as you can guess, are mandatory input. This includes variables such as material for example. After that, the process is fully automatic and it produces plans of consistant quality. However, the systems are complex and difficult to develop. Maintenance is very difficult for there are a large database of rules which have to be consistant in all condidtions. This results in higher probabilities of system failure. Hybrid Planning
Transcript
Page 1: Capp Microcont Plc

CAPP - Three Approaches: Variant, Generative, and the Hybrid

Computer Aided Process Planning, (CAPP), is a production orginazation activity that determines how a

product is to be manufactured. This is a cornerstone in the manufacturing process. A major part in

determining the cost of components and the best combination of manufacturing tools and processes.

This directly affects production efficiency, product quality, and company competitiveness. CAPP is a

crucial link between design and manufacturing.

Even with today's technology and the everknown importance of process planning, this activity is still

very labor intensive. One leans heavily on experinece and intuition that gives the required insight to the

different manufacturing processes and possibilities within a company. However, the dependency upon

intuition often eliminates a thorough analysis and optimization a process plan. This can result in delays

and increased costs. CAPP takes on the role of standardizing processes, reducing generation time, and

attempts to ensure consistant quality.

The Variant Approach

The traditional approach to process planning. Here, a part drawing is examined and then similar parts

produced in the past are identified. For the previous parts, process plans are examined and then

modified to suit the new part at hand. The primise: Similarities between certain producs imply that those

parts can be manufactured in more or less the same way. This is the exact route that manual process

planning, involving intuition, takes. Computer logrithm strenghtens the identification of 'families' with

codes and definitions. Within small corporations, such 'families' of parts are not difficult to identify. The

disadvantage of variant planning is that the process plan only caters for a rough outline plan that still

needs to be adapted. The main drawback with this approach is that constructing computerized

classification systems have yet to be found error free.

Generative Planning

With the generative planning approach, the computer program incorporates metal cutting know-how and

the geometric vision of the part. The process plans are generated by making use of algorithms, decision

logic, formulas and geometry based data to perform unique processing decisions to take the part from

raw material to a finished state. Here there is no referral to previous plans. Part specificatons, as you

can guess, are mandatory input. This includes variables such as material for example. After that, the

process is fully automatic and it produces plans of consistant quality. However, the systems are complex

and difficult to develop. Maintenance is very difficult for there are a large database of rules which have

to be consistant in all condidtions. This results in higher probabilities of system failure.

Hybrid Planning

Page 2: Capp Microcont Plc

Introduced to limit the drawbacks of both planning approaches, and benefit from there advantages.

Generative processes produce consistant results without classification on high levels of complexity.

Variant processes are simple and easy to maintain.

The first step in a hybrid program: the workpeice is associated to a family. Associated with these

families is a knowledge base that contains all possibilities to manufacture the part. The user again

defines mandatory variables; the program attempts to generate an efficient, cost saving plan for the

involved processes.

MICRO CONTROLLER Introduction

It was electricity in the beginning....The people were happy because they did not know that it was all around them

and could be utilized. That was good. Then Faraday came and a stone has started to roll slowly...

The first machines using a new sort of energy appeared soon. A long time has passed since then and just when

the people finally got used to them and stopped paying attention to what a new generation of specialists were

doing, someone came to an idea that electrons could be a very convenient toy being closed in a glass pipe. It

was just a good idea at first, but there was no return. Electonics was born and the stone kept on rolling down the

hill faster and faster...

A new science - new specialists. Blue coats were replaced with white ones and people who knew something

about electronics appeared on the stage. While the rest of humanity were passively watching in disbelief what

was going on, the plotters split in two groups - “software-oriented” and “hardware-oriented”. Somewhat younger

than their teachers, very enthusiastic and full of ideas, both of them kept on working but separate ways. While the

first group was developing constantly and gradually, the hardware-oriented people, driven by success, threw

caution to the wind and invented transistors.

Up till that moment, the things could be more or less kept under control, but a broad publicity was not aware of

what was going on, which soon led to a fatal mistake! Being naive in belief that cheap tricks could slow down

technology development and development of the world and retrieve the good all days, mass market opened its

doors for the products of Electronics Industry, thus closing a magic circle. A rapid drop in prices made these

components available for a great variety of people. The stone was falling freely...

The first integrated circuits and processors appeared soon, which caused computers and other products of

electronics to drop down in price even more. They could be bought everywhere. Another circle was closed!

Ordinary people got hold of computers and computer era has begun...

Page 3: Capp Microcont Plc

While this drama was going on, hobbyists and professionals, also split in two groups and protected by anonymity,

were working hard on their projects. Then, someone suddenly put a question: Why should not we make a

universal component? A cheap, universal integrated circuit that could be programmed and used in any field of

electronics, device or wherever needed? Technology has been developed enough as well as the market. Why

not? So it happened, body and spirit were united and the first integrated circuit was designed and called the

MICROCONTROLLER.

1.1 What are microcontrollers and what are they used for?

Like all good things, this powerful component is basically very simple. It is made by mixing tested and high-

quality "ingredients" (components) as per following receipt:

1. The simplest computer processor is used as the "brain" of the future system. 2. Depending on the taste of the manufacturer, a bit of memory, a few A/D converters, timers,

input/output lines etc. are added 3. All that is placed in some of the standard packages. 4. A simple software able to control it all and which everyone can easily learn about has been

developed.

On the basis of these rules, numerous types of microcontrollers were designed and they quickly became man's

invisible companion. Their incredible simplicity and flexibility conquered us a long time ago and if you try to invent

something about them, you should know that you are probably late, someone before you has either done it or at

least has tried to do it.

The following things have had a crucial influence on development and success of the microcontrollers:

Powerful and carefully chosen electronics embedded in the microcontrollers can independetly or via input/output devices (switches, push buttons, sensors, LCD displays, relays etc.), control various processes and devices such as industrial automation, electric current, temperature, engine performance etc.

Very low prices enable them to be embedded in such devices in which, until recent time it was not worthwhile to embed anything. Thanks to that, the world is overwhelmed today with cheap automatic devices and various “smart” appliences.

Prior knowledge is hardly needed for programming. It is sufficient to have a PC (software in use is not demanding at all and is easy to learn) and a simple device (called the programmer) used for “loading” raedy-to-use programs into the microcontroller.

So, if you are infected with a virus called electronics, there is nothing left for you to do but to learn how to use and

control its power.

How does the microcontroller operate?

Even though there is a large number of different types of microcontrollers and even more programs created for

their use only, all of them have many things in common. Thus, if you learn to handle one of them you will be able

to handle them all. A typical scenario on the basis of which it all functions is as follows:

1. Power supply is turned off and everything is still…the program is loaded into the microcontroller, nothing indicates what is about to come…

2. Power supply is turned on and everything starts to happen at high speed! The control logic unit keeps everything under control. It disables all other circuits except quartz crystal to operate. While the preparations are in progress, the first milliseconds go by.

Page 4: Capp Microcont Plc

3. Power supply voltage reaches its maximum and oscillator frequency becomes stable. SFRs are being filled with bits reflecting the state of all circuits within the microcontroller. All pins are configured as inputs. The overall electronis starts operation in rhythm with pulse sequence. From now on the time is measured in micro and nanoseconds.

4. Program Counter is set to zero. Instruction from that address is sent to instruction decoder which recognizes it, after which it is executed with immediate effect.

5. The value of the Program Counter is incremented by 1 and the whole process is repeated...several million times per second.

1.2 What is what in the microcontroller?

As you can see, all the operations within the microcontroller are performed at high speed and quite simply, but

the microcontroller itself would not be so useful if there are not special circuits which make it complete. In

continuation, we are going to call your attention to them.

Read Only Memory (ROM)

Read Only Memory (ROM) is a type of memory used to permanently save the program being executed. The size

of the program that can be written depends on the size of this memory. ROM can be built in the microcontroller or

added as an external chip, which depends on the type of the microcontroller. Both options have some

disadvantages. If ROM is added as an external chip, the microcontroller is cheaper and the program can be

considerably longer. At the same time, a number of available pins is reduced as the microcontroller uses its own

input/output ports for connection to the chip. The internal ROM is usually smaller and more expensive, but leaves

more pins available for connecting to peripheral environment. The size of ROM ranges from 512B to 64KB.

Random Access Memory (RAM)

Random Access Memory (RAM) is a type of memory used for temporary storing data and intermediate results

created and used during the operation of the microcontrollers. The content of this memory is cleared once the

power supply is off. For example, if the program performes an addition, it is necessary to have a register standing

for what in everyday life is called the “sum” . For that purpose, one of the registers in RAM is called the "sum" and

used for storing results of addition. The size of RAM goes up to a few KBs.

Page 5: Capp Microcont Plc

Electrically Erasable Programmable ROM (EEPROM)

The EEPROM is a special type of memory not contained in all microcontrollers. Its contents may be changed

during program execution (similar to RAM ), but remains permanently saved even after the loss of power (similar

to ROM). It is often used to store values, created and used during operation (such as calibration values, codes,

values to count up to etc.), which must be saved after turning the power supply off. A disadvantage of this

memory is that the process of programming is relatively slow. It is measured in miliseconds.

Special Function Registers (SFR)

Special function registers are part of RAM memory. Their purpose is predefined by the manufacturer and cannot

be changed therefore. Since their bits are physically connected to particular circuits within the microcontroller,

such as A/D converter, serial communication module etc., any change of their state directly affects the operation

of the microcontroller or some of the circuits. For example, writing zero or one to the SFR controlling an

input/output port causes the appropriate port pin to be configured as input or output. In other words, each bit of

this register controls the function of one single pin.

Program Counter

Program Counter is an engine running the program and points to the memory address containing the next

instruction to execute. After each instruction execution, the value of the counter is incremented by 1. For this

reason, the program executes only one instruction at a time just as it is written. However…the value of the

Page 6: Capp Microcont Plc

program counter can be changed at any moment, which causes a “jump” to a new memory location. This is how

subroutines and branch instructions are executed. After jumping, the counter resumes even and monotonous

automatic counting +1, +1, +1…

Central Processor Unit (CPU)

As its name suggests, this is a unit which monitors and controls all processes within the microcontroller and the

user cannot affect its work. It consists of several smaller subunits, of which the most important are:

Instruction decoder is a part of the electronics which recognizes program instructions and runs other circuits on the basis of that. The abilities of this circuit are expressed in the "instruction set" which is different for each microcontroller family.

Arithmetical Logical Unit (ALU) performs all mathematical and logical operations upon data. Accumulator is an SFR closely related to the operation of ALU. It is a kind of working desk

used for storing all data upon which some operations should be executed (addition, shift etc.). It also stores the results ready for use in further processing. One of the SFRs, called the Status Register, is closely related to the accumulator, showing at any given time the "status" of a number stored in the accumulator (the number is greater or less than zero etc.).

A bit is just a word invented to confuse novices at electronics. Joking aside, this word in practice indicates

whether the voltage is present on a conductor or not. If it is present, the approprite pin is set to logic one (1), i.e.

the bit’s value is 1. Otherwise, if the voltage is 0 V, the appropriate pin is cleared (0), i.e. the bit’s value is 0. It is

more complicated in theory where a bit is referred to as a binary digit, but even in this case, its value can be

either 0 or 1. Input/output ports (I/O Ports)

In order to make the microcontroller useful, it is necessary to connect it to peripheral devices. Each

microcontroller has one or more registers (called a port) connected to the microcontroller pins.

Page 7: Capp Microcont Plc

Why do we call them input/output ports? Because it is possible to change a pin function according to

the user's needs. These registers are the only registers in the microcontroller the state of which can

be checked by voltmeter!

Oscillator

Even pulses generated by the oscillator enable harmonic and synchronous operation of all circuits

within the microcontroller. It is usually configured as to use quartz-crystal or ceramics resonator for

frequency stabilization. It can also operate without elements for frequency stabilization (like RC

oscillator). It is important to say that program instructions are not executed at the rate imposed by the

oscillator itself, but several times slower. It happens because each instruction is executed in several

Page 8: Capp Microcont Plc

steps. For some microcontrollers, the same number of cycles is needed to execute any instruction,

while it's different for other microcontrollers. Accordingly, if the system uses quartz crystal with a

frequency of 20MHz, the execution time of an instruction is not expected 50nS, but 200, 400 or even

800 nS, depending on the type of the microcontroller!

Timers/Counters

Most programs use these miniature electronic "stopwatches" in their operation. These are commonly 8- or 16-bit

SFRs the contents of which is automatically incremented by each coming pulse. Once the register is completely

loaded, an interrupt is generated!

If these registers use an internal quartz oscillator as a clock source, then it is possible to measure the time

between two events (if the register value is T1 at the moment measurement has started, and T2 at the moment it

has finished, then the elapsed time is equal to the result of subtraction T2-T1 ). If the registers use pulses coming

from external source, then such a timer is turned into a counter.

This is only a simple explanation of the operation itself. It’s somehow more complicated in practice.

A register or a memory cell is an electronic circuit which can memorize the state of one byte. Besides 8 bits

available to the user, each register has also a number of addressing bits. It is important to remember that: All registers of ROM as well as those of RAM referred to as general-purpose registers are

mutually equal and nameless. During programming, each of them can be assigned a name, which makes the whole operation much easier.

Page 9: Capp Microcont Plc

All SFRs are assigned names which are different for different types of the microcontrollers and each of them has a special function as their name suggests.

Watchdog timer

The Watchdog Timer is a timer connected to a completely separate RC oscillator within the microcontroller.

If the watchdog timer is enabled, every time it counts up to the program end, the microcontroller reset occurs and

program execution starts from the first instruction. The point is to prevent this from happening by using a special

command. The whole idea is based on the fact that every program is executed in several longer or shorter loops.

If instructions resetting the watchdog timer are set at the appropriate program locations, besides commands

being regularly executed, then the operation of the watchdog timer will not affect the program execution.

If for any reason (usually electrical noise in industry), the program counter "gets stuck" at some memory location

from which there is no return, the watchdog will not be cleared, so the register’s value being constantly

incremented will reach the maximum et voila! Reset occurs!

Power Supply Circuit

There are two things worth attention concerning the microcontroller power supply circuit:

Brown out is a potentially dangerous state which occurs at the moment the microcontroller is being

turned off or when power supply voltage drops to the lowest level due to electric noise. As the

microcontroller consists of several circuits which have different operating voltage levels, this can

cause its out of control performance. In order to prevent it, the microcontroller usually has a circuit for

brown out reset built-in. This circuit immediately resets the whole electronics when the voltage level

drops below the lower limit.

Reset pin is usually referred to as Master Clear Reset (MCLR) and serves for external reset of the

microcontroller by applying logic zero (0) or one (1) depending on the type of the microcontroller. In

Page 10: Capp Microcont Plc

case the brown out is not built in the microcontroller, a simple external circuit for brown out reset can

be connected to this pin. Serial communication

Parallel connections between the microcontroller and peripherals established over I/O ports are the

ideal solution for shorter distances up to several meters. However, in other cases, when it is

necessary to establish communication between two devices on longer distances it is obviously not

possible to use parallel connections. Then, serial communication is the best solution.

Today, most microcontrollers have several different systems for serial communication built in as a standard

equipment. Which of them will be used depends on many factors of which the most important are:

How many devices the microcontroller has to exchange data with? How fast the data exchange has to be? What is the distance between devices? Is it necessary to send and receive data simultaneously?

One of the most important things concerning serial communication is the Protocol which should be strictly

observed. It is a set of rules which must be applied in order that devices can correctly interpret data they mutually

exchange. Fortunately, the microcontrollers automatically take care of this, so the work of the programmer/user is

reduced to a simple write (data to be sent) and read (received data).

A byte consists of 8 bits grouped together. If a bit is a digit then it is logical that bytes are numbers. All

mathematical operations can be performed upon them, just like upon common decimal numbers, which is carried

out in the ALU. It is important to remember that byte digits are not of equal significance. The largest value has the

leftmost bit called the most significant bit (MSB). The rightmost bit has the least value and is therefore called the

least significant bit (LSB). Since 8 digits (zeros and ones) of one byte can be combined in 256 different ways, the

largest decimal number which can be represented by one byte is 255 (one combination represents zero). Program

Unlike other integrated circuits which only need to be connected to other components and turn the power supply

on, the microcontrollers need to be programmed first. This is a so called "bitter pill" and the main reason why

hardware-oriented electronics engineers stay away from microcontrollers. It is a trap causing huge losses

because the process of programming the microcontroller is basically very simple.

Page 11: Capp Microcont Plc

In order to write a program for the microcontroller, several "low-level" programming languages can be used such

as Assembly, C and Basic (and their versions as well). Writing program procedure consists of simple writing

instructions in the order in which they should be executed. There are also many programs running in Windows

environment used to facilitate the work providing additional visual tools.

This book describes the use of Assembly because it is the simplest language with the fastest execution allowing

entire control on what is going on in the circuit.

Interrupt - electronics is usually more faster than physical processes it should keep under control. This is why

the microcontroller spends most of its time waiting for something to happen or execute. In other words, when

some event takes place, the microcontroller does something. In order to prevent the microcontroller from

spending most of its time endlessly checking for logic state on input pins and registers, an interrupt is generated.

It is the signal which informs the central processor that something attention worthy has happened. As its name

suggests, it interrupts regular program execution. It can be generated by different sources so when it occurs, the

microcontroller immediately stops operation and checks for the cause. If it is needed to perform some operations,

a current state of the program counter is pushed onto the Stack and the appropriate program is executed. It's the

so called interrupt routine.

Stack is a part of RAM used for storing the current state of the program counter (address) when an interrupt

occurs. In this way, after a subroutine or an interrupt execution, the microcontroller knows from where to continue

regular program execution. This address is cleared after returning to the program because there is no need to

save it any longer, and one location of the stack is automatically availale for further use. In addition, the stack can

consist of several levels. This enables subroutines’ nesting, i.e. calling one subroutine from another.

Page 12: Capp Microcont Plc
Page 13: Capp Microcont Plc

PLC A programmable logic controller, PLC, or programmable controller is a digital

computer used for automation of typically industrial electromechanicalprocesses, such as control

of machinery on factory assembly lines, amusement rides, or light fixtures. PLCs are used in

many machines, in many industries. PLCs are designed for multiple arrangements of digital and

analog inputs and outputs, extended temperature ranges, immunity to electrical noise, and

resistance to vibration and impact. Programs to control machine operation are typically stored in

battery-backed-up or non-volatile memory. A PLC is an example of a "hard" real-time system

since output results must be produced in response to input conditions within a limited time,

otherwise unintended operation will result.

Before the PLC, control, sequencing, and safety interlock logic for manufacturing automobiles

was mainly composed of relays, cam timers, drum sequencers, and dedicated closed-loop

controllers. Since these could number in the hundreds or even thousands, the process for

updating such facilities for the yearly modelchange-over was very time consuming and

expensive, as electricians needed to individually rewire the relays to change their operational

characteristics.

Digital computers, being general-purpose programmable devices, were soon applied to control of

industrial processes. Early computers required specialist programmers, and stringent operating

environmental control for temperature, cleanliness, and power quality. Using a general-purpose

computer for process control required protecting the computer from the plant floor conditions. An

industrial control computer would have several attributes: it would tolerate the shop-floor

environment, it would support discrete (bit-form) input and output in an easily extensible manner,

it would not require years of training to use, and it would permit its operation to be monitored.

The response time of any computer system must be fast enough to be useful for control; the

required speed varying according to the nature of the process.[1] Since many industrial processes

have timescales easily addressed by millisecond response times, modern (fast, small, reliable)

electronics greatly facilitate building reliable controllers, especially because performance can be

traded off for reliability.

In 1968 GM Hydra-Matic (the automatic transmission division of General Motors) issued a

request for proposals for an electronic replacement for hard-wired relay systems based on a

white paper written by engineer Edward R. Clark. The winning proposal came from Bedford

Associates of Bedford, Massachusetts. The first PLC, designated the 084 because it was

Bedford Associates' eighty-fourth project, was the result.[2] Bedford Associates started a new

Page 14: Capp Microcont Plc

company dedicated to developing, manufacturing, selling, and servicing this new product:

Modicon, which stood for MOdular DIgital CONtroller. One of the people who worked on that

project was Dick Morley, who is considered to be the "father" of the PLC.[3] The Modicon brand

was sold in 1977 to Gould Electronics, later acquired by German Company AEG, and then by

French Schneider Electric, the current owner.

One of the very first 084 models built is now on display at Modicon's headquarters in North

Andover, Massachusetts. It was presented to Modicon by GM, when the unit was retired after

nearly twenty years of uninterrupted service. Modicon used the 84 moniker at the end of its

product range until the 984 made its appearance.

The automotive industry is still one of the largest users of PLCs.

Development[edit] Early PLCs were designed to replace relay logic systems. These PLCs were programmed in

"ladder logic", which strongly resembles a schematic diagram of relay logic. This program

notation was chosen to reduce training demands for the existing technicians. Other early PLCs

used a form of instruction list programming, based on a stack-based logic solver.

Modern PLCs can be programmed in a variety of ways, from the relay-derived ladder logic to

programming languages such as specially adapted dialects of BASIC and C. Another method

is state logic, avery high-level programming language designed to program PLCs based on state

transition diagrams.

Many early PLCs did not have accompanying programming terminals that were capable of

graphical representation of the logic, and so the logic was instead represented as a series of

logic expressions in some version of Boolean format, similar to Boolean algebra. As

programming terminals evolved, it became more common for ladder logic to be used, for the

aforementioned reasons and because it was a familiar format used for electromechanical control

panels. Newer formats such as state logic and Function Block (which is similar to the way logic is

depicted when using digital integrated logic circuits) exist, but they are still not as popular as

ladder logic. A primary reason for this is that PLCs solve the logic in a predictable and repeating

sequence, and ladder logic allows the programmer (the person writing the logic) to see any

issues with the timing of the logic sequence more easily than would be possible in other formats.

Programming[edit]

Early PLCs, up to the mid-1990s, were programmed using proprietary programming panels or

special-purpose programming terminals, which often had dedicated function keys representing

the various logical elements of PLC programs.[2] Some proprietary programming terminals

displayed the elements of PLC programs as graphic symbols, but plain ASCII character

Page 15: Capp Microcont Plc

representations of contacts, coils, and wires were common. Programs were stored on cassette

tape cartridges. Facilities for printing and documentation were minimal due to lack of memory

capacity. The oldest PLCs used non-volatilemagnetic core memory.

More recently, PLCs are programmed using application software on personal computers, which

now represent the logic in graphic form instead of character symbols. The computer is connected

to the PLC through Ethernet, RS-232, RS-485, or RS-422 cabling. The programming software

allows entry and editing of the ladder-style logic. Generally the software provides functions for

debugging and troubleshooting the PLC software, for example, by highlighting portions of the

logic to show current status during operation or via simulation. The software will upload and

download the PLC program, for backup and restoration purposes. In some models of

programmable controller, the program is transferred from a personal computer to the PLC

through a programming board which writes the program into a removable chip such as

an EPROM

Functionality[edit]

The functionality of the PLC has evolved over the years to include sequential relay control,

motion control, process control, distributed control systems, and networking. The data handling,

storage, processing power, and communication capabilities of some modern PLCs are

approximately equivalent to desktop computers. PLC-like programming combined with remote

I/O hardware, allow a general-purpose desktop computer to overlap some PLCs in certain

applications. Desktop computer controllers have not been generally accepted in heavy industry

because the desktop computers run on less stable operating systems than do PLCs, and

because the desktop computer hardware is typically not designed to the same levels of tolerance

to temperature, humidity, vibration, and longevity as the processors used in PLCs. Operating

systems such as Windows do not lend themselves to deterministic logic execution, with the result

that the controller may not always respond to changes of input status with the consistency in

timing expected from PLCs. Desktop logic applications find use in less critical situations, such as

laboratory automation and use in small facilities where the application is less demanding and

critical, because they are generally much less expensive than PLCs.[citation needed]

Programmable logic relay (PLR)[edit]

In more recent years, small products called PLRs (programmable logic relays), and also by

similar names, have become more common and accepted. These are much like PLCs, and are

used in light industry where only a few points of I/O (i.e. a few signals coming in from the real

world and a few going out) are needed, and low cost is desired. These small devices are typically

made in a common physical size and shape by several manufacturers, and branded by the

makers of larger PLCs to fill out their low end product range. Popular names include PICO

Page 16: Capp Microcont Plc

Controller, NANO PLC, and other names implying very small controllers. Most of these have 8 to

12 discrete inputs, 4 to 8 discrete outputs, and up to 2 analog inputs. Size is usually about 4"

wide, 3" high, and 3" deep. Most such devices include a tiny postage-stamp-sized LCD screen

for viewing simplified ladder logic (only a very small portion of the program being visible at a

given time) and status of I/O points, and typically these screens are accompanied by a 4-way

rocker push-button plus four more separate push-buttons, similar to the key buttons on a VCR

remote control, and used to navigate and edit the logic. Most have a small plug for connecting via

RS-232 or RS-485 to a personal computer so that programmers can use simple Windows

applications for programming instead of being forced to use the tiny LCD and push-button set for

this purpose. Unlike regular PLCs that are usually modular and greatly expandable, the PLRs are

usually not modular or expandable, but their price can be two orders of magnitude less than a

PLC, and they still offer robust design and deterministic execution of the logics.

PLC topics[edit] Features[edit]

Control panel with PLC (grey elements in the center). The unit consists of separate elements, from left to

right; power supply, controller, relayunits for in- and output

The main difference from other computers is that PLCs are armored for severe conditions (such

as dust, moisture, heat, cold), and have the facility for extensiveinput/output (I/O) arrangements.

These connect the PLC to sensors and actuators. PLCs read limit switches, analog process

variables (such as temperature and pressure), and the positions of complex positioning systems.

Some use machine vision.[4] On the actuator side, PLCs operate electric

motors, pneumatic orhydraulic cylinders, magnetic relays, solenoids, or analog outputs. The

Page 17: Capp Microcont Plc

input/output arrangements may be built into a simple PLC, or the PLC may have external I/O

modules attached to a computer network that plugs into the PLC.

Scan time[edit]

A PLC program is generally executed repeatedly as long as the controlled system is running. The

status of physical input points is copied to an area of memory accessible to the processor,

sometimes called the "I/O Image Table". The program is then run from its first instruction rung

down to the last rung. It takes some time for the processor of the PLC to evaluate all the rungs

and update the I/O image table with the status of outputs.[5] This scan time may be a few

milliseconds for a small program or on a fast processor, but older PLCs running very large

programs could take much longer (say, up to 100 ms) to execute the program. If the scan time

were too long, the response of the PLC to process conditions would be too slow to be useful.

As PLCs became more advanced, methods were developed to change the sequence of ladder

execution, and subroutines were implemented.[6] This simplified programming could be used to

save scan time for high-speed processes; for example, parts of the program used only for setting

up the machine could be segregated from those parts required to operate at higher speed.

Special-purpose I/O modules may be used where the scan time of the PLC is too long to allow

predictable performance. Precision timing modules, or counter modules for use with shaft

encoders, are used where the scan time would be too long to reliably count pulses or detect the

sense of rotation of an encoder. The relatively slow PLC can still interpret the counted values to

control a machine, but the accumulation of pulses is done by a dedicated module that is

unaffected by the speed of the program execution.

System scale[edit]

A small PLC will have a fixed number of connections built in for inputs and outputs. Typically,

expansions are available if the base model has insufficient I/O.

Modular PLCs have a chassis (also called a rack) into which are placed modules with different

functions. The processor and selection of I/O modules are customized for the particular

application. Several racks can be administered by a single processor, and may have thousands

of inputs and outputs. Either a special high speed serial I/O link or comparable communication

method is used so that racks can be distributed away from the processor, reducing the wiring

costs for large plants. Options are also available to mount I/O points directly to the machine and

utilize quick disconnecting cables to sensors and valves, saving time for wiring and replacing

components.

User interface[edit] See also: User interface and List of human-computer interaction topics

Page 18: Capp Microcont Plc

PLCs may need to interact with people for the purpose of configuration, alarm reporting, or

everyday control. A human-machine interface (HMI) is employed for this purpose. HMIs are also

referred to as man-machine interfaces (MMIs) and graphical user interfaces (GUIs). A simple

system may use buttons and lights to interact with the user. Text displays are available as well as

graphical touch screens. More complex systems use programming and monitoring software

installed on a computer, with the PLC connected via a communication interface.

Communications[edit]

PLCs have built-in communications ports, usually 9-pin RS-232, but optionally EIA-

485 or Ethernet. Modbus, BACnet, or DF1 is usually included as one of the communications

protocols. Other options include various fieldbuses such as DeviceNet, Profibus or Profinet.

Other communications protocols that may be used are listed in the List of automation protocols.

Most modern PLCs can communicate over a network to some other system, such as a computer

running a SCADA (Supervisory Control And Data Acquisition) system or web browser.

PLCs used in larger I/O systems may have peer-to-peer (P2P) communication between

processors. This allows separate parts of a complex process to have individual control while

allowing the subsystems to co-ordinate over the communication link. These communication links

are also often used for HMI devices such as keypads or PC-type workstations.

Formerly, some manufacturers offered dedicated communication modules as an add-on function

where the processor had no network connection built-in.

Programming[edit]

PLC programs are typically written in a special application on a personal computer, then

downloaded by a direct-connection cable or over a network to the PLC. The program is stored in

the PLC either in battery-backed-up RAM or some other non-volatile flash memory. Often, a

single PLC can be programmed to replace thousands of relays.[7]

Under the IEC 61131-3 standard, PLCs can be programmed using standards-based

programming languages. A graphical programming notation called Sequential Function Charts is

available on certain programmable controllers. Initially most PLCs utilized Ladder Logic Diagram

Programming, a model which emulated electromechanical control panel devices (such as the

contact and coils of relays) which PLCs replaced. This model remains common today.

IEC 61131-3 currently defines five programming languages for programmable control

systems: function block diagram (FBD), ladder diagram (LD), structured text (ST; similar to

the Pascal programming language), instruction list (IL; similar to assembly language),

and sequential function chart (SFC).[8] These techniques emphasize logical organization of

operations.[7]

Page 19: Capp Microcont Plc

While the fundamental concepts of PLC programming are common to all manufacturers,

differences in I/O addressing, memory organization, and instruction sets mean that PLC

programs are never perfectly interchangeable between different makers. Even within the same

product line of a single manufacturer, different models may not be directly compatible.

Security[edit]

Prior to the discovery of the Stuxnet computer worm in June 2010, security of PLCs received little

attention. PLCs generally contain a real-time operating system such as OS-9 or VxWorks, and

exploits for these systems exist much as they do for desktop computer operating systems such

as Microsoft Windows. PLCs can also be attacked by gaining control of a computer they

communicate with.[9]

Simulation[edit]

PLCLogix PLC Simulation Software

In order to properly understand the operation of a PLC, it is necessary to spend considerable

time programming, testing, and debugging PLC programs. PLC systems are inherently

expensive, and down-time is often very costly. In addition, if a PLC is programmed incorrectly it

can result in lost productivity and dangerous conditions. PLC simulation software such

as PLCLogix can save time in the design of automated control applications and can also

increase the level of safety associated with equipment since various "what if" scenarios can be

tried and tested before the system is activated.[10]

Redundancy[edit]

Some special processes need to work permanently with minimum unwanted down time.

Therefore, it is necessary to design a system which is fault-tolerant and capable of handling the

process with faulty modules. In such cases to increase the system availability in the event of

hardware component failure, redundant CPU or I/O modules with the same functionality can be

added to hardware configuration for preventing total or partial process shutdown due to hardware

failure.

Page 20: Capp Microcont Plc

PLC compared with other control systems[edit]

Allen-Bradley PLC installed in a control panel

PLCs are well adapted to a range of automation tasks. These are typically industrial processes in

manufacturing where the cost of developing and maintaining the automation system is high

relative to the total cost of the automation, and where changes to the system would be expected

during its operational life. PLCs contain input and output devices compatible with industrial pilot

devices and controls; little electrical design is required, and the design problem centers on

expressing the desired sequence of operations. PLC applications are typically highly customized

systems, so the cost of a packaged PLC is low compared to the cost of a specific custom-built

controller design. On the other hand, in the case of mass-produced goods, customized control

systems are economical. This is due to the lower cost of the components, which can be optimally

chosen instead of a "generic" solution, and where the non-recurring engineering charges are

spread over thousands or millions of units.

For high volume or very simple fixed automation tasks, different techniques are used. For

example, a consumer dishwasher would be controlled by an electromechanical cam timer costing

only a few dollars in production quantities.

A microcontroller-based design would be appropriate where hundreds or thousands of units will

be produced and so the development cost (design of power supplies, input/output hardware, and

necessary testing and certification) can be spread over many sales, and where the end-user

would not need to alter the control. Automotive applications are an example; millions of units are

built each year, and very few end-users alter the programming of these controllers. However,

some specialty vehicles such as transit buses economically use PLCs instead of custom-

designed controls, because the volumes are low and the development cost would be

uneconomical.[11]

Very complex process control, such as used in the chemical industry, may require algorithms and

performance beyond the capability of even high-performance PLCs. Very high-speed or precision

controls may also require customized solutions; for example, aircraft flight controls. Single-board

computers using semi-customized or fully proprietary hardware may be chosen for very

demanding control applications where the high development and maintenance cost can be

supported. "Soft PLCs" running on desktop-type computers can interface with industrial I/O

Page 21: Capp Microcont Plc

hardware while executing programs within a version of commercial operating systems adapted

for process control needs.[11]

Programmable controllers are widely used in motion control, positioning control, and torque

control. Some manufacturers produce motion control units to be integrated with PLC so that G-

code (involving a CNC machine) can be used to instruct machine movements.[citation needed]

PLCs may include logic for single-variable feedback analog control loop, a proportional, integral,

derivative (PID) controller. A PID loop could be used to control the temperature of a

manufacturing process, for example. Historically PLCs were usually configured with only a few

analog control loops; where processes required hundreds or thousands of loops, a distributed

control system (DCS) would instead be used. As PLCs have become more powerful, the

boundary between DCS and PLC applications has become less distinct.

PLCs have similar functionality as remote terminal units (RTU). An RTU, however, usually does

not support control algorithms or control loops. As hardware rapidly becomes more powerful and

cheaper,RTUs, PLCs, and DCSs are increasingly beginning to overlap in responsibilities, and

many vendors sell RTUs with PLC-like features, and vice versa. The industry has standardized

on the IEC 61131-3functional block language for creating programs to run on RTUs and PLCs,

although nearly all vendors also offer proprietary alternatives and associated development

environments.

In recent years "safety" PLCs have started to become popular, either as standalone models or as

functionality and safety-rated hardware added to existing controller architectures (Allen Bradley

Guardlogix, Siemens F-series etc.). These differ from conventional PLC types as being suitable

for use in safety-critical applications for which PLCs have traditionally been supplemented with

hard-wiredsafety relays. For example, a safety PLC might be used to control access to a robot

cell with trapped-key access, or perhaps to manage the shutdown response to an emergency

stop on a conveyor production line. Such PLCs typically have a restricted regular instruction set

augmented with safety-specific instructions designed to interface with emergency stops, light

screens, and so forth. The flexibility that such systems offer has resulted in rapid growth of

demand for these controllers.

Discrete and analog signals[edit] Discrete signals behave as binary switches, yielding simply an On or Off signal (1 or 0, True or

False, respectively). Push buttons, limit switches, and photoelectric sensors are examples of

devices providing a discrete signal. Discrete signals are sent using either voltage or current,

where a specific range is designated as On and another as Off. For example, a PLC might use

24 V DC I/O, with values above 22 V DC representing On, values below 2VDC representing Off,

and intermediate values undefined. Initially, PLCs had only discrete I/O.

Page 22: Capp Microcont Plc

Analog signals are like volume controls, with a range of values between zero and full-scale.

These are typically interpreted as integer values (counts) by the PLC, with various ranges of

accuracy depending on the device and the number of bits available to store the data. As PLCs

typically use 16-bit signed binary processors, the integer values are limited between -32,768 and

+32,767. Pressure, temperature, flow, and weight are often represented by analog signals.

Analog signals can use voltage or current with a magnitude proportional to the value of the

process signal. For example, an analog 0 to 10 V or 4-20 mA input would be converted into an

integer value of 0 to 32767.

Current inputs are less sensitive to electrical noise (e.g. from welders or electric motor starts)

than voltage inputs.

Example[edit]

As an example, say a facility needs to store water in a tank. The water is drawn from the tank by

another system, as needed, and our example system must manage the water level in the tank by

controlling the valve that refills the tank. Shown is a "ladder diagram" which shows the control

system. A ladder diagram is a method of drawing control circuits which pre-dates PLCs. The

ladder diagram resembles the schematic diagram of a system built with electromechanical

relays. Shown are:

Two inputs (from the low and high level switches) represented by contacts of the float

switches

An output to the fill valve, labelled as the fill valve which it controls

An "internal" contact, representing the output signal to the fill valve which is created in the

program.

A logical control scheme created by the interconnection of these items in software

In ladder diagram, the contact symbols represent the state of bits in processor memory, which

corresponds to the state of physical inputs to the system. If a discrete input is energized, the

memory bit is a 1, and a "normally open" contact controlled by that bit will pass a logic "true"

signal on to the next element of the ladder. Therefore, the contacts in the PLC program that

"read" or look at the physical switch contacts in this case must be "opposite" or open in order to

return a TRUE for the closed physical switches. Internal status bits, corresponding to the state of

discrete outputs, are also available to the program.

In the example, the physical state of the float switch contacts must be considered when choosing

"normally open" or "normally closed" symbols in the ladder diagram. The PLC has two discrete

inputs from float switches (Low Level and High Level). Both float switches (normally closed) open

their contacts when the water level in the tank is above the physical location of the switch.

Page 23: Capp Microcont Plc

When the water level is below both switches, the float switch physical contacts are both closed,

and a true (logic 1) value is passed to the Fill Valve output. Water begins to fill the tank. The

internal "Fill Valve" contact latches the circuit so that even when the "Low Level" contact opens

(as the water passes the lower switch), the fill valve remains on. Since the High Level is also

normally closed, water continues to flow as the water level remains between the two switch

levels. Once the water level rises enough so that the "High Level" switch is off (opened), the PLC

will shut the inlet to stop the water from overflowing; this is an example of seal-in (latching) logic.

The output is sealed in until a high level condition breaks the circuit. After that the fill valve

remains off until the level drops so low that the Low Level switch is activated, and the process

repeats again.

| (N.C. physical (N.C. physical |

| Switch) Switch) |

| Low Level High Level Fill Valve |

|------[ ]------|------[ ]----------------------(OUT)---------|

| | |

| | |

| | |

| Fill Valve | |

|------[ ]------| |

| |

| |

A complete program may contain thousands of rungs, evaluated in sequence. Typically the PLC

processor will alternately scan all its inputs and update outputs, then evaluate the ladder logic;

input changes during a program scan will not be effective until the next I/O update. A complete

program scan may take only a few milliseconds, much faster than changes in the controlled

process.

Programmable controllers vary in their capabilities for a "rung" of a ladder diagram. Some only

allow a single output bit. There are typically limits to the number of series contacts in line, and the

number of branches that can be used. Each element of the rung is evaluated sequentially. If

elements change their state during evaluation of a rung, hard-to-diagnose faults can be

generated, although sometimes (as above) the technique is useful. Some implementations

forced evaluation from left-to-right as displayed and did not allow reverse flow of a logic signal (in

multi-branched rungs) to affect the output.


Recommended