Examples of Ladder Diagram:: (Example One)
Examples of Ladder Diagram:: (Example One)
Examples of Ladder Diagram:: (Example One)
Examples continued:
Inputs Low level sensor High level Sensor Output Motor Address 0000 0001 Address 0500
Examples continued:
The Ladder Diagram
Examples continued:
Scan 1 Initially the tank is empty. Therefore, input 0000 is TRUE and input 0001 is also TRUE
Scan 3 After scan 2 the oil level rises above the low level sensor and it becomes open. (i.e. FALSE)
Examples continued:
Scan 4 After scan 4 the oil level rises above the high level sensor at it also becomes open (i.e. false)
Scan 5 Since there is no more true logic path, output 500 is no longer energized (true) and therefore the motor turns off.
Scan 6 After scan 6 the oil level falls below the high level sensor and it will become true again.
Examples continued:
Example Continued
Here we are using 2 momentary push button switches. One is physically connected to input 0000 while the other is physically connected to input 0001. When the operator pushes switch 0000 the instruction "set 0500" will become true and output 0500 physically turns on. Even after the operator stops pushing the switch, the output (0500) will remain on. It is latched on. The only way to turn off output 0500 is turn on input 0001. This will cause the instruction "res 0500" to become true thereby unlatching or resetting output 0500.
Example Continued
Example Continued
Reset: When this input turns on the current (accumulated) count value will return to zero. Pulse: The second input is the address where the pulses we are counting are coming from. Cxxx is the name of the counter. If we want to call it counter 000 then we would put "C000" here. yyyyy is the number of pulses we want to count before doing something.
Example Continued
Here we want to count 5 widgets from input 0001 before turning on output 0500. Sensor 0002 will reset the counter.
Example Continued
In order to work with timers, we need to know to things:
1. What will enable the timer. Typically this is one of the inputs.(a sensor connected to input 0000 for example) 2. How long we want to delay before we react. Let's wait 5 seconds before we turn on a solenoid, for example. This timer is the on-delay type and is named Txxx. When the enable input is on the timer starts to tick. When it ticks yyyyy (the preset value) times, it will turn on its contacts that we will use later in the program.
Example Continued
In this diagram we wait for input 0001 to turn on. When it does, timer T000 (a 100ms increment timer) starts ticking. It will tick 100 times. Each tick (increment) is 100ms so the timer will be a 10000ms (i.e. 10 second) timer. 100ticks X 100ms = 10,000ms. When 10 seconds have elapsed, the T000 contacts close and 500 turns on. When input 0001 turns off(false) the timer T000 will reset back to 0 causing its contacts to turn off(become false) thereby making output 500 turn back off.
Example Continued
Example Continued
In this diagram we wait for input 0002 to turn on. When it does timer T000 (a 10ms increment timer) starts ticking. It will tick 100 times. Each tick (increment) is 10ms so the timer will be a 1000ms (i.e. 1 second) timer. 100ticks X 10ms = 1,000ms. When 1 second has elapsed, the T000 contacts close and 500 turns on. If input 0002 turns back off the current elapsed time will be retained. When 0002 turns back on the timer will continue where it left off. When input 0001 turns on (true) the timer T000 will reset back to 0 causing its contacts to turn off (become false) thereby making output 500 turn back off.
Example Continued
Examples Continued
This Exam gives a complete understanding of input, output, OR and AND commands in ladder diagram, and Timer. Here it is shown that if input I0.0 and I0.1 are on then output Q0.0 will turn on and this part explains the AND command. Output Q0.0 can also be activated if input I0.2 is on, which shows the OR command. In network two it is shown that when input I0.3 is activated a timer will count 3 seconds (300ms10ms=3 s) and then this timer will activate the output Q0.1 .
Examples Continued
Example Solution
I00 Q01
SET
T33
I01
I01
Q01
Reset
I02
Q01
I00
T33
2000 10ms
Solution Description
In this example as I mentioned there should be a latching system to keep the gate open and close it after a car passes through. Here I00 is the infrared sensor that takes the command from the remote control. As it get the command it opens the gate Q01 and at the same time it will activated the 20 second timer T33
I00
Q01
SET
I00
T33
2000 10ms
I01
Q01
Reset
T33
I01
I02
Q01
Example Picture
Example Continued
This example is one of the most complicated examples in this presentation. Here the water sprinkler system (Q0.0) starts to work when either temperature sensor(I0.0) or humidity sensor (I0.1) send a signal to it. In this scenario grass will be water first (water the grass Q0.1) fro 4 second (it is assumed very small for simplicity) and then flowers will be water (water the flowers Q0.2) for 10 second and at last trees will be watered (water the trees Q0.3) for 18 seconds. Since it is required to avoid pressure drop in the water line ,each section is separated and here the order to water this garden is given: First grass, second flowers and third trees.
Example Continued
Here you can see that either temperature sensor I0.0 or humidity sensor I0.1 can turn on the sprinkler system (Q0.0). If the humidity or temperature falls below a specific point the system will start working.
Example Continued
Example Continued
In this Example it is needed to water the grass for 4 seconds. Since the increment is 10 ms, it is written 400ms in the timer. The input is assume to be the Q0.0 which was the switch for sprinkler system. Here it is assumed that if the sprinkler is on, the output Q0.1 will also become on and it will remain on for 4 seconds. If you take a look at the ladder diagram you will see that the input Q0.0 turn the timer on and it will count 4 seconds until it breaks the second line.
Example Continued
Since the input switch Q0.0 turn on all the timers in this ladder diagram at the same time it is required to add the time for watering of each section with the time elapsed in the previous sequence. For example although it is required to water the flowers for only 10 second but in the timer it is written 1400ms with the increment 10 ms which will eventually be equal to 14 second. Now if you subtract 14 seconds from 4 second (the time required for the first section) you will get the required time which is 10 seconds. There is one more important parameter here. In the ladder diagram it is written if the first section is done start the second section. You can see this in the second line of the ladder diagram. The output here is Q0.2 which is assumed for watering flowers.
Example Continued
Example Continued
This part is like the second part. Watering the trees is started when previous section are finished. The time for this section is 18 second which is added to 14 seconds counted before and now it is written as 3200 ms with 10ms increment. You can see when both Q0.1 and Q0.2 are off the third part (Q0.3) is started.
Example(Example Ten)
This example is based on a parking lot with a PLC which counts the number of cars that enter and exit and if the parking lot is about to be full, PLC sends a signal to a electronic board to say that the parking is full. The system is also utilizing a infrared sensor to open the gates with remote control.(The capacity of this parking lot is assumed to be 5 cars.)
Solution
Example Continued
In this example input I0.0 open the entrance gate and input I0.1 opens the exit gate. I0.0 and I0.1 are both infrared sensors which will be activated by remote control. In addition sensor I0.2 count the number of cars entering the parking lot and sensor I0.3 counts the cars leaving . The switch I0.4 is used to reset the system. If a total number of 5 cars enter this parking lot, counter C1 send a signal to the electronic board Q0.2 to show that the parking is full.
This object will move on the conveyor belt and when it reaches the bar code reader , it reads the bar code on the part and then the part will move in front of a sensor which will stop the conveyor belt. At this time the robot will take the part to machine one or machine two or conveyor one according to the bar code. Later it will be explained how the robot is programmed.
Now lets assume that the part is placed on the conveyor one. The part will move on this conveyor until it reaches the color sensor and if it has white or black color the conveyor will stop. If the conveyor belt stops the part will be taken by the pneumatic robot and it will be placed on the table next o the conveyor belt.
If the object does not have the specific color the object will move until it reaches another sensor which will stop the conveyor one . Now the robot will take the part and place it on the position specified for it.
For example here 3 programmers are written for the robot next to conveyor 2 to take the part to machine 1 or machine 2 or conveyor 1.
In the previous slide J stands for jump, M 1,2,.. Are for different axes of the robot and the coordinated for each axis is defined. In order to have a loop in this system J 100 is used to jump the last line to the first line. T stand for time. The robot will wait in a position for a small time interval defined by T 100,200,.. . S and P are used to get a part and release it at specified position.
With the help of these coordinates the visual basic program is written. It is defined in this program for example for a part with a specific bar code, take the part and place it in machine one. Here an outline of the program is given.
Now three positions are defined for the robot to move to that position, take the part and place it in a machine or conveyor one. Here the codes to place the part in machine one are shown. These codes can be accessed easily by double clicking on box 1 in the program and change the coordinates according to the coordinates that were set in ROBOTICA.
Here are the coordinates for box 2 or machine 2 are shown. One can simply define his/her coordinates according to those he/she defined in ROBOTICA.
Now the coordinates for the conveyor are defined in the program.
I mentioned that a part is placed in machine 1 or machine 2 or conveyor 1 according to its bar code. In this part of the program it is defined how each part is placed according to its bar code. The bar code for each object defines its color and for each color a series of codes similar to the tree potions mentioned are written. Here for example the position for an object with yellow or green color is defined.
There are also a set of codes written for parts which are not in any categories.
CAD/CAM Laboratory
Cont.
Inside the PLC housing, connected between each input terminal and the Common terminal, is an opto-isolator device that provides an electrically isolated "high" logic signal to the computer's circuitry when there is 120 VAC power applied between the respective input terminal and the Common terminal. An indicating LED on the front panel of the PLC gives visual indication of an "energized" input as in figure.
Cont.
Output signals are generated by the PLC's computer circuitry activating a switching device connecting the "Source" terminal to any of the "Y-" labeled output terminals. The "Source" terminal, correspondingly, is usually connected to the L1 side of the 120 VAC power source. As with each input, an indicating LED on the front panel of the PLC gives visual indication of an "energized" output as in the figure.
cont.
In this way, the PLC is able to interface with realworld devices such as switches and solenoids. The actual logic of the control system is established inside the PLC by means of a computer program. This program dictates which output gets energized under which input conditions. The program is entered and viewed via a personal computer connected to the PLC's programming port.
Cont.
Consider the following circuit and PLC program: When the pushbutton switch is unpressed, no power is sent to the X1 input of the PLC. Following the program, which shows a normally-open X1 contact in series with a Y1 coil, no "power" will be sent to the Y1 coil. Thus, the PLC's Y1 output remains deenergized, and the indicator lamp connected to it remains dark.
Cont.
If the pushbutton switch is pressed, however, power will be sent to the PLC's X1 input. Any and all X1 contacts appearing in the program will assume the actuated (non-normal) state, as though they were relay contacts actuated by the energizing of a relay coil named "X1". In this case, energizing the X1 input will cause the normallyopen X1 contact will "close," sending "power" to the Y1 coil. When the Y1 coil of the program "energizes," the real Y1 output will become energized, lighting up the lamp connected to it:
Cont.
In the following illustration, we have the altered system shown in the state where the pushbutton is unactuated (not being pressed: In this next illustration, the switch is shown actuated (pressed):
Cont.
One of the advantages of implementing logical control in software rather than in hardware is that input signals can be reused as many times in the program as is necessary. For example, take the following circuit and program, designed to energize the lamp if at least two of the three pushbutton switches are simultaneously actuated.
Cont.
To build an equivalent circuit using electromechanical relays, three relays with two normally-open contacts each would have to be used, to provide two contacts per input switch. Using a PLC, however, we can program as many contacts as we wish for each "X" input without adding additional hardware, since each input and each output is nothing more than a single bit in the PLC's digital memory (either 0 or 1), and can be recalled as many times as necessary. since each output in the PLC is nothing more than a bit in its memory as well, we can assign contacts in a PLC program "actuated" by an output (Y) status. Take for instance this next system, a motor start-stop control circuit:
Cont.
If we were to press the "Start" button, input X1 would energize, thus "closing" the X1 contact in the program, sending "power" to the Y1 "coil," energizing the Y1 output and applying 120 volt AC power to the real motor contactor coil. The parallel Y1 contact will also "close," thus latching the "circuit" in an energized state:
cont.
To stop the motor, we must momentarily press the "Stop" pushbutton, which will energize the X2 input and "open" the normally-closed "contact," breaking continuity to the Y1 "coil:"
In this motor control circuit example, we have a problem: if the input wiring for X2 (the "Stop" switch) were to fail open, there would be no way to stop the motor! The solution to this problem is a reversal of logic between the X2 "contact" inside the PLC program and the actual "Stop" pushbutton switch:
cont.
To demonstrate how one of these "internal" relays might be used, consider the following example circuit and program, designed to emulate the function of a three-input NAND gate. Since PLC program elements are typically designed by single letters, I will call the internal control relay "C1" rather than "CR1" as would be customary in a relay control circuit:
Cont.
In this circuit, the lamp will remain lit so long as any of the pushbuttons remain unactuated (unpressed). To make the lamp turn off, we will have to actuate (press) all three switches, like this:
Cont.
This section on programmable logic controllers illustrates just a small sample of their capabilities. As computers, PLCs can perform timing functions drum sequencing, and other advanced functions with far greater accuracy and reliability than what is possible using electromechanical logic devices. Most PLCs have the capacity for far more than six inputs and six output