Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 1: the bottle line project

Hello friends, we are going to learn and practice together one project from the industry. It is the bottle line production in which many processes are happening, including but not limited to filling, capping, and conveying from the start point where the bottles get in the line to the end point where the bottle gets out from the line. In the process, many concerns and restrictions must be addressed, like the bottle size, length, broken status, pretty full or empty, etc. So we have a lot to learn, program, and test right here in this project. Let’s jump into work and enjoy completing such an exciting project without further delay.

Bottle Line Assembly: Introduction

Figure 1 images the project we are going to do. Yes, it’s a massive project, with too many things we see to control. However, it’s not hard to be done because we grew up to be experts in ladder logic programming. Furthermore, we will apply the critical secret to make the large project easy, like a piece of cake that divide and conquer methodology. That can be happened by breaking down the whole project into small pieces and integrating these implement small pieces to have the entire process happen at the end of the day. Moving to the project itself, we can say we have two lines in the above line to describe the image shown below. The bottles are going to meet from left to right. The first sensor of proximity type sensor to check the presence of a bottle, and the next sensor of type limit switch to check the bottle size. The following sensor of type proximity is to check the excellent and broken bottles. Moving forward to the right, you can see guys at the filling station that can fill the small and large bottles. Then you will know the capping station. Also, we have a couple of motors being utilized to drive that project; the main engine in the first line, which is mounted at the left underneath the conveyor, moves the bottle forward from entry to the end. The second motor is mounted at the left of the second conveyor at the left that is used to move the output of the grinder of the broken bottles. The grinder motor on the following line properly grinds the broken bottle. The other engine installed at the third conveyor at the right is used to drive the final product conveyor. Also, you can see dozens of inputs and outputs, including sensors, switches, motors, valves, solenoids, and indicator lamps. The following section will list and describe these inputs and outputs in detail.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 1: the bottle line project

The inputs and outputs of the project

One of the most common and regular tasks you guys should do is tabulate the inputs and outputs in the project you develop. Table 1 below lists all the IOs in the project showing the names, addresses, and descriptions. I hope I have caught all of the IOs I listed in the table below; you can see, everyone, how important to have one table that lists all the inputs and outputs you need to use throughout the implementation process. The first step to start is to listen and write down the requirement and the philosophy of the logic of the process you will implement by listening to your client who requested that work from you. Feel free to ask them to confirm and validate the requirements once you have all requirements and narratives of the logic written down. You can go to the next step, designing the logic and breaking it down into small, simple parts. From there, you can start writing the ladder logic of each part and later integrate these parts to have the whole project done.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Table 1: list of inputs and outputs

Name

Address

Description

Start

I:1/1

Commence the process

stop

I:1/0

Stop the process

Selector switch

I:1/2

Mode A operation


I:1/3

Mode B operation


I:1/4

Mode C operation 

Enter

I:1/5

To enter the setting value

Small bottle BCD

O:2/11

The digital counter of the small bottles

Large bottle BCD

O:2/12

The digital counter of the large bottles

Scrap parts BCD

O:2/13

The digital counter of the scraps

Boxes BCD

O:2/14

The digital counter of the boxes

Scrap conveyor

O:2/1

The scrap conveyor driver

Divert conveyor

O:2/2

The divert conveyor driver

Ls10

I:1/15

Scrap Boxes limit switch 

Grinder

O:2/3

The grinder driver

Divert gate

O:2/5


Scrap gate

O:2/4


The Main conveyor

O:2/0


Ls1

I:1/6

Limit switch to see bottle presence

Ls2

I:1/7

Limit switch to see scraps

Ls3

I:1/9

Limit switch to determine bottle size

LS5

I:1/10

Large bottle fill

LS6

I:1/11

Small bottle fill

LS7

I:1/12

Capping limit switch

LS8

I:1/13

The limit switch to detect scraping ready position

LS9

I:1/14

The limit switch to detect readily divert

Fill tube 

O:2/6

The fill tube valve

Cap Ram

O:2/9

The cap Ram





Bottle Line Project: Requirements

Because we plan to divide the project into small, simple parts, we also will present the requirements in parts. 

Part 1: start and stop the process of saving the bottle states 

In the first part, we are required to start the process by energizing the main conveyor motor, hitting the start push button, and stopping the process whenever the operator presses the stop push button. In addition, we need to save the states of the processed bottles, including the present state by using the LS1 limit switch, the bottle state (broken or good) status by using the LS 2 limit switch, and the size state (large or small) giving a hint that we can use bit shift left instruction. This requirement looks simple but wait, it’s just the start and also optimistically all parts of the project can be that simple by dividing your project into parts remembering the divide and conquer rule. So let’s do the first part.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 2: Part 1 of the bottle line project

The logic of the first part of the project

Figure 3 shows the simple ladder logic code of that part. The first rung is commonly known to latch the run status and the main conveyor by hitting start. But stops when pressing stop. The third rung uses the presence limit switch to call three-bit shift left instructions. In the first, the value of the reading of LS1 for existing status is saved in the 32 bits of the addresses b3:4 and b3:5. Similarly, the second BSL is to save the broken and good states, which is the readings of the LS2 in the 32 bits of B3:6 and B3:7. And in likewise the third BSL instruction saves the readings of the LS3 which is the size state of the bottles in the 32 bits in B3:8 and B3:9. Let’s simulate and show you guys how that works and what is the benefit of using BSL instruction?

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 3: the ladder logic of the first part

The simulation and testing of part 1

Figure 4 shows the output of the execution of the part 1 simulation. You can notice, my friends, that the data files of the 32 bits in B3:4-B3:5 reflect the status of a bottle to LS1, and they are always 1’s because all bottles, regardless of the status, size, and case of the bottles. They are always there and seen by the sensor. For sensor LS2, it is a different story, as shown by the B3:6 and B3:7; the broken bottles show 1’s while the good ones show 0’s. Same for the LS3 that tells the size, the saved data in B3:8 and B3:9 shows when it is a large bottle by 1’s and small bottles by having the value 0’s. So you notice, my friends, we have completed the requirements of the first part, which seems simple, but it is essential because we now have the status of the bottles’ states, including presence, size, and excellent or broken bottles. We can now use the saved data to process the following requirements. So let’s do another part of the project.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 4: the output of simulating part 1

Project part 2: Ladder Logic Program

This part of the project requires you guys to divert the long or large bottle to the diverter place on the right. Now it is time to use the data you saved in the first part of the project. Because you have the size of all incoming bottles, you can test the appropriate bit and command the solenoid to extend to open the divert gate when the bit is high. But wait a minute, which bit of the saved 32 bits do we need to do the test and decide? That’s such a brilliant question. Well, we need to count up from the position of the sensor LS2 that tells the bottle size until the point where the diverter is installed. By counting, we can see 20 bottles between the two positions. So if the data is located in B3:6 and B3:7, the bit we are looking for to use in testing is B3:7/4. So let’s try to see if that is correct or if we need to amend and correct that initial thinking that we thought.

Project part 2 

Figure 5 shows the minor modification we have added to fulfill what is requested in part 2. You can see, everyone, we have just added only one rung, which is the third one that says when the bit b3:7/4 is on, that means there is a bottle of an extended size that needs to be diverted. Therefore, the diverter solenoid is energized for that purpose. Ohh! We forgot to consider that we need to move the diverter converter to avoid the possible crash when another bottle comes over the previously processed one.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 5: logic of part 2

So when do we need to command the diverter conveyor motor to run for moving the conveyor? The answer is shown in figure 6; as you can notice, for everyone in rung number 4, It is a good idea to use the last bit, which offers a large bottle to move the conveyor to empty a slote to the incoming bottle. Therefore, we added one more rung to command the diverter conveyor motor when the last large-size bottle is presented. So now Let’s see the result of running this logic.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 6:corrected logic of part 3

Simulation of part 2

Figure 7 depicts the results of testing the logic we have written so far up to part 2 of this exciting project. You notice how successfully the long-size bottles are rowed side by side. Yes, you can see the broken bottles are also included, which could be better, and that is what we will do in the next part. So let’s continue completing our project.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 7: Simulation of part 2

Project part 3

Now everyone, let’s move to a little bit harder part in which you must manage the scrap by activating the solenoid of the scrap gate to open when there is a broken bottle. Also we need to count the processed bottles, including small and good, large and sound, and scrap bottles. I know this time we asked many things to do but believe me, as you divide your projects into parts, as we do, it will be easy tasks. So now let’s see how to do the requirements for this part. Figure 8 shows the ladder; logic rungs for part 3. You can see guys in rung number 4 that we energized the gate when the bit b3:8/8 is ON. Why the eighth bit? Because the number of bottles between the sensor LS2 that detects broken bottles and the gate mounting point is eight bottles. The other four counting rungs from 5 to 8 are for measuring the small valid bottles, the large size bottles, and scraping bottles correspondingly. And at last, we summed the small and large broken bottles to get the total scrapped bottles. So let’s do one test for the code so far.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 8: the ladder logic code of part 3

Simulation of part 3

Figure 9 shows the broken bottle has been diverted through the scraping gate, the large size redirected to the diverting gate, and the small valid bottles go onto the upper conveyor.

Bottle Line Assembly using PLC Ladder Logic Programming, PLC Ladder Logic bottle line, bottle capping with ladder logic, bottle filling with plc,
Figure 9: testing of the diverting of broken bottles, small and large size valid bottles

What’s next???

As you have seen in this tutorial, many tasks exist. We already have done a lot but still, have much to do together in this project. So following the tutorial, we will complete the filling bottle station and the capping station to deliver a complete project and production line. So be there and see you in the following tutorial very soon.