1. Apr 12, 2010

### susmatt

not sure why my earlier post never showed, but I'll try again.

I'm doing some work to control a pump that's the input to a pneumatic system. I developed a transfer function that defines the plant as the output pressure divided by the input pressure. I also developed a controller: PID&I (double integrator b/c of a zero at the origin). The pump of my system can not be adjusted to change the flow. It can only on or off. So, we've (my advisor and I) have decided to control the system by duty cycling the pump.

To determine the length of the time the pump should be on, my advisor instructed me to rearrange my block diagram. Originally it was just a plant*controller with a step input and unity feedback:
Original TF = PC/(1+PC) where P=plant and C=controller.

The new block diagram for determining the length of time the pump should remain on is the controller in the feedforward path and the plant in the feedback so the new TF
New TF = C/(1+CP). I believe this TF is the pressure after the controller divided by the input pressure.

My adviors expects the result to be an s-shaped curve where the initial slope is zero, the function ramps to 1. and the final slope of the function is zero. I however do not get this. I get just a ramp.

Does anyone understand this approach? Is it possible that there's a different way to do this?

2. Apr 13, 2010

### susmatt

Control Theory and PID tuning

I've been working to find a PID controller for the following TF
As
TF = --------------------------
B1s^3 + B2s^2 + B3s + B

The "s" term in the numerator is giving a great deal of grief. I've been trying to use a PID controller with an additional integrator to cancel the zero at the pole. I used a ramp and followed Ziegler-Nichols first method to determine the best Ti and Td values. I then plotted the open loop Plant plus controller using Z-N Ti and Td values to find the system gain which resulted in a damping coefficient of .707.

The actual system input is a step. When I plot the closed loop system response with a step input and increase Kp from the Z-N value, the system damps more and more. This should not be. The system should have greater overshoot and more oscillations with increased Kp values. Does anyone know why I'm getting this result? The system behaves as it should and damps more with increased Kd. Any advice would be appreciated. Thanks.

3. Apr 13, 2010

### Staff: Mentor

They both posted here in EE. I'll merge them together into one thread for you.

4. Apr 13, 2010

### susmatt

These are a bit different. The first posted never went through so I rewrote it, but then I wrote a different post. I just hope someone can help.

5. Apr 13, 2010

### Okefenokee

Nice, interesting problem.

The duty cycle can only be 0% to 100% so your controller (in the time domain) can only output 0 to 1. It wouldn't make any sense to have, for example, a 200% duty cycle. I whipped up a little drawing.

When the error signal is high, we want the controller to put out 100% so that the pressure can catch up. When the error signal is low, we want the controller to slow down. So what kind of function can be limited from 0 to 1, curved into an S shape, and have a slope of 0 at the ends? A Bezier curve!

This function can be piecewise continuous. It's a straight line on the ends and a Bezier curve between the points. Because it's piecewise continuous, you should be able to do a Laplace transform of it and then you can do any stability analysis that you need.

There may be better ideas for a function but I hope this helps.

Edit: fixed the pictures.

Last edited: Apr 13, 2010
6. Apr 13, 2010

### Okefenokee

I just had a thought. Converting a parametric equation like the Bezier curve to a regular equation can get nasty so maybe I should provide a little more. In fact, you may not be interested in parametric equations at all so let me just cut to the chase.

I made up a cubic Bezier and then constrained it and converted it from parametric variables to function variables. The following controller would have all the properties you need.

$$x = e(t)$$ the error signal e(t)

$$C(x) = 0$$ for x < 0.

$$C(x) = \frac{3}{9}x^2 - \frac{2}{27}x^3$$ for 0 =< x < 3

$$C(x) = 1$$ for 3 =< x .

It's piecewise continuous. The derivative approaches 0 from either direction at [x=0] and [x=3]. It is S-shaped so it should have good response properties (it will slow the pump gracefully as the error signal approaches 0).

You can scale the controller by substituting (x -> ax) and stretch or shrink the curve (make it steeper or more shallow). Also, this is not the only S shaped curve that will fit your needs. There are lots more you could try (think higher order).

7. Apr 13, 2010

### susmatt

Thank you, and I may end up using this approach. In the mean time can anyone explain why I get a linear function when the expected result is an "s-shaped" curve?

I little more background.

My open loop system is a controller * Plant with a step input and unity feedback. My advisor suggested I look at the output after the controller before the plant and plot this TF with a step input.

step---------controller------------output
| |
---------Plant----------

The TF for this configuration is
0.1741 s^7 + 137.8 s^6 + 511.8 s^5 + 888.8 s^4 + 662.1 s^3 + 166.9 s^2
----------------------------------------------------------------------------------------
0.002721 s^7 + 2.147 s^6 + 33.96 s^5 + 75.43 s^4 + 89.24 s^3

Since the numerator is larger than the denominator I divided in MATLAB to find the remainder and quotient.

The TF of the remainder divided by the original denominator
0.4 s^6 - 1661 s^5 - 3938 s^4 - 5048 s^3 + 166.9 s^2
---------------------------------------------------------------------------
0.002721 s^7 + 2.147 s^6 + 33.96 s^5 + 75.43 s^4 + 89.24 s^3

The plot of this this last TF with a step input is a linear function. My advisor expects this to result in an "s-shaped" curve. I need the "s-shaped" curve to determine how long the pump should stay on. The length of time is hard coded into the program. The pump is only on for this amount of time. If the desired pressure is not reached the pump turns on again but only for the length of time specified in the code. This is to help prevent overshoot.

Why am I getting a linear function when the expected result is an "s-shaped" curve?