2 Alternating pressure pumps Lag/Lead/Standby

Lancie's example uses RSLogix 500, which is for the SLC/Micrologix controllers. You're using RSLogix 5000 and the ControlLogix platform. Very different animals :)

In Lancie's example:
- I:1/4 means input, slot 1, point 4. Your input card is in slot 2, so your input would be Local:2:I.Data[4].
- O:2/1 means output, slot 2, point 1. Your output card is in slot 3, so your output would be Local:3:O.Data[1].
- B3:0/1 means internal bit register 3, word 0, bit 1. Your PLC doesn't use this: you would just create a new tag of type BOOL and call it something meaningful, e.g. Pump2_Toggle

Also, if I were you, I'd set up an alias on your inputs and outputs. Local:3:O.Data[1] doesn't mean much to you, and will make programming slow and painful. But if you create a BOOL tag "Pump1_Run" and alias it to the pump 1 run output, you again have something meaningful to play with.

Hope that helps!
 
Lancie's example uses RSLogix 500, which is for the SLC/Micrologix controllers. You're using RSLogix 5000 and the ControlLogix platform. Very different animals :)

In Lancie's example:
- I:1/4 means input, slot 1, point 4. Your input card is in slot 2, so your input would be Local:2:I.Data[4].
- O:2/1 means output, slot 2, point 1. Your output card is in slot 3, so your output would be Local:3:O.Data[1].
- B3:0/1 means internal bit register 3, word 0, bit 1. Your PLC doesn't use this: you would just create a new tag of type BOOL and call it something meaningful, e.g. Pump2_Toggle

Also, if I were you, I'd set up an alias on your inputs and outputs. Local:3:O.Data[1] doesn't mean much to you, and will make programming slow and painful. But if you create a BOOL tag "Pump1_Run" and alias it to the pump 1 run output, you again have something meaningful to play with.

Hope that helps!

Yeah, this helps. I created aliases for the inputs like you mentioned. What is I:5 in the "source" of the LES?
 
This is what I have so far
lXB4bbd.png


I just need to figure out the LES and OSR tags.
 
I:5 is going to be your analog pressure reading. The 50 in the LES instruction should probably be 25 to match Lancie's rung comment.
Note..I haven't read this whole thread so you will need to determine your analog input for pressure.

HTH
 
Sorry, led you astray a bit with my addressing - I thought slot 2 was a digital input, not analog! So more correctly:

In Lancie's example:
- I:1/4 means input, slot 1, point 4. Your input card is in slot 3, so your input would be Local:3:I.Data[4].
- O:2/1 means output, slot 2, point 1. Your output card is in slot 4, so your output would be Local:4:O.Data[1].
- B3:0/1 means internal bit register 3, word 0, bit 1. Your PLC doesn't use this: you would just create a new tag of type BOOL and call it something meaningful, e.g. Pump2_Toggle

Then slot 2 contains your analog inputs. Drill down through Local:2:I until you get to an array of 8 DINTs or INTs (I can't remember which offhand for that type of input card). Those will be your 8 inputs, you obviously need to select the one you've wired your pressure switch to.

Before you get as far as putting the analog input into a LES comparison though, you should scale it into something meaningful - i.e. 0-100%, instead of -32767-32767 (or however you've configured your ananlog input). This can be done with a CPT instruction, or you can download the SCP add on instruction (a search of this forum should turn up plenty of threads on those two if you're unsure).

Also, from a quick glance at your code - instead of using a OSR instruction, try an ONS. Put one in, select it and press F1 to read the help file on the instruction - likely it's more suited to what you're trying to do here than the OSR.
 
Sorry, led you astray a bit with my addressing - I thought slot 2 was a digital input, not analog! So more correctly:

In Lancie's example:
- I:1/4 means input, slot 1, point 4. Your input card is in slot 3, so your input would be Local:3:I.Data[4].
- O:2/1 means output, slot 2, point 1. Your output card is in slot 4, so your output would be Local:4:O.Data[1].
- B3:0/1 means internal bit register 3, word 0, bit 1. Your PLC doesn't use this: you would just create a new tag of type BOOL and call it something meaningful, e.g. Pump2_Toggle

Then slot 2 contains your analog inputs. Drill down through Local:2:I until you get to an array of 8 DINTs or INTs (I can't remember which offhand for that type of input card). Those will be your 8 inputs, you obviously need to select the one you've wired your pressure switch to.

Before you get as far as putting the analog input into a LES comparison though, you should scale it into something meaningful - i.e. 0-100%, instead of -32767-32767 (or however you've configured your ananlog input). This can be done with a CPT instruction, or you can download the SCP add on instruction (a search of this forum should turn up plenty of threads on those two if you're unsure).

Also, from a quick glance at your code - instead of using a OSR instruction, try an ONS. Put one in, select it and press F1 to read the help file on the instruction - likely it's more suited to what you're trying to do here than the OSR.

I'm pretty sure I have the SCP add on instruction I just didn't know how to use it. Since this will never actually be used in the field can I just leave it as is and use and use whatever 20% of -32767-32767 is?

Any method to picking slots for cards?
 
I'm pretty sure I have the SCP add on instruction I just didn't know how to use it. Since this will never actually be used in the field can I just leave it as is and use and use whatever 20% of -32767-32767 is?

Any method to picking slots for cards?

You can just use the 20% of whatever your analog input is. But I'd recommend that you teach yourself how to use SCP, it's a basic building block of PLC programming and you're going to have to learn it at some point or another. Besides that, the hardest part of scaling is calculating your 0 and 100% values, and if you're going to go to the trouble of working out 20% you might as well work out 0 and 100% and scale it properly.

As far as picking slots for cards, my detail above was just based on your previous post where you specified which card was where. But if I was building the system, generally, I put my cards in the following order:

CPU
Comms
Speciality cards
Digital Inputs
Digital Outputs
Analog Inputs
Analog Outputs

But it makes no real difference how you configure them, as long as you do it in some sort of logical fashion. That works for me because it mirrors my electrical drawing structure :)
 
(.2*total)+minimum
Finding the functions to do that (when you are not familiar with the program) is probably harder then doing it. Unless I am completely off base and it doesn't scale linearly.

Edit I misread I thought you said finding 20%would be the hardest part...sorry I am fighting with windows 8.1 on my laptop at them moment stupid thing doesn't want to do what its told
 
Last edited:
As you have seen, my old RSLogix 500 program was only a place to start.

One thing that has not been addressed, but you need to figure out is: How to calculate a 25% drop in pressure? That was your specification for changing to the next pump. Here would be my steps:

1. Set up an internal variable for "Pressure Max". You need to know the highest pressure reached in order to calculate a "25% Drop". Drop from WHAT? It has to be a drop from the highest pressure reached, otherwise your calculation would be incorrect. So each scan, do a comparison: If Analog Pressure Input > Pressure Max, then Pressure Max = Analog Pressure Input. Now your PLC always knows the value of Pressure Max.

2. Next, you have to see if there has been a 25% pressure drop FROM Pressure Max. So do a Compute: 25% Pressure Drop = .75 x Pressure Max.

3. Then do another comparison: If Analog Pressure Input <= 25% Pressure Drop, then trigger your "Indicator that the Pressure Has Dropped Below 25%".

4. Now you use the Pressure Drop Indicator bit to trigger the Pump alternator logic.

5. After the new Pump has been selected by the Pump rungs, you need to immediately do some resetting. The Pressure Max value and the 25% Drop value should both be reset to 0 (Move 0 to both memory locations, or use a Clear instruction), to get ready for the next pressure evaluation period.

You have some incorrect bits in your last program. The XICs with question marks should be your "Pump toggle switch P1P2_Toggle" bit. However for Rung 2 and Pump 1, this bit should use a XIO (normally closed) instruction, because it is the lead pump and it should run before the pressure rises then falls for the first alternation. Leave the P1/P2 Toggle bit as an XIC for Rung 3 and Pump 2. This is typical and crucial for alternator logic: the first lead trigger bit is XIO, the second following must be XIC, so they can alternate the running of the 2 pumps.

Per your given instructions, on Rung 2, your XIC Pump_2 Local:4:0.Data.1 should be a XIO (normally closed) so that Pump 1 cannot run if Pump 2 is running, specially if both Manual selectors should be ON at the same time.

On Rung 3, your XIC Pump_1 Local:4:0.Data.0 should be a XIO so that Pump 2 cannot run if Pump 1 is running, as instructed.
 
Last edited:
SP-PV = Pressure Drop
Good point. I wonder what is the Pressure Setpoint? If we knew that, then 25% below SP = SP - 0.25SP = 0.75 x SP.

It is possible to have a Setpoint that is never reached. Then the question is: Does the problem state that the pumps alternate at "25% below a pressure setting", or at a 25% pressure drop, or something else?

"25% pressure" is not specific. 25% of which pressure?
 
Last edited:
Good point. I wonder what is the Pressure Setpoint? If we knew that, then 25% below SP = SP - 0.25SP = 0.75 x SP.

It is possible to have a Setpoint that is never reached. Then the question is: Does the problem state that the pumps alternate at "25% below a pressure setting", or at a 25% pressure drop, or something else?

"25% pressure" is not specific. 25% of which pressure?

Hi Lancie, I added the components and changed my XIO,XIC switches to fit what you posted earlier. I showed my professor what I had and asked about the 25% pressure drop. this was his response

DRAWING DOES NOT MEET REQUIREMENT, NOR DOES YOUR PROGRAM.

Pretty frustrating. The program is not available outside of 9 computers on campus, no demo version is available and not very many tutorials online compared to a program like Matlab or PSpice. Is this a form form of sacred knowledge only a few are allowed to learn? I never had a course like this and I'm not sure how to even study. No book for the course either. I can read PID and PIDE manuals until i'm blue and I still wont be able to jump in and program multiple pumps of the bat. I'm expected to get this working and do the same in structured text before the end of this week.
 
DRAWING DOES NOT MEET REQUIREMENT, NOR DOES YOUR PROGRAM.
Now you will have to show us the actual "requirement" for the program. Apparently it must be written in structured text only, no ladder logic allowed. Other than that we know nothing about the "requirement".
 
I'm planning on working on it this afternoon. I will post the requirement hand out but it's not very clear. The program is suppose to be done in ladder logic he just also wants me to complete the project in structured text. Most of the labs were lab 1: ladder logic lab2:structured text lab3: function blocks the same lab done 3 different ways.
 
requirements
LastLab Projects: 11, 12, and 13.

Lab 11 will be programmed in ladder logic.
Lap 12 will be programmed in structured text.
Lab 13 will be for extra credit and program in Function Block Diagram language.

Deliverables:
1. I/O modules drawings
2. Working Program
3. Assign I/O the Inputs and Outputs in your program.

Project Functional:

This project will have two pumps controlled in three modes, Off – Manual-Auto (auto meaning standby mode).

Each pump will have its own control station consisting of a lighted startpushbutton (NO), lighted stoppushbutton (NC), an alarm light, and a three position selector switch (off-manual-auto).

When in the off mode the pump is taken out of service will not run.
When in manual mode an operator will be able start and stop the pumps.
When in auto mode one will run while the other is in standby. The pump that is started first in automatic will make the other pump its standby, if that pump is in auto mode.

Example: The pumps 1 and 2 are used to control a header pressure, if pump 1 is running, in auto and pump 2 is off and in auto and the pressure is at 75%. If the pressure were to drop below 25% pump 2 would start automatically and pump 1 would shut-down and an alarm would sound.

He also added this after class today since the entire class was having issues
Select an I/O module and provide electric drawings of I/O modules and devices connected to them.

The following will be assignments of I/O:

Slot 1 input 0 will be pump 1 stop.
Slot 1 input 1 will be pump 1 start.
Slot 1 input 2 will be manual mode.
Slot 1 input 3 will be auto mode.
Slot 1 input 4 will be pump discharge header pressure switch (opens at 25% of Pressure)

Slot 2 input 0 will be pump 1 stop.
Slot 2 input 1 will be pump 1 start.
Slot 2 input 2 will be manual mode.
Slot 2 input 3 will be auto mode.

Slot 3 output 0 will be pump 1 contactor relay.
Slot 3 output 1 will be pump 1 alarm Light.
Slot 4 output 0 will be pump 2 contactor relay
Slot 4 output 1 will be pump 2 Alarm Light.

The I/O's is what I think he mean't by the requirements not being met. I assigned the wrong cards to the wrong slots.
 

Similar Topics

Today I was making an online edit to a 5/40 Series E Rev K.2 with about 14% free memory. I was removing one branch in a large rung. Accept...
Replies
4
Views
3,171
I have 2 pumps not alternating at a lift station. When im at the panel and use the test switches to initiate the pumps,it alternates in the PLC...
Replies
22
Views
5,842
Hello I have been thinking in some way to operate 3 pumps in the same way (I have schneider modicon m340 PLC): -the pumps feed a tank. - As...
Replies
3
Views
1,883
Hi Everyone, trying to get an alternating output to work. Read through the forums on flip flop, toggle, etc. Found this site...
Replies
5
Views
4,220
Hi I'm kinda new at PLC programming sorta teaching myself. I need to alternate between two motors run one till satisfied the when it calls again...
Replies
2
Views
1,518
Back
Top Bottom