• Tidak ada hasil yang ditemukan

PDF Lecture 2: PID Control of a cart - Indian Institute Of Science

N/A
N/A
Protected

Academic year: 2024

Membagikan "PDF Lecture 2: PID Control of a cart - Indian Institute Of Science"

Copied!
8
0
0

Teks penuh

(1)

Lecture 2: PID Control of a cart

Venkata Sonti

Department of Mechanical Engineering Indian Institute of Science

Bangalore, India, 560012 This draft: March 12, 2008

1 Proportional Integral Derivative (PID) Control

PID control is a very useful method used in feed-back control systems. The error generated after the comparison between the measured signal and the target signal is proportionally multiplied (proportional), integrated (integral) and differentiated (derivative) and the outputs of the three operators are linearly summed to generate the signal applied to the actuator. This is shown in figure 1.

+

1

-

ms+b

c(t) k k C(s)

kp sI s + + d

r(t)=10 R(s)

Figure 1: Block diagram for a PID controller.

Before starting, for the closed loop system shown in figure 2 the transfer function between output and input is given by

T F = G 1 +GH

2 PID cruise control of a cart

Problem statement:A constant force F is applied on a cart of mass m as shown in figure 3. There is a drag force on the cart which is proportional to the velocity. Form= 1000,b= 50N sec/mand F = 500N the design specification is that the cart should reach 10m/sec in less than 5 seconds;

with less than 10% overshoot and less than 2% steady state error.

Solution:The equation of motion can be written for the velocity and is as follows

mV˙(t) +bV(t) = F (1)

(2)

+ -

r(t) c(t)

G

H

Figure 2: Closed loop system transfer function

bv M

F V

V

Figure 3: A force applied to a cart. Cruise control.

y(t) = V(t)

(2) Taking the LT of the above equations we get

msV(s) +bV(s) = F(s) (3)

Y(s) = V(s) Y(s) = F(s)

ms+b

(4) The block diagram and the step response for this open loop system are shown in figure 4.

It can be seen that the cart reaches the velocity of 10m/sec at around 100 secs. In order to reach the design spec., let us attempt a simple proprtional controller the block diagram for which is shown in figure 5.

2.1 Proportional controller

The closed loop transfer function after applying the proportional controller is given by

Y(s) = Kp

ms+ (b+Kp)R(s),

whereKp is the proportional gain andR(s) = 1/s, the LT of a step input. It can already be seen that for very largeKp,Y(s) =R(s). Lets see the step response of the proportional controller for aKp= 100 andKp= 600.

(3)

r(t)

R(s) actuator

1 ms+b

c(t) C(s)

Time (sec.)

Amplitude

Step Response

0 20 40 60 80 100 120

0 2 4 6 8 10

From: U(1)

To: Y(1)

Figure 4: Step response of the cart. open loop.

Kp 1

r(t)=10 R(s)

+- ms+b

c(t) C(s)

Time (sec.)

Amplitude

Step Response

0 5 10 15 20 25 30 35 40

0 2 4 6 8

10 Proportional Controller Kp=100 and Kp=600

To: Y(1)

Kp=100 Kp=600

Figure 5: Proportional controller. Kp=100 and 600.

(4)

Figure 5 shows the response after proportional control for the two values of Kp = 100,600.

It can be seen that there is a steady state error which can be reduced by increasing the gain Kp.

Thus, a proportional controller itself should ’ideally’ suffice. However, the Kp value needed is actually very large for 2% steady state error, which may not be deliverable by your amplifier. And even if one has such an amplifier, in actuality there are a large number of noise sources corrupting the signals which when amplified will send the system to instability. (large gain can make the system unstable).

Note, that at steady state, if we use the Final Value Theorem and drop thems term, then Y(s)b= (R(s)−Y(s)Kp,

which means Kp has to be infinite for R−Y to be zero. Y(s)b is the drag force. Thus, the proportional force is used up in overcoming the drag force. If the target value is reached by Y(s) then error is zero, and the proportional force is zero. In the absence of any force, the velocity will reduce due to drag. It will reduce till a balance is reached as in the above equation.

2.2 Proportional-Integral controller

In order to remove the steady state error, we use an Integral controller. The block diagram is given in figure 6.

r(t)=10 1 R(s)

+ - ms+b

c(t) k

p

C(s)

k

I

+ s

Figure 6: Block diagram for a PI controller.

The resulting closed loop transfer function is given by Y(s) = Kps+Ki

ms2+ (b+Kp)s+KiR(s)

The immediate observation from the above transfer function is that the Integral controller raises the order of the system (no. of poles). We will also see that it completely eliminates the steady state error (even for a small value of Ki). The curves in figure 7 show the response for the PI controller forKi= 5,40,200 andKp= 600. The response for aKi= 5 is going towards 10m/sec at a slow rate. The right figure is a zoomed version of the left side curve.

It is worth noting that along with eliminating the steady state error, Ki reduces rise time (response is quicker), but causes an overshoot (which may be undesirable).

Let us find the error expression, E(s) = R(s)-Y(s) E(s) = R(s)−

Kps+Ki

ms2+ (b+Kp)s+KiR(s) (5)

(5)

Time (sec.)

Amplitude

Prop−Int Controller Kp=600 and Ki=5,40,200

0 50 100 150 200

0 2 4 6 8 10 12

From: U(1)

To: Y(1)

Kp=600, Ki=5 Kp=600, Ki=40 Kp=600, Ki=200

Time (sec.)

Amplitude

0 5 10 15 20

0 2 4 6 8 10 12

Prop−Int Kp=600 and Ki=5,40,200

To: Y(1)

Kp=600, Ki=5

Kp=600, Ki=40 Kp=600, Ki=200

Figure 7: PI controller. Kp=600,Ki=5,40,200.

= (ms2+ (b+Kp)s+Ki)R(s)−(Kps+Ki)R(s) ms2+ (b+Kp)s+Ki

= (ms2+bs)

ms2+ (b+Kp)s+KiR(s)

The integral controller, integrates this error. Integration is multiplication by 1/s in the Laplace domain. And then replace R(s) with 10/s, then take the final value theorem.

IE(s) = 1 s

(ms2+bs) ms2+ (b+Kp)s+Ki

10 s Taking the final value theorem

Lim s− −>0 sIE(s) =Lim s− −>0 (ms+b)

ms2+ (b+Kp)s+Ki10

This is 10b/Ki, which when multiplied by Ki (to get the integral controller force) is 10b=500N!

3 PID Controller

The full PID controller is shown in figure 8 and is compared with the previous PI controller. The effect of the derivative controller is seen as a damping effect, reducing the overshoot and also reducing the settling time.

After experimenting with gain values we can even achieve the following. Using the values given the following response is obtained. (figure 9). This meets all the specs.

4 Behavior of the PID controller gains

In this section we will try to get a first cut understanding of why the PID gains have the effects that they do.

(6)

+ 1

- ms+b

c(t) k k C(s)

kp+ +sI ds r(t)=10

R(s)

Time (sec.)

Amplitude

0 5 10 15 20

0 2 4 6 8 10

12 PID controller Kp=600, Ki=200, Kd=400 Kp=600, Ki=200

Kp=600, Ki=200, Kd=400

Figure 8: PID controller. Kp=600, Ki=200, Kd=400.(compared with the previous PI controller).

Time (sec.)

Amplitude

Step response with PID, Kp=1500,Ki=100,Kd=400

0 5 10 15 20 25 30

0 2 4 6 8 10 12

Figure 9: PID controller. Kp=1500, Ki=100, Kd=400.(compare with the previous PID controller).

Table 1: PID gains and their effects on second order response characteristics.

PID Gain Rise Time Overshoot Settling Time SS-Error Kp decrease increase small effect decrease Ki decrease increase increase eliminate Kd small effect decrease decrease small effect

(7)

4.1 The proportional gain Kp

The proportional controller gives an output directly porportional to the error between r(t) and c(t) and hence it should reduce the rise timetr and the steady state error. It does not eliminate the steady state error and we will answer this later. If the error goes to zero E(s) is zero then output of the controller is zero and the system will slow down with damping. There could be a response C(s) such that (R(s)-C(s)) Kp is such that it is equal to C(s)*(Ms+b). This is the value at which the system stabilizes with a non-zero steady state error.

It also causes an overshoot which is understandable. Only when the sign on the error has changed that the Kp begins to reduce the overshoot which is a little late. Kp does not anticipate an overshoot and reduce the applied force.

4.2 The integral gain Ki

Time (sec.)

Amplitude

0 0.2 0.4 0.6 0.8 1

−0.4

−0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6

To: Y(1)

step response, error and derivative of error

Step response

Error

Derivative of error C

D A E

B

A

B C

D E

Figure 10: Explanation for Ki and Kd behavior.

The integral controller reduces the rise time, causes an overshoot, increases the settling time (reduces damping) and most importantly eliminates the steady state error.

If the zero error point is reached, i.e., or r(t) = c(t) and the system say (hypothetically) remains there steadily, then the proportional controller does not apply any force, nor does the derivative controller and so the response will slowly fall because of zero force. For example, in the cart example, if the final velocity is reached and the external force stops acting, the drag force will slowly stop the cart. Hence, even when the error is zero a steady force needs to be applied.

The integral controller does this.

The integral controller integrates the error e(t) =r(t)−c(t) and then multiplies it with a gain Ki. At time t= 0, the initial error e(t) is large since the system starts from zero response c(t) = 0 and so the integral quickly rises which in turn increases c(t) till it reaches r(t) at point A (figure 10). At this instant e(t) is zero but not its integral which actually has its maximum value sayφ. However, due to inertia, c(t) crosses r(t) and error becomes negative. Let us suppose that this positive valueφ is sufficient to hold the steady value of 10m/sec. However, as the overshoot

(8)

has occurred, and in parallel the integral value (and the applied force) starts to decrease, the applied force is insufficient to hold the overshot velocity value at point B (drag is high due to high velocity and force is low). The insufficient force and drag bring velocity down. Since, by overshooting, the total integral value falls belowφ, even 10m/sec cannot be held (because 10m/sec can be held byφ). The velocity has to fall and settle below ther(t) = 10 value. Here, the error turns positive and the cycle begins again.

It should be noted that the sign of e(t) cannot remain either positive or negative for long. The integral controller will not allow that. Let us say (hypothetically) that the velocity falls below the value at B, but does not cross over to below r(t). Then, error remains negative and when integrated over a long time, the force due to the integral controller will become negative. This should result after a while in a negative velocity. A negative velocity compared with r(t) becomes r−(−c) = r+c a positive error which should integrate to a positive force leading to a forward velocity.

This also tells us why an overshoot occurs. At the initial stage when the response begins at c(t) = 0, the error e(t) being maximum, the controller output is not just a proportional multiplier but an integrator. This integral of the error rises faster than a mere proportional multiplication.

And although when c(t) rises and crosses r(t) for the first time, the e(t) = 0, the integral by no means is zero and so gives an overshoot. This is also the reason for a reduced rise time tr and increased settling time.

4.3 The derivative gain Kd

Kd is the derivative control gain. At steady state, since the derivative is zero the output of derivative controller is zero. Thus, Kp and Kd are more active at high transients, i.e., at the initial response stage.

The important function of Kd is to reduce overshoot and reduce settling time. Right at the start of response, the error is positive and it remains so till pt. A. However, from start to pt. A, the error derivative is negative. At pt. A, the e(t) changes sign which causes the Kp and Ki terms to retard the motion and even here the Kd remains negative assisting Kp and Ki, thus reducing overshoot. Finally at the response peak, pt. B as the response starts accelerating downwards, Kd just turns positive retarding this negative acceleration and continues to do so till the negative peak D is reached. At D, the response is building for a positive acceleration and Kd become negative to counter this. Thus, Kd damps out developing-accelerations in an anticipatory manner. For the same reason, Kd reduces settling time.

Referensi

Dokumen terkait

The Particles Swarm Optimization (PSO) is used for tuning the PID+PD controller parameter in term of Overshoot (OS), Settling Time (Ts) and Steady-State Error (SSE) via

1-DOF PID controller has showed very impressive compensation of steady-state tracking error for different frequencies and amplitude from analysis of maximum

Pada uji closed loop ,untuk setpoint pH 5 didapatkan nilai karateristik respon maximum overshoot sebesar 19,6 %,Ess ( error steady state ) sebesar 0,04% dan Ts (Time

Simulation results of DFPI controller show that PMSM quickly achieve the speed reference, has small steady state error, no overshoot and reduce the speed

a Settling Time and b Overshoot Set Point Tracking Figure 7 a and b explain the comparison of the PID controller's disturbance rejection response, 1-DOF PID and 2-DOF PID tuning, as

When considering the average values of the results, the use of the proposed PRBM with all design methods reduces both rise-time and settling-time by 2 seconds and, at the same time,

By studying the RG equations near the fixed point where all the wires are decoupled from each other, we find that for a large range of initial values of the Kondo couplings and for any

Vehicle depth control: The vehicle’s control system needs to be able to control the vehicles vertical position in the water with a steady state error of less than 0.2 m and a settling