Hello everyone, and welcome back with a new tutorial in our ladder logic programming. Today we will continue the bottle line production line using ladder logic programming. Let me remind you, everyone; we have seen how to utilize the bit shift left instruction BSL to save the data that describes the state of a bottle, including the present state, size state, either large or small size and the excellent and broken state as well. And also we utilized these states to energize the large bottle and scrap solenoid to divert the bottles to the appropriate position and conveyor. At the end of the day, we have separated small, large, and scrap bottles. Today we are going to manage the scraping of the broken bottle.
In each bottle line process, we have a common and critical problem with removing and eliminating the scraping of broken bottles. Figure 1 shows that on the main conveyor, there are broken bottles. We need to prevent them from processing and take them out to be ground and removed. We have a conveyor on the second row on the left for this mission. For what? For collecting the output of the grinder in boxes, as you can see on the conveyor, take them out of the line. That outlines what we need to do, but how about the details? Follow up, and you will get to know.
In this project, we need to pick the broken bottles, diver them to the grinder, and take the scrap through the conveyor out of the process. Many subtasks we need to do, like deciding on the broken bottles and classifying them into large and small for the size of the scrap boxes, given that the large bottles are 2/3 and the small bottles are 1/3. Also, one sub-task activates the scrap driver solenoid on time when there is a broken bottle. Also, the grinder needs to run all the time. And we are counting the broken and good bottles by classifying the size of the bottles. We have been requested to do this task to avoid the scenario of unmanaged scraping, as shown in figure 2.
Table 1 lists the IOs of the process, including the name, addresses, and descriptions. These are not all the IOs in the project. We will use these most important parts to develop the scrap management process.
- |
Addresses |
Description |
Scraping gate |
O:2/4 |
Solenoid to control the scraping gate |
The Grinder |
O:2/3 |
The grinder motor for grinding the broken bottles |
Box sensor LS10 |
I:1/15 |
The limit switch to detect the boxes edges |
Scrap conveyor |
O:2/1 |
The conveyor motor of the scrap |
Selector switch A |
I:1/2 |
To select and control the counters display (small bottle) |
Selector switch B |
I:1/3 |
To select and control the counters display (large bottle) |
Selector switch C |
I:1/4 |
To select and control the counters display (scarp) |
Screen BCD |
O:4 |
The screen BCD output |
Screen small bottles control |
O:2/11 |
The output to control the small bottle display |
Screen large bottles control |
O:2/12 |
The output to control the large bottle display |
Screen scrap bottles control |
O:2/13 |
The output to control the scrap bottle display |
Screen boxes control |
O:2/14 |
The output to control the boxes display |
Because the logic is extended, we will present it piece by piece. Figure 3 shows the first piece of the scraping removal process. Describe this to you, my friends; the first rung runs the large bottle size diverter solenoid by sensing a presence of a large size bottle thank to using the match bit of the 32 bits of the saved register B3:6 and B3:7. Similarly, rung 3 energizes the large bottle conveyor to give space for the next bottle and prevents the crash from happening. The third rung is not that different; it runs the broken bottle diverter thanks to the saved broken bottles in 32 bits of b3:8 and b3:9. Then counter of type count up is used to count the large, the small broken bottles, and the large broken bottles.
Figure 4 shows the second portion of the ladder logic program of the scrap management process; you can see, everyone, in rung number 9, the multiply instruction is used to calculate the 2/3 and the 1/3 portion of the large and small bottles. And at the end, we use add instructions to get the sum of the total scrap. For the logic sequence, let us jump just a moment to rung number 11, which checks the sum we have obtained in tinged nine that represents the whole amount of scrap, including the small and the large bottles—testing using the LIM instruction to see if it is between the limit of the capacity of the box. If it is within the boundary of total capacity, the box should move by commanding the scrap conveyor. Backing to rung number 10, it is when the box reaches the limit switch position that the counter is reset to start over the scraping cycles. Counter reset includes the large and small size bottle counters.
After completing the requested logic, we will check it, as shown in figure 5. This screen capture of the run process is brilliant because it shows all the subtasks we need to do in this project. First, you guys can see one of the broken bottles goes to the grinder once it has reached the correct position. Also, you can see the small bottles going on the main conveyor and the large bottles going over the large bottles conveyor. Also, the most important thing you can notice is the filled boxes on the scrap conveyor in the second row and on the left. You can see boxes are being filled and moved through the scrap conveyor. The boxes are not equally filled because the limit we set is composed of 2/3rd of the large bottles and 1/3rd of the small bottles when we need to know how many of each we might have each time. We can continue tuning the limit in the code until reaching the most utilization of the box size.
Figure 6 shows how using the scrap boxes happens by adapting the limits in the LIM instructions.
The last part we need to do to complete the scrap management is to display the counters on the displays we have. We need to display the small, large, and scrap counters on the screens on the bottom right part of the project screen. Figure 7 shows the piece of code of our ladder logic program that does that logic. It is just moving the counters’ accumulators to the BCd outputs based on the output control bits controlled by the selector switch's inputs. For example, to display the small bottles processed so far, we energize the output O:2/11 when the selector switch is at position A and then use that output to invoke the MOV instruction to move the values from the small bottles counter accumulator to the screen output O:4. Same scenario to manage all the screens for the large bottles, and scrap bottles counters.
Figure 8 shows how successful the counter’s accumulators have been displayed on the BCD screens thanks to the last piece of code of the ladder logic program we discussed.
Thanks so much, my friends, for following up on the end of this tutorial, in which we have covered a good part of the bottle line project. That part was about getting rid of the scrap and classifying the bottle based on size, small and large. Also, we have shown how to display small, large, and scrap counters on the BCD screens. Next time we will complete a critical part of that project: filling and capping the bottles by completing the code that manages the capping station and filling station. So please be there, and I hope to see you soon with our incoming ladder logic programming series tutorial.
Hi, my friends, and welcome back to enjoying together learning and practicing PLC ladder logic programming with a new project from the actual industry. Today my friends, we will continue the bottle line project to complete the capping and filling of the bottling line. As usual, we will describe the requirements as the clients ask us to do. Then we list all the inputs and outputs we will use to make our design work. Afterward, we write the ladder logic program into two sub-tasks. We make one to perform the filling and the second for the capping process. So, without further delay, buddies, let’s jump into the work.
Let me introduce the project as two processes we have been requested to implement here. We are filling bottle process in which we need to control the filling station that has two supplying sources to fill the small bottles and the large-size bottles with two different liquids. Figure 1 shows the filling station that offers two sources of liquids: the orange-coloured liquid for the large-size bottles and the violet-coloured liquid to fill the small bottles. So we need to identify the type of bottle that comes to the filling station—then, based on knowing which bottle type, we need to open the valve of the appropriate filling tube. Remember to stop the main conveyor while the filing process is in progress. Once the filling has been done, we need to resume the movement of the main conveyor.
Moving on to the capping station, figure 2 shows the capping station that is nothing but a cylinder to let the cap released to the bottle that reaches the capping station. Now you can see my friends, inputs and outputs are listed and named on the filling and capping station. We need to list these inputs and outputs and see how we can employ them to complete our project. Please note, buddies, the recorded inputs and outputs in table 1 are not all project IOs. They are only the IOs belonging to the filling and capping process. So you can add these IOs to the list of IOs we have previously introduced in the last two tutorials.
Table 1 tabulates the list of IOs of the project, including names, addresses, and descriptions. As you can see, everyone, all information, including the item name, addresses, and description of the filling station, are in the table below and ready for your turn to use them in the logic of the program you will write.
Item name |
Address |
Description |
LS1 filling |
I:1/9 |
This level switch tells if the bottle is filled or not. |
Filling actuator solenoid SOL1 |
O:2/6 |
The filling valve actuator |
valve1 |
O:2/7 |
Purple liquid tube valve actuator |
Valve2 |
O:2/8 |
orange liquid tube valve actuator |
LS 2 |
I:1/10 |
Sensor to detect the filling position of the orange-coloured liquid for the large-size bottles |
LS 3 |
I:1/11 |
Sensor to detect the fill position of the purple for the small size position |
Similarly, table 2 lists the inputs and outputs that could be used throughout your program to achieve the requirements that your client has requested. Now, folks, our clock says the time to design and code the ladder logic program of the capping and filling system. so let’s go nailing the two processes.
IO name |
Address |
Description |
LS3 |
I:1/12 |
The position sensor of the cylinder actuator of the capping station |
Capping Actuator solenoid SOL2 |
O:2/9 |
The solenoid for actuating the cap pusher in the capping station |
Remember that we already have the status and all information about the incoming bottles saved in data files from the last two tutorials named bottle project. So you can stop by these previous two tutorials to feed your memory we the information you are going to use here. Now, we need to decide which bit to use to control the filling tube and valves and manage the filling station. Yes, by noticing the filling scenario depicted in figure 3, you can see, everyone, all that we need is the bit at the filling actuators and the bottle size. So let’s clarify by discussing the ladder logic code we wrote for the filling process.
Figure 4 shows the few ranges that implement the task of controlling the bottle filling. In the first rung, we added all the conditions at which the main conveyor should stop as a normally closed contact to stop the conveyor from moving while capping, filling, and processing. In the following range, we use the existence bit to ensure there is a bottle to fill and not broken and one-shot instruction to fire the extend the cylinder of the filling actuator. And the following two lines, we activate the large-size bottle valve when the bottle we fill is large or start the one for filling the small-size bottles. And finally, we complete the process by returning the piston of the filling actuator once the bottle, either the small or the large, is filled.
As you can see, the filling ladder logic code that we wrote can manage the filling for both bottle sizes, the small with the violet-coloured liquid and the large with the orange-coloured liquid. By identifying the correct position of the bottle at the filling actuator and the right size, the code opens the correct valve to fill with the appropriate liquid for each bottle type. Now, it’s the turn to handle the capping station work. So let’s go doing it; it’s pretty easy!
Similarly, we need to identify the correct bit at the capping station and check that it exists, is filled, and is not broken. Thereby we can command the capping actuator to do capping the bottles. Figure 6 shows the simple ladder logic code that handles the capping process. SiIts checked that the bottle was there and not broken. Afterward, it uses one-shot instruction to fire the capper actuator. And the following range unlatches the capper actuators once it has reached its target, thanks to the extended limit switch. Now let’s check the correctness of the code we just wrote.
Figure 7 shows the results of successfully running the whole process filling and capping process. You can see my friends when bottles come to the filling actuator; they are filled with the appropriate liquid based on the bottle size. When they reach the exact position where the capper is mounted, the capper actuator is activated to process the capping successfully.
I’d love to say thank you, my friend, so much for following up with me and my tutorial up to that moment. I hope you have learnt something that increases your knowledge of ladder logic programming and that you have enjoyed practicing one project from the entire industry. We do nothing but bring what we have done in our practical life in industry in the form of tutorials and simulations to take you close to what is going on in the factory every single day for you become familiar with whatever you will see in your future work. For what is incoming? Without question, I will bring a new project from the factory and enjoy learning and practicing together. So stay safe and be ready to meet very soon.