QUOTE (Pulsar2003 @ Oct 1 2009, 01:13 PM)

Hi.
I have an issue with an oven that is suspended in the air with an axis in it's middle. This rectangular oven tilts both side to +/- 39 degrees from the horizontal.
Currently there two solenoid valves that are commanded by two relay outputs (0W-16). The issue is that when the oven has reached it's angle or is commanded to find it's horizontal, the motion is stopped instantly causing the entire structure to wobble like in an earth quake. Recently the top plates and structure that holds the pistons in place just snapped. To prevent this they (colleagues) added more structure (welded plates on). I believe that there will be damaged done else where in the structure as it's been strengthen. Not only that, it's once the horizontal angle (0 degree) is reached the motion stops instantly yet the oven still moves and causes mistakes of about one degree and obviously causes the PLC to set off an alarm because the horizontal sensor and the potentiometer don't match.
So time ago an engineer arrived with the idea to use proportional instead. So the manifold has been replaced. What need to be done now is the change the valve and modify some programming in the PLC. We still have one analog output unused.
I believe I can do this myself.
In a publication on Allen Bradley's library I found some document and in RSLogix too. I try to understand how it works. Will it be the amplifier of the solenoid valves that will do the work or will it be the PLC that will gradually modify the output signal?
I leave it here.
I would appreciate examples of ramps.
Thank you.
Classic bang-bang controller issue. Slam equipment into wall..equipment either "recoils" or fails. Not a pretty picture. And that's also why the control you have now is called "bang-bang".
Whichever you choose to do. The key is jerk. It's not the best but the simplest is just a ramp. You can do this in an output card but since this is harder to adjust, I prefer to do it in the PLC (keep the hydraulics "dumb"). First, I'll answer your question directly. Then I'll explain why it will help but it is not a total cure-all.
Say for instance, you have a "set point" and an output variable. The goal is to adjust the output to match the set point. But the output is only allowed to change so fast. So run a timer. Whenever the timer expires, calculate "output - set point". If this value is greater than your limiting value, set it equal to the limit. If it's less than the negative limit, again clamp it to the limit. Then add this to your output variable and wait for the timer to expire again. Scan time is also an issue and can affect operations depending on how often you fire it. So either compensate the timer, or run it periodically.
If you choose the periodic approach and it's a PLC-5, Micrologix, or SLC, then you need to set up the "STI". For ControlLogix/CompactLogix, use a periodic task. Either way, read the manuals for more info on this.
Now, real world code will look something like this if you use the timer approach (written in text form...type them into Logix if this is hard for you to read):
TON (timer on delay). Use the highest resolution timer available. Set it to 1 second. Let's assume a PLC-5 for clarity here. So we have:
TON T4:0 0.01 100 0
Next, if the timer reaches 100 ms (we're going to fire once every 100 ms in this case), flag it:
GRT T4:0.ACC 10 OTE B3:0/0
Next, "reset" the timer by subtracting 100 ms. The fractional amount will accumulate from scan to scan and keep this function operating with a 100 ms cycle even as the scan time varies:
XIC B3:0/0 SUB T4:0.ACC 10 T4:0.ACC
Next, do the subtraction if N7:0 is the set point and N7:1 is the output. N7:2 will be the difference:
SUB N7:0 N7:1 N7:2
Now, check the positive case (I'm clamping to 10 units here...adjust this to get the speed you want):
GRT N7:2 10 MOV 10 N7:2
And the negative:
LES N7:2 -10 MOV -10 N7:2
Next, add this to the output register:
ADD N7:2 N7:1 N7:1
This system deals with speed only and keeps it under control. It will ramp up/down if the output is controlling the flow (speed) of a hydraulic system through a flow control valve, and so controlling most of the problem (instant changes in acceleration). In this case, you will be limiting the rate of change of the acceleration to a fixed amount. If you need finer control (if the system is "cogging"), then decrease the timer limits. If you want to speed up/slow down faster, then change the limits on the acceleration/deceleration.
Do NOT use a pressure control valve (prop valve) for this. You need a flow control valve. Remember...speed is a function of flow, and power (torque) is a function of pressure. Most folks get this part screwed up.
There is still a "3rd order" thing called "jerk" which will be noticeable. It won't be nearly as bad as it was but purists will point this out. If you want to go after this, best thing to do is to put in a real motion controller. I suggest you buy one from Delta Computer Systems since they specialize in hydraulics. I also suggest NOT using one from a hydraulics or pneumatics company because these tend to be hard to use and kind of finicky (and often buggy as all get out).
In addition, you mentioned potentiometer. These are not known for accuracy or reliability in areas where they get used frequently. I suggest you consider an encoder instead. They will last much longer and are much more accurate and reliable. In fact if you use a motion controller (or if you switch to the built-in one in a ControlLogix or CompactLogix PLC), the code is already written for you. You just have to configure it. It will easily allow you to set maximum acceleration/deceleration limits (which is the problem you are fighting). If not, one additional thing you can do with your motion control code is that you can slow down/stop before you hit the mechanical stop so this problem goes away entirely...just issue a stop command in the PLC at some software set points.