Is there a way to create proportional logic for a control valve without using a PID function? I want to create a simple P controller without using the Rslogix PID function block.
Right now I'm subtracting the valve position from the Setpoint to give me an error. I then take the error and drop it into my analog output going to the hydraulic servo valve. Being that the error reduces as the valve position gets closer to the setpoint, the servo closes and the control valve slows way down. This would be okay but I would like for it to be a little more weighted.
The problem you usually end up running into is that the valve and system will have a deadband below which your command won't make a difference and as such you won't get to the value you really want to be at.
Yes, 3 SCP instructions. One to convert counts to engineering units. One to compute the control output 0-100 using a proportional band and the third one to convert the control output to counts.
Being that the error reduces as the valve position gets closer to the setpoint, the servo closes and the control valve slows way down.
That is the way proportional only control works with servo valves.
The problem you usually end up running into is that the valve and system will have a deadband below which your command won't make a difference and as such you won't get to the value you really want to be at.
I posted this some time ago although it's a PI block but should do what you want & you can tailor it to do what you need, although it's in GX works it would not be hard to convert, just set the I component to a very low value & don't forget to only sample the block one scan every x milliseconds or even seconds.