Unit 1
Introduction to PLC

 Introduction

Control engineering has evolved over time. In the past humans were the main methods for controlling a system. More recently electricity has been used for control and early electrical control was based on relays. These relays allow power to be switched on and off without a mechanical switch. It is common to use relays to make simple logical control decisions. The development of low cost computer has brought the most recent revolution, the Programmable Logic Controller (PLC). The advent of the PLC began in the 1970s, and has become the most common choice for manufacturing controls.





                                           PLC control system components


PLCs have been gaining popularity on the factory floor and will probably remain predominant for some time to come. Most of this is because of the advantages they offer.
    Ø  Cost effective for controlling complex systems.
    Ø  Flexible and can be reapplied to control other systems quickly and easily.
    Ø  Computational abilities allow more sophisticated control.
    Ø  Trouble shooting aids make programming easier and reduce downtime.
    Ø  Reliable components make these likely to operate for years before failure


 What is a PLC?



                                 PLC station construction of Siemens S7

Programmable controllers have many definitions. However, PLCs can be thought of in simple terms as industrial computers with specially designed architecture in both their central units (the PLC itself) and their interfacing circuitry to field devices (input/output connections to the real world). Every aspect of industry—from power generation to automobile painting to food packaging—uses programmable controllers to expand and enhance production. In this module, you will learn about all aspects of these powerful and versatile tools.

DEFINITION
                                    

                                      PLC conceptual application diagram

Programmable logic controllers, also called programmable controllers or PLCs, are solid-state members of the computer family, using integrated circuits instead of electromechanical devices to implement control functions. They are capable of storing instructions, such as sequencing, timing, counting, arithmetic, data manipulation, and communication, to control industrial machines and process.

Working of PLC

  Block diagram of PLC

A programmable controller, as illustrated in Figure consists of two basic sections:
    Ø  The central processing unit
    Ø  The input/output interface system.


                                               


       Central processing unit (CPU)

The central processing unit (CPU) governs all PLC activities.The central processing unit, or CPU, is the most important element of a PLC. The CPU forms what can be considered to be the “brain” of the system. The three components of the CPU are:
           A.   The processor
           B.   The memory system
           C.   The power supply.

The operation of a programmable controller is relatively simple. The input/ output (I/O) system is physically connected to the field devices that are encountered in the machine or that are used in the control of a process. These field devices may be discrete or analog input/output devices, such as limit switches, pressure transducers, push buttons, motor starters, solenoids, etc. The I/O interfaces provide the connection between the CPU and the information providers (inputs) and controllable devices (outputs). During its operation, the CPU completes three processes:
      I.             It reads, or accepts, the input data from the field devices via the input interfaces
    II.             It executes, or performs, the control program stored in the memory system
   III.            It writes, or updates, the output devices via the output interfaces.
This process of sequentially reading the inputs, executing the program in memory, and updating the outputs is known as scanning.


The input/output system forms the interface by which field devices are connected to the controller .The main purpose of the interface is to condition the various signals received from or sent to external field devices. Incoming signals from sensors (e.g., push buttons, limit switches, analog sensors, selector switches, and thumbwheel switches) are wired to terminals on the input interfaces. Devices that will be controlled, like motor starters, solenoid valves, pilot lights, and position valves, are connected to the terminals of the output interfaces. The system power supply provides all the voltages required for the proper operation of the various central processing unit sections.

                                                
                                                         

    INPUTS AND OUTPUTS

Inputs to, and outputs from, a PLC are necessary to monitor and control a process. Both inputs and outputs can be categorized into two basic types: logical or continuous. Consider the example of a light bulb. If it can only be turned on or off, it is logical control. If the light can be dimmed to different levels, it is continuous. Continuous values seem more intuitive, but logical values are preferred because they allow more certainty, and simplify control. As a result most controls applications (and PLCs) use logical inputs and outputs for most applications. Hence, we will discuss logical I/O and leave continuous I/O for later.
A short list of popular actuators is given below in order of relative popularity.
       A.   Solenoid Valves - logical outputs that can switch a hydraulic or pneumatic flow.
       B.   Lights - logical outputs that can often be powered directly from PLC output boards.
       C.   Motor Starters - motors often draw a large amount of current when started, so they              require motor starters, which are basically large relays.
       D.   Servo Motors - a continuous output from the PLC can command a variable speed or position.
Outputs from PLCs are often relays, but they can also be solid state electronics such as transistors for DC outputs or Triacs for AC outputs. Continuous outputs require special output cards with digital to analog converters. Inputs come from sensors that translate physical phenomena into electrical signals. Typical examples of sensors are listed below in relative order of popularity.
      A.   Proximity Switches - use inductance, capacitance or light to detect an object logically.
      B.   Switches - mechanical mechanisms will open or close electrical contacts for a logical signal.
      C.   Potentiometer - measures angular positions continuously, is using resistance.
      D.   LVDT (linear variable differential transformer) - measures linear displacement continuously using magnetic coupling.
Inputs for a PLC come in a few basic varieties, the simplest are AC and DC inputs. Sourcing and sinking inputs are also popular. This output method dictates that a device does not supply any power. Instead, the device only switches current on or off, like a simple switch.
      A.   Sinking - When active the output allows current to flow to a common ground. This is best selected when different voltages are supplied.
       B.    Sourcing - When active, current flows from a supply, through the output device and to ground. This method is best used when all devices use a single supply voltage. This is also referred to as NPN (sinking) and PNP (sourcing). PNP is more popular.

2.     Inputs

In smaller PLCs the inputs are normally built in and are specified when purchasing the PLC. For larger PLCs the inputs are purchased as modules, or cards, with 8 or 16 inputs of the same type on each card. For discussion purposes we will discuss all inputs as if they have been purchased as cards. The list below shows typical ranges for input voltages, and is roughly in order of popularity.
       A.       12-24 Vdc
       B.      100-120 Vac
       C.     10-60 Vdc
       D.     12-24 Vac/dc
       E.      5 Vdc (TTL)
       F.       200-240 Vac
      G.      48 Vdc
      H.      24 Vac
There are many trade-offs when deciding which type of input cards to use.
      A.   DC voltages are usually lower and therefore safer (i.e., 12-24V).
      B.   DC inputs are very fast, AC inputs require a longer on-time. For example, a 60Hz wave may require up to 1/60sec for reasonable recognition.
      C.   DC voltages can be connected to larger variety of electrical systems.
      D.   AC signals are more immune to noise than DC, so they are suited to long distances, and noisy (magnetic) environments.
      E.   AC power is easier and less expensive to supply to equipment.
      F.    AC signals are very common in many existing automation devices.

2.1      Output Modules

As with input modules, output modules rarely supply any power, but instead act as switches. External power supplies are connected to the output card and the card will switch the power on or off for each output. Typical output voltages are listed below, and roughly ordered by popularity.
       A.       120 Vac
       B.       24 Vdc
       C.      12-48 Vac
       D.      12-48 Vdc
       E.       5Vdc (TTL)
       F.        230 Vac











PLC- TIMERS:
There are five basic timers in Siemens PLC :
1. Pulse Timer (S-Pulse)
2. Pulse Extended Timer (S- Pext)
3. On Delay Timer ( S-ODT)
4. Retentive On Delay Timer ( S- ODTS)
5. Off Delay Timer ( S-Off DT)


1. Pulse Timer ( S-Pulse)
    The feature of this type of timer is that when INPUT switch is made ON the OUTPUT gets ON immediately and it gets OFF automatically after the time you have set to the timer. Before the OUTPUT gets OFF automatically if INPUT switch is OFF the OUTPUT gets OFF at the instant.

2. Pulse Extended Timer ( S- Pext)
   The feature of this type of timer is that when INPUT switch is made ON the OUTPUT gets ON immediately and it gets OFF automatically after the time you have set to the timer. Before the OUTPUT gets OFF automatically if INPUT switch is OFF the OUTPUT does not get OFF,  this is the only difference between pulse timer and pulse extended timer. To make the OUPUT OFF at any time the reset switch should made ON.

3. On Delay Timer ( S-ODT)
    The feature of this type of timer is that when INPUT switch is made ON the OUTPUT gets ON after the time you have set to the timer. When the INPUT is made OFF the OUTPUT gets OFF at the instant. Before the OUTPUT gets ON if we are making the INPUT supply OFF at the time we will not get the OUTPUT.

4. Retentive On Delay Timer ( S-ODT)
    The feature of this type of timer is that when INPUT switch is made ON the OUTPUT gets ON after the time you have set to the timer. When the INPUT is made OFF the OUTPUT  remains ON , to make the OUTPUT OFF we have to use the reset switch. Before the OUTPUT gets ON if we are making the INPUT supply OFF  still we will be gating the OUTPUT which is the special feature of this timer to make OUTPUT OFF at any instant we have to use a reset switch.

5. OFF Delay Timer ( S-ODT)
    The feature of this type of timer is that when INPUT switch is made ON the OUTPUT gets ON at that instant and timer we be acting just as short circuit that means it will not count any things. When the INPUT is made OFF this timer will start its work.

When the INPUT supply is made OFF at the time that the timer will start the countdown and it will make the  OUTPUT  ON for the time we have given to the timer.
If we want to make the OUTPUT OFF at any instant at that time we have make the reset switch ON.


PLC- COUNTER:

There are three basic counter in Siemens PLC :
1. Up Counter (S-CU)
2. Down Counter (S- CD)
3. UP/Down Counter ( S-CUD)




1. UP COUNTER


When the signal state at the "I0.0" input changes from "0" to "1" (positive signal edge) and the current counter value is less than "999", the counter value is incremented by one. When the signal state at the "I0.1" input changes from "0" to "1", the counter value is set to the value of the "C#03" operand. The counter value is reset to "0" when the "I0.2" operand has signal state "1".
The current counter value is hexadecimal in the "MW0" operand and BCD-coded in the "TagValue_2" operand.
The "Q" output has the signal state "1" as long as the current counter value is not equal to "0".

2. DOWN COUNTER



When the signal state at the "M0.1" input changes from "0" to "1" (positive signal edge) and the current counter value is greater than "0", the counter value is decremented by one. When the signal state at the "I0.0" input changes from "0" to "1", the counter value is set to the value of the "DB1.DBW20" operand. The counter value is reset to "0" when the "I2.1" operand has signal state "1".
The current counter value is hexadecimal in the "MW0" operand and BCD-coded in the "MW2" operand.
The "Q" output has the signal state "1" as long as the current counter value is not equal to "0".




3. UP/DOWN COUNTER


If the signal state at the "I0.0" or "I0.1" input changes from "0" to "1" (positive signal edge), the "Assign parameters and count up / down" instruction is executed. When there is a positive signal edge at the "I0.0" input and the current counter value is less than "999", the counter value is incremented by one. When there is a positive signal edge at the "I0.1" input and the current counter value is greater than "0", the counter value is decremented by one.
When the signal state at the "S" input changes from "0" to "1", the counter value is set to the value of the "PresetValue" operand. The counter value is reset to "0" when the "RESET" operand has signal state "1".