A Peek at PLC Basics
A member writes us with questions about Program Logic Controllers while researching control systems. We thought there might be more out there who could benefit from the answers to these questions. If you have more specific questions you would like answered, please visit the Problem/Solution database Business Industrial Network. For new and used books about PLC click here.
These are the questions asked...
How can the concept be applied to a simple electrical circuit?
BIN95:Program Logic Controllers (refereed to as "PLC" by the industry) all have three basic functions. Control, Input, and Output. Based on Inputs, and the logic written in the control (known as Ladder Logic, or Sequence), outputs are activated. Based on the concept above, the light for a room and a switch would make a good example. Below is the logic for that application.
With the switch in the ON position, the controller will see the input and activate the output to a lamp. The above is referred to as a rung of logic. Below is an example of a typical 3way switch for room lighting. The lines connecting the two sets of conditions together are referred to as a "Branch".
The conditions in the above example rung of logic states … "If (East AND NOT West) OR (West AND NOT East) wall switch input, then output to the lamp." The first condition is (East AND NOT West), the second condition branched with an "OR" condition is (West AND NOT East).
What are some typical applications in an industrial environment system?
BIN95: The most common application is for individual machine control but can range to full plant control linking several PLCs together. On a particular machine, speed, options, Safety, operator interface, pneumatic, hydraulic, electricity are some items that may be controlled. PLCs have several different types of input and output cards depending on the type out interface desired. All machines, room temperatures, power monitoring, even security can be joined by linking several PLCs. These can then be displayed and controlled by a single Graphical User Interface (GUI) o a standard Personal Computer.
What is a sequencer and how is it represented in a ladder diagram?
BIN95: This question jumps from the basics of the last two questions to an advanced topic, too complex to go into detail here. A sequencer can be used for diagnostics, or control when a machine operates with in a set sequence of events. An example of a set sequence of events, would be… the air blows off a mold, the mold closes, high pressure is engaged, and if temp is ok, injection cylinder pushes material in mold, timer times up, mold opens. Then cycle would start all over again.
How a Sequencer is represented in ladder logic would depend on particular PLC and associated software. In Allen Bradley, they use three sequence instructions. One to load sequencer, one for Input conditions, and one for Output conditions.
The general gist is when control sees a set of various pre-defined Inputs, the sequencer will output a pre-defined set of Outputs.
PLC Direct software has an automatic conversion from ladder logic to sequential logic. This is not the same as described above. What their windows based software does is convert the ladder logic into a flow diagram, using real world outputs for each block in the flow diagram. The most excellent way we have seen to quickly understand what makes what work. They are also the best priced.
What is a time delay relay and how is it represented in a ladder diagram?
BIN95: There are two types of time delays, "Delay On" and "Delay Off".
Delay On: A timer that starts to time when a rung goes True (all conditions met), and times up when rung is true for a preset amount of time.
Delay Off: A timer that starts to time when a rung goes False (Not all conditions met), and times up when rung has been False for a preset amount of time.
You can use the timer's "Timed up" bit, or use it in it's inverted state "Not timed up", for either timer type. Between the two timers types, you can create any kind of time related relationship to input/output conditions occurring.
The way a timer is represented depends on the software used for each particular brand of PLC. The basic elements are preset, and increment values. If the increment value is set to .01 then a preset of 100 equals 1 second.
How can I apply a timer, sequencer, adder, subtractor, multiplier, divider, and converter in a ladder diagram?
BIN95: Hire an engineer and specify what PLC you want it programmed for, ha ! It's really a bit much to write the ladder logic for all these items. We can give you an example of most though. From the combination of examples you requested you may be looking for an example of how gate logic would look, converted to PLC logic. Advanced PLCs such as ABs PLC 5 allows you to type formulas directly into the Ladder logic. Values are stored in memory locations called "Integers".
The example above is a simple 3-way circuit for house lighting. With a few extras just for discussion purposes. This is not a practical logic design, and has no useful application. (Unless at some point in time you don't mind waiting for minutes for a light to come on after you actually switch it on. Ha!)
Rung 1: "If (East AND NOT West) OR (West AND NOT East) wall switch input, then output to the Internal Memory (B10/0)." The first condition is (East AND NOT West), the second condition branched with an "OR" condition is (West AND NOT East). Paralleled with the Output is Delay On Timer T7:00, which will time up after rung is true (above conditions are met) for 1 second.
Note: I:001/1 is used on some switches, and description such as "West Wall Switch" is used on other switches in this rung. This is intentional so you can figure out what I:001/X (input address) is associated with which discriptor.
Rung 2: If the internal output is true (on) and the timer T7:00 is timed up (T7:00.dn), then a real world output will turn light on. Paralleled with the Output is Counter C8:3, which will output after rung is true (above conditions are met) 5 times.
Note: In this PLC logic software, Timers and counters use extensions on their address to identify different functions of them. TX:XX.DN = Done bit, TX:XX.ACC = accumulated value, TX:XX.TT = timer is timing. CX:XX.DN = Done.
Rung 3: If counter C8:3 is done (light turned on 5 times) then add 200 (2 seconds with a timing base of .01) to the preset of timer T7:00. After the first 5 times the light is switched on, the new Delay On time will be 3 seconds. So the more the light is used the longer the Delay on will become, thus extending the life of the bulb.
Note: Some PLC software will require you to use Integers (Like N6:02) to do addition subtraction, and the use a "Move" instruction to place the results in a timer's preset.
Rung 4: If the Output for the light is Not on, then output to counter C8:4 and retentive Timer T7:1. We used the real world out put to show they can also be used as conditions. We inverted it just to show an example of NOT active bit. The counter will count each time the circuit is turned off until it reaches 999. This count will be one more than how many times the circuit was turned on.
Note: The timer is a retentive timer that keeps it's value during power down, and would have to be manually reset. The time base on the timer is 1 second.
Rung 5: This rung is unconditional, therefore activates computational output (does the formula) ever scan cycle. The formula takes how many time the circuit has been turned off (counter C8:4), and divides it by 5 to calculate how many times 2 seconds have been added to the delay on preset T7:00, by counter C8:3. Then the formula takes the previous calculation and times it by 2 to calculate total amount of seconds that have been added to Delay On timer preset. This final calculation is put in memory location N6:0.
Note: We minus 1 from the amount of times the circuit is turned off, to get the amount of times the circuit has been turned on.
Well that’s it, in a nut shell. Hope all our readers get some value from this.
Visit the pick of the month link at ...
Troubleshooting PLC Control Circuits training software.
PLC Training Seminar:
Business Industrial Network brings you the most value added PLC training seminar offer. We have had many request to conduct this seminar, so hurry and register today.
Click AB RSLogix ® PLC Training Seminar - PLC5 ® - SLC500 ® for details.
Or buy the book of the month ...Many control programs and examples, covering the basics as well as the complexities of sequential and automatic control and the latest trends in programmable controller technology. From fundamentals to PID instruction, and troubleshooting and maintenance. Upon completion, readers will be able to write complex programs using state diagramming, zone control, subroutines, and sequential function charts.
This item ships for FREE with Super Saver Shipping. New and used copies in stock.