Interlock in Ladder Logic Programming

Hi friends and hope you are all very well. Today, we are going to deal with one of the most important and common problems that would be there in everyday tasks in industry and its solution. The problem is the safety of equipment and operators by preventing the machine from running under specific conditions for realizing the safety of equipment and human as well. Not only does it fulfill safety but also it is for performing the designed sequence of operation. If there is a problem, then it should be the solution for it. the solution is what so-called “Interlock”. So, what is interlock? And why do we need it? And how we can design a good interlock? Well! We may find such concerns exist in two aspects which are safety and operation sequence. In the first aspect, safety happens when we need to make the execution of one operation or process locked by some condition for realizing the safety of the operator or equipment. The second one is operation sequence for which we need to sort the operation into sequential and concurrent tasks according to the logic philosophy of the operation. That can be realized by preventing one task of execution until one other task is finished or letting one task wait until one or more conditions are fulfilled. I hope that makes the reason why we need interlock close comes to your mind. Now, how we can perform interlock? Well! It can be done in many approaches. However, we can say simply there is only and only one idea to do interlock. It is by putting the condition “contact” on which it will be decided if the process will go on or not, or based on it, one piece of equipment can go running or keep stopped. By completing this article, you will have known what is interlock, why we need it in industry daily life problems, its techniques, and for sure how to program interlock. Furthermore, types of interlock, real examples from industry, and how you can implement it using ladder logic programming in different ways will be ready for you to learn and practice in this tutorial.

What is interlock?

Interlock is how to prevent one process or equipment from running to satisfy safety requirements or fulfill the logic of the operation. A clear example of an interlock is to prevent cutting weapons from executing as long as the hands of the operator are away from the working area. In this case, there will be two push buttons on the left and right of the operator and out of the working space to make sure, when the operator requests the cutting machine to operate, his hands were pressing those two push buttons which are out of the working space. The previous example shows how to employ interlock for realizing safety purposes. Another instance that shows how Interlock can be used to satisfy the operation logic requirements is when we need to drive the motor in two directions. In that case, we commonly use two relays or contactors for forward and reverse directions. So, there should be an interlock of each contactor to each other meaning we cannot activate both at the same time because that will end up with a short circuit on the motor or the supply.

What are types of interlock?

There are two main types of interlock which are safety interlocks and machine or equipment interlocks. Safety interlocks for securing people from getting hurt while they operate the machine. And machine interlock concerns with securing the safety of machine parts and or realizing specific philosophy of logic. Figure 1 shows the different types and subcategories of interlock. The machine or equipment interlock can be classified into three types which are mechanical, electrical, and logical interlock types. And from their titles, the mechanical interlock can be physically satisfied by making mechanical connections between equipment to let or prevent them from running. An electrical interlock can be achieved by using electrical devices like relys’ coils, sensors, and switches. The first one which is relays’ coils is the most interesting electrical interlock technique as they can be utilized in creating a dependency between equipment so we can design flexibly dependence between two motors, for example, to not running simultaneously meaning one of two running scenarios. The last type is the logical interlock which is the most important here in this tutorial and I hope you get an astonishing start to master that type because that is the most frequently used in real life in the industry. Do you know why? Because it is done programmatically without the need for mechanical connections and setup or even electrical devices or hardwiring. Also, it is very flexible as you can change it when there is a need to change the logic at any time.

Fig.1: interlock types

Figure 2 shows the very example of a safety interlock to protect the operator from entering the zone of robot work to save him from the movable parts. Is that a mechanical or electrical interlock? Or maybe logical? What do you think? Well! Let’s move forward in the tutorial and come back to this question to see if you know the answer or not.

Fig. 2: the safety interlock

The non-safe interlock is designed for protecting equipment and lock specific processes from execution. The machinery interlock is classified into three main categories which are mechanical, electrical, and logic interlock. In mechanical interlock, a set of mechanical setups is designed to prevent equipment or operation from running at some operating conditions. Figure 3 shows a schematic of a mechanical interlock for a setup that makes the motor spin either forward or reverse direction and prevent enabling both at the same time. The dotted line represents the mechanical interlock between the two contactors for reverse and forward contactors for guaranteeing to enable only one of them at any given time.

Fig. 3 mechanical interlock example

Figure 4 shows the case of missing the mechanical interlock between the two contactors. It shows the possibility of activating bother of them at a given time. In that case, you can see the damaging effects on the motor and the short circuit possibility on the power lines.

Fig. 4: fault condition due to missing interlock

Another example of mechanical interlock is car steering interlock as shown in fig. 5. The steering wheel is interlocked mechanically and unlocked by inserting the key.

Fig. 5: car steering mechanical interlock

The mechanical interlock was commonly used in the past and my be exist nowadays but very rarely. On the other hand, the electrical interlock is the most commonly used in control systems currently. Similarly, the idea of electrical interlock can be achieved by preventing the flow of current between two devices at the same time. Typically two contactors or relays are used for achieving such electrical interlock. One of these contractors will be normally open and the other will be in a normally closed configuration as in Fig. 6. It is very clear that for energizing the lamp, CR2 will be energized when CR1 is de-energized.

Fig. 6: electrical interlock example 1

Another example of electrical interlock which is very common is the thermal overload shown in Fig 7. It shows two contactors are used in electrical interlock configuration. The main contractor is in a normally open configuration while the thermal overload contactor is in a normally closed configuration. When there the temperature is getting high to a specific value the thermal overload turns over from normally closed to normally open to disconnect the load.

Fig. 7: electrical interlock example 2

Now, let's move to the logical interlock which is our target in this tutorial. Logical interlock is applying the same concept of interlock programmatically. In this type, there is no mechanical or electrical physical connection for achieving interlock. Instead, programming is used to perform the interlock. This logical interlock saves the effort of commissioning including mechanical or electrical connections. In addition, it realizes reliability and flexibility.

Logical interlock in ladder logic programming

Figure 8 shows one example of logic interlock. You can notice the left part of the figure shows there are no mechanical or electrical hardwiring or connections between pumps 1 and 2. However, pump 2 is interlocked with pump 1 logically as shown in the most left part that shows the ladder logic code. To have pump 2 running, pump 1 should run first by the level switch. As shown on the right part of the figure below, when the level of the liquid reaches above the level switch, the switch is turned on and energized pump 1 which activates pump 2.

Fig. 8: logic interlock example 1

Figure 9 shows another logic interlock example in which a timer of type on delay is used to interlock equipment. As shown on the left the ladder logic code and on the right, an image shows the scenario of the logic with astonishing visualization. It shows that, when the operator presses the start pushbutton and keep pressing on it for the preset time value which is 3 second, the timer contact turns on and the coil of the contactor is energized. Now let us go to the lab and open our simulator to run those examples to validate their logic and verify their proper operations.

Fig. 9: logic interlock example 2

Logical interlock using ladder logic

Let’s get to experimental work, now open your simulator, the first example as shown in fig. 10, there are two pumps. And we need to run one pump at every given time. So, no one of them will work when the other does. The ladder logic code shown in Fig.1, uses the contact of each pump’s coil to lock the other pump. For instance, if the first pump is running, that will open the path to prevent energizing the second pump’s coil when it is requested to run. Similarly, the first pump’s coil is hindered from running while the second pump is running. It looks smart but let us test and see if the logic we designed matches the real-time environment or there is an issue to solve!

Fig. 10: The first example ladder logic program

Simulation example 1

Well! Now we have started our simulation. Figure 11 shows the initial case when no pumps are requested to run. So you can see each pump is all set to run once being requested.

Fig. 11: the initial case when no pumps were requested

Figure 12 shows the case when we requested the first pump to run. Because the stop button is not raised and the second pump is not running; The first pump goes running as shown in figure 12. So the question is that what is going to happen when requesting pump 2 to run?! Let’s see

Fig. 12: starting the first pump

Fig. 13 shows the case when we request pump 2 to run by hitting its start push button “start-pump2”. As expected, the second pump does not run for the interlock condition we designed for by putting a contact of the first pump’s coil as a condition to run the other pump. So let’s remove the hindering condition of interlock by stopping pump 1 and trying to run pump 2 and see.

Fig. 13: requesting one pump to run when the other is running

Figure 14 shows what happens when we remove the interlock condition. By hitting the stop push button of the first pump “stop-pump1”, the first pump has stopped. Consequently, the second pump went running once the interlock conditions has been removed. So now simulation verifies our design and proves our code of interlock is working great. Well done!

Fig. 14: remove the interlock condition by stopping the first pump

Interlock ladder logic example 2

As we aforementioned section earlier, the interlock could be done by sensors state or reading, running and stopping statuses of other equipment, or logical devices like timers or counters as well. Timers and counters can be used as an interlocking technique for creating a running condition based on some delay or specific counting. Figure 15 shows one example of a timer-based interlock in which the pump won’t run by hitting the start button until the operator holds the start push-button pressed for 3 seconds then the pump goes running.

Fig. 15: timer-based interlock ladder logic example

Figure 16 shows the simulation of the second example. My friends, please notice, despite the start pushbutton having been hit by the operator; the pump does not start because it waits for the timer to count 3 seconds, and then it can run.

Fig. 16: pump wait timer to start

Now after 3 seconds of holding start push-button pressed, fig. 17 shows the pump goes running because the interlock condition is no longer there. I am very happy you would get that!

Fig. 17: pump start running after 3 seconds

What’s next?

My friends, before talking about what we are going to practice next time; I just want to express my appreciation that you patiently follow up till this point and hope your experience moves forward and gets more and more every lesson. Next time we will navigate the mathematical functions and how to perform mathematical computations in your ladder logic programming. my friends I really can’t wait to see you very soon to practice mathematics in ladder logic programming.

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir