Is it possible to program this onto a Click PLC? If so, I need help anyway.

Right, Yes it is the pressure transmitter the one that measures the pressure in the test cell or what ever you call it. The scaled analog is the conversion of the raw analog value (you may not need this if the PLC has an analogue card settings as many do now) if not then the analog is presented as a number 0-4096 (or what ever is the range)
The first two rubgs is just a way of converting the raw integer of 0-4096 into a pressure i.e. 0.00-500.00 PSI or what eber is the range it could be bar, ior inches water gauge, it is so the operator can see it working in actual real values not just a number.
so that is questions 1 & 2
3. they are not if you look there is a little R inside the coil this means reset it, this is a set/reset of a bit when for example the rung that checks the pressure if out of tollerance we set the alarm bit, if we only used it as a normal coil then when it goes off this step it will go off so we latch it to display the message & only de-latch it on a start of a new test.
4. The e-stop is usually a hard wired Normally closed to a safety relay that drops out the power to any outputs from the PLC that drive any equipment that could be considered dangerous to persons, it has a spare contact that also goes to a PLC input, should someone press the e-stop it cuts power to motors or other moving equipment as well as being used in the plc to reset the process back to idle so when the e-stop is re-instated it does not start automatically this is generally always a N/C so the PLC input s on, & goes off when pressed, should the wire come off the feed to this switch then it will turn off the input & the plc will see it as a stop condition, if you used N/O switches then if the power feed to a switch was lost then the system will continue to run if the button is pressed.
5. The idea of an inflight is that often after stopping a pump or what ever, there continues to be in this case a rise in pressure as it takes time to stop a pump or close a valve, the idea is to predict it takes 1 second to close, the valve or pump stopping/closing will still be producing flow so if you stop a pump at say 2 psi before the setpoint reachedc the natural delay in stopping the pump will add another 2 PSI to the pressure, like when you see a red traffic light, if you waited to brake till you were at the lights by the time you stopped you have past the white line or hit a car comming across the junction, this can be set at commissioning it could turn out to be 0 or very small depending on how fast the pressure increases.
6. It is not, The shut off valve is Normally open & you energise it to close it, this is a safety feature so that the pressure cannot build up if the process is running, often this has it's feed from a plc output via a contact on the safety relay & possibly some electric bolt operated lid on the test vessel so the operator cannot try to open it while pressurised.
7. This is the point when the value of the analog output is changed from perhaps 100% to say 20% i.e. slow build up of pressure so that you can get closer to the setpoint it's like again, driving towards traffic lights if they are red you start reducing your speed before you get there so you do not overrun.
8 that is to stop the decrementing of the raw analog below 0 (actually I set it to 10 as we decrement by 10 every 100ms) the idea is it will never go below 0 as this is only simulation logic it will not be needed so can be deleted when tested on simulation.
9 What this does is the original stored pressure at the test start could possibly drop by a very small amount even 0.000001 psi (probably due to noise on the analog signal) so if for example the pressure was at 200.0200 at start of test & at the end the reading was 200.001.0 then it would fail the test so what we are doing is just having a bit of a band to allow for fluctuations, remember earlier I said when comparing one value with another in floating point you will never get it exact, there are minor erros in floating point maths that can accumulate the more maths that is processed.

10 That is to check the pressure has fallen to below a reasonable level so the sequence can step on back to idle so the operator knows it's safe to open the pressure vessel or what ever it is.

Ooppsss may have got the numbers mixed up with the rung numbers will have to stop here the other half wants her cup of tea, will try to visit tomorrow. but it should give you a starting point.
 
DRBitboy (Brian) will come back with I name that tune in five, like the old gameshow, he will integrate some rungs of code to reduce the amount, this is fine often do it myself, but I try not to make it too complex by spliting it up a bit & as code like this takes me only an hour or two to write, populate an HMI & simulate there will be ways of improving it.
As a matter of interest it may seem like one rung checks if the pressure is within the limits & sets the alarm, moves 50 into the sequence word, but the next rung seems to do the same thing without the alarm, this is a bit of trickery by using the way a PLC program scans so when the comparison for 40 for that first rung is true, it does the logic if error is outside the limit then it sets the alarm & moves 50 into the seq. word, when it gets onto the next rung if it eqals 40 then it moves 50 into the seq. word but remember if the alarm check was true it has already moved 50, so when it gets to the following rung the seq. is at 50 so does not process it, however, if the alarm check is false it does not move 50 so it stays at 40 for the next rung & that one moves it on.
In text it goes like this.
We are on step 40, if the current pressure minus the tollerance is less than the stored pressure set the alarm move to 50
Else
Move to 50.
There are many things for you to learn, real processes act differently in the outside world, the world of computer programs seem to be precise. so often what works in a computer simulation does not in the real world.
As I have posted before, many think things like temperature control is better with PID, this is not true, I did a process where direct steam was injected into the product, fine on some products, fine in a vessel that is deep, however, we did a system that was more like a frying pan i.e. it was wide but not deep although could contain 1000kg of product.
The spec was to use Eurotherm controllers the PLC sent a setpoint to the controller. the problem was that certain recipes had to produce a sort of emulsion, when heated it turned quite thixotropic, as the depth of the product was quite small the steam started to blow though the product hence the product was not absorbing the heat it was just disipating in the space above the product. so the PID controllers would up the volume of steam but not increase the heat, the slower the temperature increase the more steam it added, just got nowhere, Myself & 3 Eurotherm engineers tried to tune it in, it never happened, overnight I bypassed the controllers, wired the valves to some analog outputs & put 4 stages of setpoints based on temperature, this worked a treat, so on initial heating sent 100% to the valves, as the temperature of the product increased, dropped the percentage by a factor, this meant that when the product started to thicken less steam was being added so would not blow strait through the product.
You need experience in the field to realise that not everything can be designed on paper & work without modifications. In this case the designers had no real idea the product combined with the low height would cause this.
 
@Aljubovic: the device that raises the pressure has been referred to as an "air driven pump."

So compressed air, or rather, the pressure difference between compressed air inlet and (atmospheric?) discharge, is the motive force, so this motive air coming in decreases in pressure across the pump, correct?

And is it "pumping" water or air? If it were "pumping" air I would call that a compressor, but that is me.

I am guessing the process is summat like the image below, where the "air-driven pump" is (6), which pumps water from the (16 Liquid Tank) into either the (10 Test Cabinet) or the (11 Tested Part), so the pumped fluid coming in increases in pressure across the pump, correct? I realize that the pumped fluid could also be air, pumped into a tube or other volume coming out of the top of the water-filled tested part.
H9621e5a8469046e29ada5cc465537012G.png

 
Maybe this is a simpler version. the upper piping is compressed air. The lower piping is water. So the air-driven pump is a "pressure amplifier?"

PROPAK-circuit-example-845x268.jpg
 
Yeah, that booster pump is a pulse unit i.e. on the up stroke it sucks liquid in & down stroke pushes it out so it is going to pulse the pressure bit, I'm sure they will only work over a small range of air pressure so drop below a certain pressure & they lock, so varying the air pressure only has a limited effect on volume per stroke I have worked on similar ones, the cycle will go from say 2 or 3 strokes per second to about 1 every 2 seconds but at low rate they often stall I have never seen one being used on a variable air pressure, normally the regulator is pre-set to give reliable operation over a small stroke range.
 
Could you link me that PLC emulator that click provides?


I think there is no emulator to work with the Click Programming software for Click PLCs.

AutomationDirect does have DoMore Designer software that includes a PLC emulator; the DoMore software has similarities to the Click software, so it might be good enough to develop the basic application, test against a built-in simulator, and then port to Click later.
 
Yo need to get your head round how a PLC works.
Generally, a plc has a block of memory and input/output channels these channels can be digital or analog (plus things like communication & specialty cards perhaps servo drives etc).
A PLC cycle
At startup i.e. power up or going reom stop to run
some tests are done to check things like battery, I/O cards are ok, memory is valid & probably a lot of other things.
once this is done Then it scans the physical I/O and maps them into internal bits for example In your program you use a contact called I 0.1, this not the physical input but a copy of it, some PLC's you can actually read the physical input but it's name is different for example Mitsubishi inputs are X & outputs are Y so X0-X128 & the same for outputs, the physical input itf you want to read it directly is DX0.
so in general as the inputs are read only before the program scan the state of that input will stay the same even though the physical input may change as it is only updated before the next scan.
Then the program logic is processed starting from the begining, left to right top to bottom.
at the end of the program scan the PLC then updates the output status by mapping the outputs to the physical outputs.
does a few other jobs then goes back to the beginning.
There are ways where the program scan be interrupted to do other things like update the I/O immidiately or communications, time interrupts etc.
read this article it shows basic digarams & flow of a typical PLC

http://www.plcdev.com/how_plcs_work

When a PLC is put into run mode the operating system starts by doing some housekeeping i.e. check that the program is valid the I/O cards, battery etc. are ok. in this begining of the scan process it will look at the physical inputs (cards) and map the status into internal memory so in your program when you use a contact like I 0.0 this is just a copy of the physical I/O bit. then processes the user program & at the end updates the outputs.
To carry on with your questions (may be a bit mixed up).
The air control to the pump i.e. 4-20ma to say 0-150 PSI (we call it a I/P converter i.e. current to pressure. Normally you will have a shut off valve on the air supply to the pump, the analogue is only used to vary the air pressure, in many circumstances it can be dangerous to rely on an I/P converter to stop the pump by setting the analog to 0. just like an electric motor driven from a frequency inverter, yes it can be stopped by putting the analog to 0 and removing the start signal but this is not deemed safe, so in a lockout or e-stop the 3 phase supply is removed from the inverter. there are inverters that have safety control internally but even then it is often implemented as a secondary safety to remove the power, just like your cooker, yes switch it off before servicing it but do not rely on the switch, disconnect it from the mains.
So it is common practice to isolate the source of energy.
You will notice in brian's posts images there is an isolation valve before the regulator (however, in that instance it is not a controlled regulator just a hand set one). It may not be that dangerous but we as engineers are relying on information you give we do not know the physical layout equipment used etc. The one thing you need to do is a risk assesment, to determine the risks of injury and put in place relevant safety, you are responsible & could be prosecuted should a person be injured if you have not built equipment to the relevant legislation.
In your case it is possible that an isolation valve is not required, just set the analog to 0 when not required i.e. when the sequence is not between 10 & 20 move 0 into the analog output register, and when it is between 10 & 20 allow the set value to the analog output register.
That is easy, just move 0 to the register before rung 14 as the next rung will change it back to the correct value.
See attached, as you can see in the logic we write 0.0 to the analog every scan, but if the seq is requiring pressure then the relevant setpoint is moved into the analog out register the second part is where it is not required so it is zero here we are using the way it scans the program, we continuously write 0.0 to the register, if in process seq. then this is overwritten, this happens in a few micro seconds & as the update of the physical analog is only done after program scan the analog card only sees the value after these rungs. I have also added a slight modded HMI, made it a little more like you may have, put the isolation feed valve before the I/P converter as I would have done for safety.

Analog Force.png HMI.png
 
Yeah, that booster pump is a pulse unit i.e. on the up stroke it sucks liquid in & down stroke pushes it out so it is going to pulse the pressure bit, I'm sure they will only work over a small range of air pressure so drop below a certain pressure & they lock, so varying the air pressure only has a limited effect on volume per stroke I have worked on similar ones, the cycle will go from say 2 or 3 strokes per second to about 1 every 2 seconds but at low rate they often stall I have never seen one being used on a variable air pressure, normally the regulator is pre-set to give reliable operation over a small stroke range.

So what does the operator's manual "knob" vary? Will the PLC's analog output to the electric-to-pneumatic transducer control the same thing as the knob?

The pump is a simple device. The pressure available to the air side is multiplied (amplified) by the ratio (air piston area ÷ liquid piston area), which piston area ratio is a constant physical property of the pump. So once the ratio (liquid pressure ÷ air pressure) climbs and matches that piston area ratio, the pump will stall (ignore friction as a second-order effect).

@Aljubovic, would the following be an acceptable manual control scheme for an operator? Assume the test pressure set point is 200psi -0/+10psi

  • At start, the test pressure is zero
  • The operator turns the knob up to 100%
    • Test pressure starts to rise
  • As the test pressure nears setpoint, the operator estimates how long it takes for that test pressure to rise by 10psi.
    • Say they estimate it takes 20s
  • Once the test pressure reaches 200psi,
    • the operator decreases the knob position at a rate of 10% every 2s
  • So after 20s
    • The knob would reach 0%, and
    • The test pressure would have reached ~210psi
      • I.e. If it continued at the rate estimated by the operator in the earlier step
  • At some point,
    • Before
      • the 20s is up, and
      • the knob reaches 0%, and
      • the pressure reaches 210psi,
    • the pump stalls,
      • because there is not enough air, or air pressure, to keep the pump going
      • I.e. the pressure ratio exceeds the piston area ratio,
  • The timing of the test begins.
 
Yo need to get your head round how a PLC works.

This. @Aljubovic, you need to understand the scan cycle. Go back and re-watch @Ron Beaufort's PLC Bootcamp series on youtube.

The PLC is a hyperactive child: it has to always be doing something.

  • What it does first is read its inputs, evaluate its current PLC program logic, and then write the outputs per the logic evaluated.
  • What it does second is read its inputs, evaluate its current PLC program logic, and then write the outputs per the logic evaluated.
  • What it does third is, you guessed it, read its inputs, evaluate its current PLC program logic, and then write the outputs per the logic evaluated.
  • What it does fourth is ...
Each of those step is a scan cycle. The PLC keeps doing that, with but a few milliseconds between cycles. Every scan cycle is the same thing; the only thing that changes is the inputs.

That is greatly oversimplified, but it is a model of adequate fidelity to understand how a PLC works.

Compare that to how a human operator might work:

  • Turn the knob to some position
  • Note the rate of test pressure rise, estimate they have a few minutes
  • Daydream for a bit, or go to the loo, or have a smoke, not watching the test pressure because they know it will take those few minutes before they need to get back to it.
  • Once the test pressure is close to 200psi, the operator would watch it closely, and act accordingly, more like a PLC.
You would not expect a human to spend 0-195psi watching the needle move. The PLC can do nothing else.

This is why the step scheme proposed and coded by @parky is so useful:

  • On any one scan cycle, the PLC needs to do a limited set of specific actions, depending on which step of the process it is in,
  • But the PLC is also evaluating all of the rungs of logic every few milliseconds,
  • So comparing (AND=) the step integer's value to the enumerated steps (0, 10, 20, etc.) is a simple way to execute the logic of that limited set of rungs specific to the current step, and essentially ignore or disable the rest from affecting the output.
    • The cost is an extra rung per step to handle the transitions between steps.
 
Last edited:
The other thing to understand is order of evaluation. Ladder rungs are evaluated top to bottom, and left to right on the rung (or branch). So if Rung 1 has an output instruction that write a value to a variable, and Rung 2 writes a different value to that same variable, then it is the Rung 2 value that will end up in that variable, because Rung 2 is evaluated after Rung 1.

Here is an modified version of @parky's example, annotated in the @Ron Beaufort style to show this in painful detail:
Analog Force.png
 
Last edited:
Here is the program in Click had to split some of it into other rungs as some instructions will only go on right hand side, unlike mitsi you can do much more in FBD.
I have only done the actual sequence code but it would be easy to add the output logic & the simulation I'm not going to do it all.
I have selected a simple processor that has analog in & out built in, it does have built in scaling you just need to click on the I/O in the tree & set it up, it comes pre-configured so all you need to do is change the type i.e. 0-5v to 4-20ma & set the min and max scaling assume your pressure sensor is 0 to say 500 PSI then change the max to 500.0 It has already selected float registers DF1,2,3,4 for the analog scaled values.
The software is a bit of a pain to use, drawing lines to connect functions is awful, & things are a bit long winded, keeps bringing up windows to select things, lines you cannot just draw a line connection from an ored contact like you would in paint, you have to put it in draw line mode then point it & move about it is **** but for free software I suppose it's not bad.
See attached file, I had to zip it as this site only allows certain types of file ext. so you will need to unzip it.
 
[Update: whoopsie, had to fix a typo of my own!]

Here is the program in Click

Nice.

A few typos (which would have been found if Click had an emulator):

  • On Rung 7 (Sequence Step 30):
    • the logic feeding the CT1 reset pin needs to be [DS1 != 30],
    • otherwise CT1, having reached its preset,
      • will not reset as Sequence Step proceeds through subsequent values 40 and 50,
    • which means Rung 8 will continually return Sequence Step to 40,
    • until the pressure drops below 0.5psi and Sequence Step becomes 0 again,
    • so eventually both Test Passed and Test Failed bits could be set on Rungs 10 and 11.
    • Sequence Step=40 and CT1 need to be one-shots (true for one scan only)
      • See image below
      • When CT1 reaches its preset in step 30, this
        • performs the pass/fail checks,
        • eliminates step 40, and
        • goes straight to 50
  • A rung controlling the solenoid (bleed/relief/dump) valve is missing
    • closed for Sequence Step values from 10 through 30
    • this was present in the Mitsi code
Untitled.png
 
Last edited:
well found I forgot to put in the seq = 30 so the rung is false. it is in my original
I do not reset the counter at step 30 as I want to keep the accumulated value on the screen, in actual fact, rather than reset it when IDEL it would be better to reset it on seq 10.
Yes I put it on seperate rung for clarity also if I add too much text the width streches I have had to reduce each line so that it fits in when printed, or it puts the out instructions on another line so is difficult to read & looks ugly, not found out yet if I can shrink it or not yet.
If it was mine I would do that, however, this editor is ****, so getting used to drawing the lines takes a bit more practice .

You have not read the post fully, I mentioned I only did the sequence logic, the rest is up to the OP to try & code, will give him some practice.
I have updated the project to reflect that ommision
 
We all do it lol
Actually, I was thinking about doing a history of say the last 5 or so tests but I thought that might be too far.
 

Similar Topics

Hello. I have been trying to crack this one without success and could not find any hint after several search attempts. I wonder if any CODESYS...
Replies
4
Views
3,887
Hello, I'm pretty sure I know the answer to this, but wanted to verify with the experts. Am I able to write a program using the Micro Starter...
Replies
7
Views
3,135
First off, i am new to ladder logic. I do have some experience programming microcontrollers in C. I will try and give a short version and if more...
Replies
7
Views
1,973
This is a CompactLogix L33ERM, version 30 (31 is too unstable on my machine to work with), with a Kinetix 5500 drive. I have a program where...
Replies
2
Views
1,983
Good morning guys! I have a doubt. I uploaded a program from a S7-200xp on the field and took it to the office. Before doing any test I tried to...
Replies
7
Views
2,131
Back
Top Bottom