We will now look at ink mixing and bottling PLC programming. EasyPLC software suite has a feature called Machine Simulator (MS) that comprises several machines that can be programmed, or you can design your own. One such machine is the ink mixer, which is used to mix different inks using the red, green, and blue master colors. Bottles are filled from the mixing tank, and this mixing machine allows us to create recipes in the PLC to select the mixed ingredients for the desired color. These recipes can be programmed into the PLC to set the number of bottles to be filled, along with the recipe selection. The PLC will enable remote adjustment of these settings in the future. We will use the Do-More Designer PLC Simulator to program the virtual machine, an effective tool for programming and simulating the ink mixer machine. With this software, we can create and test a range of recipes that can be used for mixing inks, making it a versatile and efficient tool for various ink mixing and bottling applications.
Using the Do-More Designer PLC software, we will connect the simulator to the ink mixing machine. This will be done using Modbus TCP (Ethernet) for communications. We will then show how this is programmed using the five steps for program development. Let’s get started.
Learn PLC programming the easy way. See below for a 10% discount on this cost-effective learning tool. Invest in yourself today.
Previously, we have done the following:
Easy PLC Installing the Software – Video
EasyPLC Software Suite – Quick Start – Video
Click PLC – Easy Transfer Line Programming – Video
Productivity PLC Simulator – Chain Conveyor MS – Video
Do-More PLC – EasyPLC Box Selection Program – Video
Click PLC EasyPLC Gantry Simulator – Video
Click PLC Simple Conveyor EasyPLC – Video
EasyPLC Paint Line Bit Shift – BRX Do-More PLC – Video
Click PLC – EasyPLC PLC Mixer Programming – Video
Click PLC EasyPLC Warehouse Stacker Example – Video
– Operation Video
EasyPLC Machine Simulator Productivity PLC Robotic Cell – Video
EasyPLC Simulator Robotic Cell Click PLC – Video
Palletizing Conveyor Programming Do-More PLC – Video
Palletizing Conveyor Programming – Click PLC – Video
Product Quality Verification! Do-More PLC Sequencer – Video
Revolutionize Learning PLCs with Pallet 3D Sim! – Video
Robot Packing PLC Program Development – Video
Box Dumper Easily Learn PLC Programming – Video
Define the task: (Step 1 – Ink Mixing PLC Learning)
To define the task for programming the ink-mixing PLC, the first step is to understand what needs to be done. Launch the EasyPLC Machine Simulator (MS) and access the “Machines” menu. Select the “16 Ink Mixer” option from all the pre-configured machines. This will be the machine that we will program. On the left side of the screen, you will find information on how the ink mixing machine should function.
This task aims to manage the three color ink tanks (red, green, and blue) to mix in the mixing tank. Fill the cans (bottles) using the transport and filling system. You can experiment with ink quantity levels to achieve your desired final color. Additionally, we will set up recipes in the PLC to determine the amount of ink from each color for each bottle. The number of bottles required for the order will determine the volume in the mixing tank. By understanding the functionality of the ink mixer and how it interacts with the transport line system, you can effectively program the PLC to control its operation.
To familiarize ourselves with the operation of the ink mixer, we can utilize the built-in demo mode. This demonstration mode provides a visual demonstration of how the ink mixer functions.
Take some time to explore the 3D virtual environment using the navigation icons at the top of the window. The default selection allows you to move freely without colliding with any components, while the first-person and third-person modes provide different perspectives.
By exploring the demo mode, you can better understand how the ink mixer operates and how it fits into the overall system. This will help you develop the PLC program to effectively control the ink mixer machine’s actions.
Once we understand the task and have familiarized ourselves with the ink mixer operation, we can proceed to the next step in developing the Do-More PLC program. By following these steps and gaining hands-on experience with the EasyPLC learning suite and the do-more simulator, you will be well on your way to mastering PLC programming and applying your knowledge to real-world scenarios. So, let’s continue our journey and move on to the next step in the process.
Define the Inputs and Outputs: (Step 2 – Ink Mixing PLC Learning)
Defining the inputs and outputs is crucial to effectively programming the ink mixer PLC. Inputs are signals or data received by the PLC, while outputs are signals or data sent by the PLC to control external devices. By understanding the inputs and outputs, you can develop a program that reads the status of the inputs and activates the appropriate outputs.
While still in demo mode, select View IO to display the inputs and outputs required for this machine. This PLC programming example will require 14 digital outputs and four digital inputs. The mixing tank level and flow will also require two analog inputs. These PLC IOs are for the machine’s physical running and do not include additional registers or bits required for recipes or programming.
In the case of the Ink Mixer PLC, the inputs include the status of the photocells on the conveyor for positioning the bottles to fill. These inputs will determine when the ink should start filling the bottles. The outputs include signals to control the ink valves in the mixing tank and the mixing tank in the bottles. They will also control the up-and-down motion of the bottle-fill device.
If you are unsure what output or input is doing, start the Ink Mixer machine in Start mode. Select View IO at the bottom of the ink mixing machine simulator window.
You can manually run the ink mixer without any control or PLC connection. Select the outputs on the left to turn on, and monitor the inputs on the right.
Defining the inputs and outputs establishes the communication between the PLC and the external devices. This allows the PLC program to monitor the inputs and continuously decide based on their status. The program can then activate the appropriate outputs to control the ink mixing operation.
The machine simulator will communicate with a do-more designer PLC simulator using Modbus TCP (Ethernet).
The Do-More Series of PLCs uses a fixed Modbus memory area. This area can be seen in the following chart.
The following table will define the inputs and outputs (IO) and Modbus addresses in the Do-More PLC we will use for this program. (Ink Mixing)
Digital Type | Description | Productivity Modbus Address | Machine Simulator Modbus Address |
PLC Output – MS Input | Red Tank Input Valve | 10001 – MI1 | 0 |
PLC Output – MS Input | Red Tank Output Valve | 10002 – MI2 | 1 |
PLC Output – MS Input | Green Tank Input Valve | 10003 – MI3 | 2 |
PLC Output – MS Input | Green Tank Output Valve | 10004 – MI4 | 3 |
PLC Output – MS Input | Blue Tank Input Valve | 10005 – MI5 | 4 |
PLC Output – MS Input | Blue Tank Output Valve | 10006 – MI6 | 5 |
PLC Output – MS Input | Mixing Tank Input | 10007 – MI7 | 6 |
PLC Output – MS Input | Mixing Tank Output | 10008 – MI8 | 7 |
PLC Output – MS Input | Propeller Sound (Mixer) | 10009 – MI9 | 8 |
PLC Output – MS Input | WorkPartCreator – Bottle and Conveyor Movement | 10010 – MI10 | 9 |
PLC Output – MS Input | Motor Move Down (Fill valve) | 10011 – MI11 | 10 |
PLC Output – MS Input | Motor Move Up (Fill valve) | 10012 – MI12 | 11 |
PLC Output – MS Input | Conveyor Slow | 10013 – MI13 | 12 |
PLC Output – MS Input | Bottle Fill Output | 10014 – MI14 | 13 |
PLC Input – MS Output | Filler Down Position | 1 – MC1 | 0 |
PLC Input – MS Output | Filler Up Position | 2 – MC2 | 1 |
PLC Input – MS Output | PhotoCell 1 Signal | 3 – MC3 | 2 |
PLC Input – MS Output | PhotoCell 2 Signal | 4 – MC4 | 3 |
Analog PLC Input – MS Output | Mixing Tank Ink Level | 40011 – MHR11 | 10 |
Analog PLC Input – MS Output | Flow Rate Indication | 40012 – MHR12 | 11 |
Note: The machine simulator will be offset by one for the Modbus Addresses. See the video below for the demo mode and determining inputs and outputs.
It is important to note that PLC programs operate cyclically, meaning they continuously read the inputs and set the outputs. This ensures that the program is responsive to system changes and can adapt accordingly. By understanding the inputs and outputs and their relationship to the overall system, you can develop a logical sequence of operation for the ink mixer PLC program.
Develop a logical sequence of operation (Step 3 – Ink Mixing PLC Learning)
Developing a logical sequence of operations is crucial in programming the Ink Mixing PLC. To ensure a smooth and efficient operation, it is important to create a flow chart, sequence table, or detailed information that thoroughly outlines the process that needs to be controlled. This will help answer important questions about what happens during a power or pneumatic air loss or if any input/output devices fail. Additionally, it is essential to determine if redundancy is necessary.
By understanding all aspects of the operation upfront, you can save a lot of work and prevent the need to rewrite the PLC program logic continuously. As a PLC programmer, it is vital to have a comprehensive understanding of the sequence and operation of the machine before starting the programming process. This can be achieved by asking questions or reviewing existing documentation to ensure a clear understanding of the logical steps involved.
Our system has three output valves that control ink flow into the mixing tank. The tank has a volume indication analog signal that will be used to determine the amount of each of the red, green, and blue inks to mix, which will determine the color of the ink.
When the work part creator is turned on, bottles move along the conveyor line until the first and second photocells detect them. This stops the work part creator. To achieve a more accurate stop location for the bottle, the conveyor’s slow output is turned on when the first photocell is seen and turned off when the second photocell detects the bottle.
The PLC will store recipes for each color that we want to make. We will store these in the V memory retentive area of the PLC starting at V100. Each recipe will have five registers. Recipes will include the amount of red, green, and blue ink required for each bottle to be filled. In our case, this will add up to the value of 100.
Example: If we want 20% red, 50% green, 30% blue, and mix for 3 seconds, here are the settings for the first recipe.
V100 = 20
V101 = 50
V102 = 30
V103 = 3000 (Expressed as milliseconds for the mixing.)
We will use address MHR100 for the recipe number and MHR101 for the number of bottles to fill.
The mixing tank can only measure the current volume, so we will add the ink levels individually until we have the total amount required for the recipe. Internal registers will determine the amount to continue adding to the mixing tank.
Example for recipe one:
Red volume is 20 times the number of bottles.
The green volume is 50 times the number of bottles plus the red volume.
Blue volume is 30 times the number of bottles plus the green volume.
We now know the volume of each tank to add to the mixing tank for the correct color. Once all the colors are in the mixing tank, the mixer will turn on for the time in the recipe. The bottles can now be filled.
The filler will move down to the filling position when filling the bottles. The volume of the mixing tank minus the value of 100 (full bottle) will be the target for the volume when the bottle is filled with ink. Once the bottle is filled, the filler will move up, and the full bottle will move down the conveyor line. This will make room for the next empty bottle to be filled.
If the mixing tank is less than 100, the number of filled bottles has been accomplished. The mixing tank will then need to be cleaned and purged. We will clean the mixing tank by turning on the output and ensuring the volume reaches zero. We will then turn the mixing tank output off and turn the mixing tank input on. Once the volume reaches 1000, we will turn off the mixing tank input and energize the output. Once the mixing tank volume returns to zero, the purge is over. The mixing tank bottom turns white to indicate we are ready for the next recipe and bottle number selection.
By developing a logical sequence of operation, you can create a PLC program that effectively controls the ink mixing PLC and ensures its smooth and reliable functioning. This step sets the foundation for the subsequent development of the Do-More PLC program, which will be covered in the next section.
Develop the Do-More PLC program (Step 4 – Ink Mixing PLC Learning)
Developing the Do-More PLC program is the next step in learning how to program the Ink Mixer. This step involves taking the logical sequence of operations developed in the previous section and translating it into a program the PLC can execute.
It is important to understand the programming language used by the PLC. The Do-More PLC uses ladder logic, a graphical programming language that represents the control logic in a series of rungs. Each rung comprises inputs, outputs, and logic functions that determine the system’s behavior.
You can start building the ladder logic program by using the logical sequence of operations as a guide. Start the free Do-More Designer software. Select the new icon on the main page to start a new project. We will name this project and select OK.
Select documentation editor from the main menu | tools. We will map the inputs and outputs of the Box Dumper to the corresponding addresses in the PLC.
This first section of the program will handle the recipes for the ink mixing. Rung 1 will calculate the pointer for the recipe and the parameters to run the recipe mixture. If the selected recipe is greater than 0, the amount of bottles to fill is greater than 0, not ready to fill, not mixing the recipe, not cleaning mixing, and not purging mixing, the program will calculate the parameters. A math instruction calculates the recipe pointer and puts it in register V50. 1 is subtracted from the recipe number and then multiplied by 5. 100 is then added to get the final recipe location. This is because the recipes have five registers starting at address V100. The second math instruction will calculate the amount of red ink required. The recipe pointer points to the first address, the red ink amount per bottle. This is multiplied by the number of bottles to fill and put in register V60. The third math instruction will take the red ink requirement, plus the green ink requirement. (Recipe pointer + 1, times the number of bottles to fill). This is placed in register V61. Register V62 will contain the red, green, and blue ink. (Recipe pointer +2, times the number of bottles to fill.)
The mixing time in milliseconds is placed in register V63. This is obtained by the recipe pointer + 3. The mixing recipe bit is set, and the start purge bit is reset. The original recipe number in MHR100 is set back to 0 to indicate that the recipe and bottles are now being made.
Rung 2 will control when we finish filling the recipe bottles. If we are ready to fill and the tank mixing level is below the one-bottle mark, or the clean mixing bit is on, and the filler is up, we will reset the ready-to-fill bit and set the tank mix output. This will drain the mixing tank.
Rung 3 will set the purge mixing tank when the leading edge of the start purge bit goes from off to on.
Rung 4 will set the clean mixing and start purging for the mixing tank. If the mixing tank drains from the tank mix output and the tank mix level is zero, we start a timer for 3 seconds to ensure that the tank is empty. The clean mixing and start purge bits will be set on the leading edge of this timer output contact. We will also reset the ready-to-fill bit, and if the bit for clean mixing is not set, we will also reset the tank mix output to stop the draining. These bits will also be set when the first scan from the PLC is activated.
Rung 5 will reset the clean mixing and tank mix output and zero the pointer (V50) location for the values just completed for the recipe and bottles. This is done when the clean mixer timer is complete, and the tank mix level is zero.
When the mixing tank is ready to fill, we will turn on the red, green, and blue input tank vales to fill the supply tanks up again. This way, they are always full and ready to mix our next recipe.
Rung 7 will control the mixing of the ink in the mixing tank. If the mixing recipe bit is on, the clean, purge mixing tank bits are off, and the tank mixing level is less than or equal to V60, the tank red output is turned on. This adds the red ink required for the bottles in the mixing tank. When the red tank output is off, and the mixing tank is less than or equal to V61, the green tank output turns on. This adds the green ink required for the bottles in the mixing tank. The blue output turns on when the red and green outputs are off, and the mixing tank is less than or equal to V62. When all three ink tank outputs are off, a timer and the mixer are started. When the timer completes, the mixing recipe bit resets, and the ready-to-fill bit sets. We can now fill the bottles with the ink.
Rung 8 will control the purge cycle. When the purge mixing is on and not the clean mixing bit, the mixing tank input turns on if the tank level is less than or equal to 1000. If the tank level exceeds 1000, the clean mixing bit is set, and the purge mixing bit is reset. The purge cycle consists of emptying the mixing tank, turning on the tank input until it reaches a 1000 level, and then emptying it again.
This next section will control the conveyor and bottle filling. Rung 9 will control the work part creator. This places empty bottles to fill on the conveyor. If the bottle is not filled, we do not see photocell two, and the filler is in the up position, we will turn on the work part creator. If the bottle is full, we look for the filler-up position to turn on the work part creator.
Rung 10 will control the conveyor’s slow output. This will position the bottle for filling. If photocell one is on and photocell 2 is not on, and the filler is in the opposition, we will turn on the conveyor slowly.
Rung 11 controls the motor down. When the ready-to-fill is on, the bottle is not full, and we have sensor photocells one and two and the filler is in the up opposition, so we send it down.
When the filler is not in the up position, and we have the leading edge of the filler down position, we will reset the move down a bit and the motor up bit.
Rung 13, on the leading edge of the down position bit, we will move the mixing tank level into a work area. We will then subtract 100 from this work bit area. This is the amount for a full bottle. The calculated reference value is for the level in the mixing tank after the bottle is full.
Rung 14 will control the filling of the plastic bottles. When the ready-to-fill bit is on and the filler is in the down position, we will fill the bottle. When the mixer level is not greater than or equal to our calculated value, we turn off the plastic bottle filler.
When the mixing tank is less than or equal to our fill volume, and we have the ready-to-fill bit, we will set the bottle fill and the move-up bit for the filler.
The bottle fell reset will happen when we have the bottle fill bit on; we do not have photocell number 2, and the filler is in the up position.
This is the end of our ladder logic for the Box Dumper. An END statement will indicate that this is where the program ends and to repeat the scan. Save your program. It is important always to save your program during programming.
Select the Do-more/Sim icon. This will start the PLC simulator. The Do-More Designer simulator will run independently of the Do-More Designer programming software. When returning to the Do-More designer software, you will see we are connected to the simulator by the menu icons and the status bar at the bottom of the window.
Select the Write PLC icon. This will transfer our program to the PLC simulator.
The Mode icon on the main menu will allow you to change the PLC mode from program to run. It also shows the PLC switch position. Select the run mode for the PLC. The Do-more PLC simulator will have a switch position that can also change to control the mode of the PLC.
Select System Configuration under the tools menu of the project browser. This will display the System Configuration window. Under Internal Ethernet Port Configuration, you will see the IP address for the PLC simulator. Besides this selection, there is also the Modbus/TCP Server Configuration. Ensure that this is enabled. This PLC simulator will act as a Modbus TCP Server to the EasyPLC Modbus TCP Client. A Modbus client will send requests, and the Modbus server will respond. Make a note of the IP address. We will need this to set up our Modbus Client in the next step.
Watch the video below to see how this is programmed in ladder logic.
By following a systematic approach and referring to the logical sequence of operation, you can develop a robust and efficient Do-More PLC program for the Ink Mixer. This program will serve as the machine’s brain, controlling its movements and ensuring its safe and reliable operation.
Test the PLC program: (Step 5 – Ink Mixing PLC Learning)
To ensure the functionality and accuracy of the Do-More PLC program for the Ink Mixer, it is essential to test the program thoroughly. Utilizing a Machine Simulator (MS) is an effective way to do this. Using the MS, you can simulate the operation of the Ink Mixer without needing physical hardware, minimizing the risk of damage during the testing phase.
We will use Modbus TCP on our Do-More PLC simulator to communicate with the EasyPLC Machine Simulator. Call up the ink mixer machine simulator in start mode.
The status of the machine simulator will be at the bottom of the screen. Currently, we have no PLC connected. Select IO Drivers on the bottom middle of the screen.
The machine simulator IO number will be displayed. Ensure we select more IO than the number required for our ink mixing machine. The EasyPLC driver is selected by default.
Under the driver pull-down menu, select “ModBusDriver.” This driver will communicate Modbus TCP (Ethernet) and Modbus RTU (Serial).
Select the configure button.
We can now enter the information for our Modbus driver. Select TCP/IP. This means the Ethernet port on the computer will communicate with the Do-more PLC simulator. The digital inputs from MS to the Do-More PLC will be MI1 to MI14. This will start at address 0 due to the offset of 1. Digital outputs from MS to the Do-More PLC will be MC1 to MC4. This will begin at address 0 due to the offset of 1. Analog outputs from MS to the Do-More PLC will be MHR11 and MHR12. This will begin at address ten due to the offset of 1. Select the OK button.
You will now see the inputs and outputs specified for the Modbus driver. We can now manually assign the driver outputs to the PLC inputs and driver inputs to the PLC outputs. However, the automatic assignment works well and will save you time.
Select Automatic Assignment from the driver option in the main menu.
This will automatically assign the PLC simulator IO to the Machine Simulator IO. Select Start Driver and exit from the main menu.
On the bottom left side of the window, the driver communicates with the Do-More PLC simulator with a green light. Select view IO to see the machine simulator’s input and output status.
Ensure that the Do-More PLC is in run mode. We can see the operation of our ink mixing machine. The inputs and outputs of the MS will correspond to the PLC controller.
Using the Data View window of the Do-More Designer programming software, we can also watch the inputs and output operations. To start the simulation, we must ensure that recipes are programmed into the V memory locations starting at V100.
Please enter the number of bottles that we want to fill in MHR101. Now, enter the recipe number in MHR100. We can now watch the ink mixed and the correct number of bottles filled. At the end of the filling, the purge will happen, allowing the next recipe to be activated.
Using Machine Simulator (MS) to test the program will ensure that our program works. Troubleshooting is quickly done without damage to any physical hardware.
This testing phase is crucial in ensuring the safe and reliable operation of the Ink Mixer, providing peace of mind and minimizing downtime.
You can practice your modification and debug by modifying the ink mixing operation in the following way:
– Add a recipe and bottle number thumbwheel input on the control panel. This should include a button to write the values.
– Add start, stop, and purge buttons to the control panel. This will allow an operator to stop and reset during the operation.
– Calculate the rate of bottles filled for this machine in number per hour.
Let me know how you make out in the comments below.
Download the PLC sample program here.
Watch the video below to see the five steps of program development applied to the ink mixing machine. The machine simulator is one of the best applications for learning PLC programming.
EasyPLC Software Suite is a complete PLC, HMI, and Machine Simulator Software package. This PLC learning package includes the following:
Easy PLC – PLC Simulation allows programming in Ladder, Grafcet, Logic Blocks, or Script.
HMI System – Easily create a visual human-machine interface (HMI)
Machine Simulator – A virtual 3D world with real-time graphics and physical properties. PLC programs can be tested using EasyPLC or through other interfaces. (Modbus RTU, TCP, etc.)
Machine Simulator Lite – Designed to run on Android Devices.
Machine Simulator VR – Virtual Reality comes to life so you can test, train, or practice your PLC programming.
Purchase your copy of this learning package for less than USD 95 for a single computer install or less than USD 110 to allow different computers.
Receive 10% off the price by typing in ACC in the comment section when you order. http://www.nirtec.com/index.php/purchase-price/
Learn PLC programming the easy way. Invest in yourself today.
Watch on YouTube: Innovative Solution for Mixing Ink and Bottling
If you have any questions or need further information, don’t hesitate to contact me.
Thank you,
Garry
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLCs are not challenging to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimals, Hexadecimal, ASCII, and Floating Points.
To get this free article, subscribe to my free email newsletter.
Use the information to inform other people how numbering systems work. Sign up now.
The ‘Robust Data Logging for Free’ eBook is also available for free download. The link is included when you subscribe to ACC Automation.