In PLC programming, there are many cases when we require multiple outputs to work based on priority. We do not want all the outputs to work; only that will work for those who have higher priority. This ensures efficient and equal runtime of all the outputs. In this post, we will write a PLC program on how to switch three motors based on fixed priorities. We will use functional block diagram language using Studio 5000 software.
Programming Three Motors with Fixed Priorities
Let us understand the case scenario first. We have a pressure transmitter in a pipeline. This is connected to the discharge line of three pumps. When the pressure is below the on-setpoint, the first pump will turn on after checking for 5 seconds.
If the pressure is still low below this setpoint, then the second pump will turn on after checking for 5 seconds. If the pressure goes above the point after the first pump turns on, then nothing will happen as the pump is maintaining the pressure.
When the pressure is above the off-setpoint, the second pump will turn off after checking for 5 seconds. If the pressure is still above this setpoint, then the first pump will turn off after checking for 5 seconds. If the pressure goes below the setpoint after the second pump turns off, then nothing will happen as the pump is maintaining the pressure.
So, this is basically a pressure-maintaining process as the demand arrives for the pumps. But, all this will run only when the system is running (coming from SCADA). If the system is not running, then no pumps will operate.
First, pumps A and B will operate. Now, an external bit from a SCADA system will come to our PLC which depicts that the set hours of system running has been done. Due to this, we will stop the system first (going from our PLC to SCADA) and pause it for a time till the hours done bit we received is still on. After this bit is off, the system will start again.
Now, pumps B and C will operate. The cycle will again repeat for pumps C and A and will restart again from A and B. Due to this, as the pressure demand varies, the pumps with currently assigned priorities will operate, and the third pump will remain off.
Studio 5000 Programming
Now, let us write the PLC logic. Refer to the below images. We use two sheets in Studio 5000 software, as shown in the two images below.
We have the following input variables – pressure value, pressure on-setpoint, pressure off-setpoint, system running (from SCADA), and set hours done (from SCADA).
We have the following output variables – system pause switchover progress (to SCADA for turning the system running a bit off in its system), pump-1, pump-2, and pump-3.
We will take the first sheet, where we will configure pumps based on pressure demand. Refer to the below image, where we turn on the pumps. If the pressure is below on-setpoint and the system is running, we turn on a delay timer for pump-1, which has a setpoint of 5 seconds.
After the timer is done, the bit named pump1_on is set. We use the SETD block here. In this block, there are two inputs – set and reset. If the set bit is high, then the output is set. If the reset bit is high, then the output is reset, on the condition that the set input is not high. It means set input is given priority over reset input.
If the pressure is still below on-setpoint and the system is running and pump-1 is on, we turn on a delay timer for pump-2, which has a setpoint of 5 seconds. After the timer is done, the bit named pump2_on is set. We again use the SETD block here.
Refer to the below image, where we turn off the pumps. If the pressure is above off-setpoint and the system is running and pump-2 is on, we turn on a delay timer for pump-2, which has a setpoint of 5 seconds. After the timer is done, the bit named pump2_on is reset.
If the pressure is still above off-setpoint and the system is running and pump-2 is off and pump-1 is on, we turn on a delay timer for pump-1, which has a setpoint of 5 seconds. After the timer is done, the bit named pump1_on is reset. If the system is not running, then too we forcefully reset both the bits. So, we use an OR block for resetting the outputs.
Now, we have to decide where these two bits of pump1_on and pump2_on will be assigned to, meaning which actual pump will operate. We will take the second sheet, where we will operate pumps based on priority. Refer to the below image.
We use a counter for counting system priority based on set hours done from SCADA. Whenever a set operating hours are achieved, the SCADA will give this bit to our PLC and increment the counter. This bit must remain on for some time in SCADA.
Also, when this bit is on, we give in return a bit named system pause switchover progress to SCADA for turning their system off. For the different counter values, we operate the pump according to our design discussed earlier. It will take this counter value and the current pump 1 & 2 condition we wrote earlier. Accordingly, the three pumps will operate.
In this way, we saw how to write a PLC program for switching outputs based on fixed priority.
Read Next:
- PLC Interlock Logic with First Input Priority
- What is Alarm Prioritization? – Types of Alarms
- Product Painting with Omron PLC Program
- PLC Logic for Tanks Filling as per Priority
- Usage of Cyclic Interrupts TIA Portal (OB 30+)