THE PROGRAMMABLE LOGIC CONTROLLER

Download THE PROGRAMMABLE LOGIC CONTROLLER

Post on 19-Jan-2016

105 views

Category:

Documents

1 download

Embed Size (px)

DESCRIPTION

Slovak University of Technology Faculty of Material Science and Technology in Trnava. THE PROGRAMMABLE LOGIC CONTROLLER. Programmable Logic Controller (PLC). PLCs have been gaining popularity on the factory floor is because of the advantages they offer : - PowerPoint PPT Presentation

TRANSCRIPT

  • THE PROGRAMMABLE LOGIC CONTROLLER Slovak University of TechnologyFaculty of Material Science and Technology in Trnava

  • Programmable Logic Controller (PLC) PLCs have been gaining popularity on the factory floor 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.

  • A PLC illustrated with relays

  • Origins of Ladder DiagramThe Ladder Diagram (LD) programming language originated from the graphical representation used to design an electrical control systemControl decisions were made using relaysAfter a while Relays were replaced by logic circuitsLogic gates used to make control decisionsFinally CPUs were added to take over the function of the logic circuitsI/O Devices wired to buffer transistorsControl decisions accomplished through programmingRelay Logic representation (or LD) was developed to make program creation and maintenance easierComputer based graphical representation of wiring diagrams that was easy to understandReduced training and support cost

  • Origins of Ladder Diagram

  • What is a Rung?A rung of ladder diagram code can contain both input and output instructionsInput instructions perform a comparison or test and set the rung state based on the outcomeNormally left justified on the rungOutput instructions examine the rung state and execute some operation or functionIn some cases output instructions can set the rung stateNormally right justified on the rung

  • Series Vs Parallel OperationsLadder Diagram input instructions perform logical AND and OR operations in and easy to understand formatIf all Input Instructions in series must all be true for outputs to execute (AND)If any input instruction in parallel is true, the outputs will execute (OR)Paralleling outputs allows multiple operations to occur based on the same input criteria

  • Ladder Logic ExecutionRungs of Ladder diagram are solved from Left to right and top to bottomBranches within rungs are solved top left to bottom right

  • Non Retentive CoilsThe referenced bit is reset when processor power is cycledCoil -( )-Sets a bit when the rung is true(1) and resets the bit when the rung is false (0)PLC5 calls this an OTE Output EnableNegative coil -( / )-Sets a bit when the rung is false(0) and resets the bit when the rung is True(1)Not commonly supported because of potential for confusionSet (Latch) coil -(S)-Sets a bit (1) when the rung is true and does nothing when the rung is falseReset (Unlatch) Coil -(R)-Resets a bit (0) when the rung is true and does nothing when the rung is false

  • ContactsNormally Open Contact -| |-Enables the rung to the right of the instruction if the rung to the left is enabled and underlining bit is set (1)Normally Closed Contact -|/|-Enables the rung to the right of the instruction if the rung to the left is enabled and underlining bit is reset (0)Positive transition contact -|P|-Enables the right side of the rung for one scan when the rung on left side of the instruction is trueAllen Bradley PLC5 uses -[ONS]-Negative transition contact -|N|-Enables the right side of the rung for one scan when the rung on left side of the instruction is false

  • Retentive Vs Non-retentive OperationDefinitionsRetentive values or instructions maintain their last state during a power cycleNon-retentive values or instructions are reset to some default state (usually 0) after a power cycleIEC1131 permits values to be defined as retentiveA contradiction to this is ladder diagram where 3 instructions are classified as retentiveIn most PLCs only timer and coil instructions operate as non-retentive

  • Retentive CoilsThe referenced bit is unchanged when processor power is cycledRetentive coil -(M)-Sets a bit when the rung is true(1) and resets the bit when the rung is false (0)Set Retentive (Latch) coil -(SM)-Sets a bit (1) when the rung is true and does nothing when the rung is falsePLC5 uses OTL Output LatchReset Retentive (Unlatch) Coil -(RM)-Resets a bit (0) when the rung is true and does nothing when the rung is falsePLC5 uses OUT Output Unlatch

  • Transition Sensing CoilsPositive transition-sensing coil -(P)-Sets the bit bit (1) when rung to the left of the instruction transitions from off(0) to on(1)The bit is left in this statePLC5 use OSR (One Shot Rising)Negative transition-sensing coil -(N)-Resets the bit (0) when rung to the left of the instruction transitions from on(1) to off(0)The bit is left in this statePLC5 uses OSF (One Shot Falling)

  • IEC Comparison Instructions in LadderIf the rung input (EN) is enabled, the instruction performs the operation and sets the rung output (ENO) based on the comparisonExample: when EN is true, EQ (=) function compares In1 and to In2 and sets ENOComprehensive instruction setEQ(=), GT (>), GE (>=), LT (
  • Timers in Ladder DiagramThere three timer instructions in IEC1131TP - Pulse timerTON - Timer On DelayTOF - Timer Off DelayTime valuesTime base is 1msec (1/1000 of a sec)Values entered using duration literal formatTwo possible visualizations Depending on use of EN/ENO1st method requires extra programming if timer done status needs to be referenced on other rungs2nd method sets a bit with Q which can be referenced by other logic, ENO=EN

  • Timer OperationIN = Rung input conditionQ = Comparison output resultsVaries with timer typesPT = Preset TimeET = Elapse Time

  • Counters in Ladder DiagramThere three counter instructions in IEC1131CTU - Count Up CounterCTD - Count Down CounterCTUD - Count Up/Down CounterAll three count rung transitionsTwo possible visualizations Depending on use of EN/ENO1st method requires extra programming if timer done status needs to be referenced on other rungs2nd method sets a bit with Q which can be referenced by other logic, ENO=EN

  • Counter OperationParametersCU/CD = Count up/DownQ/QU/QD = Comparison OutputR = Reset to ZeroLD = Load CV with PVPV = Preset ValueCV = Count Value

  • Execution Control ElementsJump / Label InstructionsJump to a label skips a block of code without it being scannedLBL - Named target for a jump operationJMP - Performs a jump when the rung conditions are trueCALL / RETURN InstructionsUsed to encapsulate logic and call it as a subroutineCauses execution to change between functions or subroutinesCAL - Passes control to another named functionPLC5 uses JSRRET - Exits a function and returns control back to the calling routine

  • Different Instruction PresentationsThe look and feel of IEC 1131-3 is somewhat different from the 1Million+ PLCs that Allen Bradley has running in factories throughout the world

    IEC places the input parameters on the outside of the instruction block vs the PLC5 where they are presented inside of the block

  • Extending the IEC1131-3 Instruction SetIEC1131-3 Provides a very basic set of instructions to do simple operations (81 Ladder Diagram Instructions)Data Type Conversion - Trunc, Int_to_Sint, Dint_to_Real, Bcd_To_Int Boolean Operations - Bit Test, Bit Set, One Shot, Semaphores Timers / Counters - Ton, Tp, Ctu, Ctd, CtudSimple Math - Add, Sub, Mul, Div, Mod, Move, ExptMisc. Math - Abs, Sqrt, Ln, Log, Exp, Sin, Cos, Tan, Asin, Acos, AtanBit Shift - Shl, Shr, Ror, RolLogic - And, Or, Xor, NotSelection - Sel, Max, Min, Limit, MuxCompare - GT, GE, EQ, LE, LT, NEString - Len, Left, Right, Mid, Concat, Insert, Delete, Replace, FindControl - JMP, LBL, JSR, RETAll complex operations are left to the user or vendor to defineFile Operations, PID, Diagnostic, For/Nxt Loop, Search, Sort are not in IEC1131-3Extensions to the instruction set are permitted so that vendors can add instructions that their customers needAll vendors have defined their own set of extensionsRockwell Automation controllers have significantly more capability with over 130 Ladder Instructions

  • PLC HARDWARE The most essential components PLC are:Power Supply - 24Vdc, 120Vac, 220Vac.CPU (Central Processing Unit) - This is a computer where ladder logic is stored and processed.I/O (Input/Output) - A number of input/output terminals must be provided so that the PLC can monitor the process and initiate actions.Indicator lights - These indicate the status of the PLC including power on, program running, and a fault. These are essential when diagnosing problems.

  • PLC HARDWARETypical configurations are listed below from largest to smallest:Rack - A rack is often large (up to 18 by 30 by 10) and can hold multiple cards. When necessary, multiple racks can be connected together. These tend to be the highest cost, but also the most flexible and easy to maintain.Mini - These are similar in function to PLC racks, but about half the size.Shoebox - A compact, all-in-one unit (about the size of a shoebox) that has limited expansion capabilities. Lower cost, and compactness make these ideal for small applications.Micro - These units can be as small as a deck of cards. They tend to have fixed quantities of I/O and limited abilities, but costs will be the lowest.Software - A software based PLC requires a computer with an interface card, butallows the PLC to be connected to sensors and other PLCs across a network.

  • INPUTS FOR A PLCInputs for a PLC come in a few basic varieties, the simplest are AC and DC inputs. Sourcing and sinking inputs are also popular:Sinking - When active the output allows current to flow to a common ground. This is best selected when different voltages are supplied.Sourcing - When active, current flows from a supply, through the output device and to ground. T

Recommended

View more >