# Ladder Logic for variable Analog Output

#### ALjubovic

Joined Jan 24, 2023
1
Hello. I am an intern engineering student, and I was assigned a fun project of making an automated hydrostatic pressure testing system. Right now a operator manually turns a pressure regulator which feeds an air-driven liquid pump, this pump then pushes out water on the other side and into our hoses we are testing, then the pressure is kept constant, and a timer is set. After the timer is done and the operator checks for any leaks in the hose the pressure is released, and the hose passed the test. My goal is to automate this whole process, I will be the click plc and will be using an I/p transducer (current to pneumatic transducer) to control the pump, solenoid-controlled relief valves for when the system needs to depressurize, mechanical relief valves for when the system over pressurizes and an hmi. The simple way this works is the operator attaches his hose, then types in the pressure the hose needs to be tested at and for how long, then he presses a start button and the whole process should be automated.

I am a first-year Mechanical Engineering student, so when I first started on this project I had no experience with any code. I learned a lot in a month and now have my program ready, there is just one thing missing. I am coding this project in sequence steps and subroutines, step 0 is start up, 10 is pumping, 20 is post pumping, 30 is post test and so on. For step 10 I am missing the code for starting the pumping process.

For step 10, I need to slowly increment the I/p transducer (current to pneumatic transducer) until it is at the pressure the operator set to test. The pump will stall once the air driven pressure is constant. We can calculate how much pressure I need the transducer to output by just dividing the pressure setpoint by the pressure ratio for my pump which is 1:16 (may need to change this number when testing). So, say I want 1000 psig in the system, I would need 63.41 psig output from the transducer (1000psig=1014.7psia, 1014.7psia/16=63.41psig). I already scaled the output in the click software so I can just send the required pressure setpoint to the transducer and it will output the required psi to get there.

I am not sure if the transducer can be sent a command to go straight to 63.41 psig, because that sounds like it could cause damage to itself and the pump if the pressure shoots up too quick. I need to implement in the code a way to slowly ramp up the transducer pressure until the pressure setpoint is met in the system. For example, every 1 second the pressure in the transducer goes up 1/4 psig or 1/2 psig, it would do this untill the desired output is met. I just don't know how to do this in the clicks programming language.

Any help is appreciated, and I am here to learn.