Anda di halaman 1dari 37

Design of a Feedback Compensator for a Position

Control System

1 | Page
TABLE OF CONTENTS
Design of a Feedback Compensator for a Position Control System..................1
TABLE OF CONTENTS.......................................................................................2
LIST OF FIGURES..............................................................................................3
Introduction..................................................................................................4
Control Systems........................................................................................4
OBJECTIVE.....................................................................................................6
Design objectives......................................................................................6
Given parameters......................................................................................6
CONTROL STRATEGY.....................................................................................7
SIMULINK Modeling....................................................................................7
Step Response Analysis.............................................................................7
Calculation of Controller Gain....................................................................8
Simulation with Calculated value of K.....................................................11
Reducing Rise time Using Gain................................................................12
Adding Velocity Feedback........................................................................14
Root Locus Method..................................................................................14
Simulation with Calculated Value of Kv...................................................18
State space Techniques...........................................................................20
EFFECTS OF NONLINEARITIES.....................................................................24
Saturation................................................................................................24
Deadband................................................................................................25
DISTURBANCE REJECTION...........................................................................31
Conclusion..................................................................................................34
MATLAB CODE.............................................................................................35
References...............................................................................................38

2 | Page
LIST OF FIGURES
Figure-1: A feedback control system................................................................5
Figure-2: Simulink Model of Basic System........................................................7
Figure-3: Step response without modulating control gain................................8
Figure-4: Simulation with calculated K value..................................................12
Figure-5: Simulation with increased gain K....................................................13
Figure-6: Control setup with added velocity feedback loop............................14
Figure-7: Root Locus.......................................................................................17
Figure-8: Step response with Kv.....................................................................19
Figure-9: State space model...........................................................................22
Figure-10: Step response for state space simulation.....................................23
Figure-11: SIMULINK model with saturation..................................................24
Figure-12: Responses with and without saturation........................................25
Figure-13: SIMULINK model with dead band..................................................26
Figure-14: Responses with and without dead band.......................................27
Figure-15: Adding integral control.................................................................28
Figure-16: Step response with deadband and integral control......................29
Figure-17: Step response with dead band and integral control (increased Kv)
30
Figure-18: Model with Disturbance................................................................31
Figure-19: Effects of step disturbance...........................................................32

3 | Page
Introduction
As technology evolves and different kinds of machines become available,
precise control of the machine is more and more important. One of the most
well-known and robust control techniques is feedback control. In this type of
control we take one or more than one parameters of the system and feed
them back to a controller which compares the feedback signal with the
desired signal and generates an input for the machine under control. The
controller parameters are managed such that this input ensures the machine
behaves in the desired weight. This Assignment is an exercise of designing
and tuning a control system such that the desired response is achieved.

Control Systems

With advancements in technology, a humans have started to use a number


of machines for assisting them or performing tasks in a faster and more
efficient way. These machines are only useful when they perform their
assigned role with as much accuracy as possible. For example a heating
system that cannot maintain the desired temperature is not of much use.
Similarly, an aircraft that cannot follow its desired route will never reach its
destination. With this requirement, a branch of engineering known as
Control Systems Engineering has emerged. The study and design of control
systems deals with techniques and methods that can be used for obtaining
desired behavior from different real world systems, with as much precision as
possible.

To control a system, essentially means manipulating it to give us the


performance we desire. The mechanism used for achieving this is known
as a control system. A control system is a combination of electrical,
mechanical and computational elements that work together to keep the
performance of a system within desired bounds. Many strategies for
designing control systems are available, the most common being feedback
control that is shown in the following block diagram:-

4 | Page
Figure-1: A feedback control system

The signals and blocks in the above diagram are explained below:-

Plant. This is the system under control. It can be a simple system such as the
DC motor or a complex one like an aircraft.
Input. This is the signal that is given to the plant. For a DC motor this will be
voltage.
Output. This is the output that is coming from the plant. For a DC motor this
will be the position / velocity.
Reference (or command) Output. This is a signal that we generate, and
give it to control system. This indicates our desired output.
Error Signal. The control system generates this signal by comparing the
command input to the plant output. This indicates how close the plant output
is, to our desired output.
Controller. This is the brain of the control system. The controller takes in the
error signal, and calculates how much input should be given to the plant in
order to achieve desired output.

5 | Page
OBJECTIVE
The objective of the lab is to analyze and control the position of a system.
The system consists of a motor whose position and velocity can be
measured. The motor transfer function is as below:

Km
G ( s )=
Ts+1

Design objectives

The design objectives for this project are as below:

- for the given system, a feedback controller needs to be designed such that
- the overall response has a minimum rise time and no overshoot to a step in

Given parameters

The following parameters can be used from previous measurements:

6 | Page
CONTROL STRATEGY
SIMULINK Modeling

First of all we model the system in SIMULINK. We use the transfer function
block to represent the given transfer functions, and gain blocks to represent
the different gains. :

Figure-2: Simulink Model of Basic System

Step Response Analysis

We perform a step response analysis, without modulating the control gain K.


So, we keep it 1 to give the effect as if its not there. The response is shown
below:

7 | Page
Step Response for K = 1, Kp = 5.7, Kv = 0
2

1.8

1.6

1.4
Motor Position [rad]

1.2

0.8

0.6

0.4

0.2

0
0 2 4 6 8 10 12 14 16 18 20
Time [s]

Figure-3: Step response without modulating control gain

We observe that the response has unwanted oscillations while we need no


overshoot. So, we make mathematical calculations to find a suitable value of
gain K that will give us the desired critically damped response.

Calculation of Controller Gain

Open loop transfer function:

1 Km 46
G= = 2
s Ts+1 s +s

In feedback configuration, the closed loop transfer function will be:

KG
CL=
1+ KG K p

8 | Page
46 K
s 2+ s

46 K K p
1+ 2
s +s

46 K
s 2+ s
2
s +s +46 K K p
s 2+ s

46 K
2
s + s+ 46 K K p

There is another Kp after the step input, therefore, the overall closed loop
system becomes:

46 K K p
CL( s)= 2
s + s+ 46 K K p

Plugging in the value of Kp:

262.2 K
CL( s)= 2
s + s+262.2 K

Comparing this transfer function with the standard second order


2n
transfer function s 2+2 n s+2n , we get the following relations:

s 2 +s +262.2 K =s2 +2 n s + 2n

9 | Page
We have:
2 n=1

For zero overshoot, we need to be:

=
| ( )|
ln
os
100
=1


2
2
( ( ))
+ ln
os
100

Therefore:
2 n=1

2 ( 1 ) n=1

n=1/2

Now, comparing the constant terms:

2n=262.2 K

2
1
()
2
=262.2 K

1
=262.2 K
4

10 | P a g e
1
=K
4 (262.2)

K=9.5347 e4

Therefore, this value of K will give us a critically damped response.

11 | P a g e
Simulation with Calculated value of K

We simulate the system with the calculated K value:

K=9.5347e-4;
sim('simulink_model',[0 tf]);%run simulink simulation

figure;
plot(t,y);%plot results
title(['Step Response for K = ' num2str(K) ', Kp = ' num2str(Kp) ', Kv = '
num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

12 | P a g e
Step Response for K = 0.00095347, Kp = 5.7, Kv = 0

0.8
Motor Position [rad]

0.6

0.4

0.2

0
0 2 4 6 8 10 12 14 16 18 20
Time [s]

Figure-4: Simulation with calculated K value

We observe that we have a critically damped response with no overshoot.


So, one of the requirements has been met. However, the rise time is large.
We will try to reduce it now.

13 | P a g e
Reducing Rise time Using Gain

Increasing the gain of a feedback control loop reduces rise time. We know
this from our knowledge of control theory. Therefore we increase the gain
and see its effect:

14 | P a g e
Step Response for K = 0.0045, Kp = 5.7, Kv = 0

0.8
Motor Position [rad]

0.6

0.4

0.2

0
0 2 4 6 8 10 12 14 16 18 20
Time [s]

Figure-5: Simulation with increased gain K

We observe that while the rise time has reduced, but increasing the gain has
resulted in an overshoot. The response is not critically damped anymore.
Therefore we need a different technique to ensure a small rise time and no
overshoot.

Adding Velocity Feedback

Our aim is to control the position of the system. We have position feedback
available. However when we try to use this position feedback for reducing
the rise time we get an increased overshoot which is not desired. We know
from our control theory and background that overshoot can be reduced by
including a derivative gain which has a damping effect. Therefore now we
will use a controller of the form:

15 | P a g e
C ( s )=K p+ s K v

This is the PD controller. The gain for position is Kp while that for velocity is
Kv. Now we modify our control scheme by adding a new control loop, with
gain Kv. The control loop as shown below:

Figure-6: Control setup with added velocity feedback loop

Root Locus Method

For root locus. The characteristic equation will be:

C KGK P
=
R 1+ KGH

K 262.2
S(S+1)
CTLF=
K
1+ ( K S K V )
S (S +1) P

16 | P a g e
K 262.2
CTLF= 2
S +S +46 KK P+ S 46 KK V

K 262.2
CTLF= 2
S +S ( 1+ 46 KK V ) + 46 K P

2n = 462 *5.7

n 465.7 =16.2
=

2 n= KV
=1+46k *

32.41
KV
= 46

KV
= 0.68

We can graphically verify this calculation. We use this transfer function to


make a root locus:

%root locus

17 | P a g e
s=tf('s');%laplace variable
Kp=5.7;%Kp
G=(46*s)/((s^2+s+46*Kp));%G

figure;%figure
rlocus(G);%rlocus

Root Locus
20

15

10

5
Imaginary Axis

0
System: G
Gain: 0.682
-5 Pole: -16.2
Damping: 1
Overshoot (%): 0
-10
Frequency (rad/sec): 16.2

-15

-20
-30 -25 -20 -15 -10 -5 0 5
Real Axis

Figure-7: Root Locus

Root locus shows how the closed-loop pole locations will change when the
gain Kv is varied. Now we want both closed loop poles to be at the real axis
just before becoming complex. This would ensure that the damping ratio is
one and the system is critically damped. Therefore we use the mouse to
drag the point along the root locus and see the value of Kv required to obtain
this critically damped pole locations. We find that the value of Kv that gives
us these poles is:

18 | P a g e
K v =0.681

Thus this value of gain will give us the desired response without overshoot

Simulation with Calculated Value of Kv

We use the calculated value of Kv to perform simulation:

%simulation with different Kv


K=1;Kv=0.682;
tf=1;%final time
sim('simulink_model',[0 tf]);

figure;
plot(t,y);
title(['Step Response for K = ' num2str(K) ', Kp = ' num2str(Kp) ', Kv = '
num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

19 | P a g e
Step Response for K = 1, Kp = 5.7, Kv = 0.682

0.8
Motor Position [rad]

0.6

0.4

0.2

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time [s]

Figure-8: Step response with Kv

We observe that Kv serves to damp the response, and we get a low rise time
without compromising the overshoot which is zero.

20 | P a g e
State space Techniques

We have the given system:

Q 46
=
P s(s+1)

The state space representation will be:

[ ] [ ][ ] [ ]
x1
x2
=0 1
x1
+ 0 P
0 1 x 2 46

y=[ 1 0 ]
[]
x1
x2

Where:

[ ] [ ]
A= 0 1 , B= 0 , C=[1 0]
0 1 46

K=[ K p K v ]
Let , we calculate:

( ( [ ]
det ( sI ( ABK ) ) =det sI A 0 [ K p K v ]

46 ))

(
det sI ( A
[ 0
])
0 )
46 K p 46 K v

21 | P a g e

( [
det sI ( 0 0
46 K p (1+ 46 K v )
)
])

([ ] [
det s 0 (
0 s
0 0
46 K p (1+ 46 K v )
)
])
1
det
([ s 1
46 K p s+(1+46 K v ) ])
s 2+ ( 1+46 K v ) s+ 46 K p

We need fast response and no overshoot, so :

k =1, =1

For =1 , both poles will be equal. Let poles be a. Desired characteristic

equation will be:

( s +a ) ( s +a )=s 2 +2 as+a 2

Comparing with system characteristic equation:

s 2 + ( 1+46 K v ) s+ 46 K p=s2 +2 as+ a2

We get:
2
a =46 K p=46 ( 5.7 )=262.2 a=16.2

22 | P a g e
So,

2 a=1+ 46 K v K v =0.68

Using the calculations we have compared the given control technique with
state space techniques. In our control system we have a position feedback is
represented by the gain Kp, and the velocity feedback is represented by the
gain Kv. Thus we represent our system transfer function in state space form
considering the position and velocity as states. Then we calculate the state
feedback gain that will place both poles at equal critically damped location.
The resulting Kv we get is the same as we calculated using frequency
domain techniques.

We make a Simuink model for state space:

Figure-9: State space model

The simulation and results are below:

23 | P a g e
%state space simulation
clear tf;
%state space form
A=[0 1;0 -1];B=[0;46],C=[1 0];
Ksf=[Kp Kv];%state feedback

K=1;Kv=0.682;
tf=1;%final time
Nbar=1/0.1754;%pre compensation
sim('mdlss',[0 tf]);

figure;
plot(t,y);
title(['State Space : Step Response for K = ' num2str(K) ', Kp = ' num2str(Kp)
', Kv = ' num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

24 | P a g e
State Space : Step Response for K = 1, Kp = 5.7, Kv = 0.682

0.8
Motor Position [rad]

0.6

0.4

0.2

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time [s]

Figure-10: Step response for state space simulation

We observe that desired specifications are met.

EFFECTS OF NONLINEARITIES
The control situation is not very smooth in real life. We have assumed all
components of the control system to be ideal, however, there are a number
of nonn linearities that effect the performance. Here we explore two of them.

Saturation

We modify the simulink model to include the effect of saturation:

25 | P a g e
Figure-11: SIMULINK model with saturation

Keeping saturation limits to +0.5, we perform simulation and compare it with


the response without saturation:

26 | P a g e
State Space : Step Response for K = 1, Kp = 5.7, Kv = 0.682 with Saturation : Step Response for K = 1, Kp = 5.7, Kv = 0.628

1 1

0.8 0.8

Motor Position [rad]


Motor Position [rad]

0.6
0.6

0.4
0.4

0.2
0.2

0
0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time [s]
Time [s]

Figure-12: Responses with and without saturation

We observe that saturation has caused a delay in rise time. The responses
now rises slowly but the overshoot is still zero as needed. We conclude that
our system is robust to the effects of a reasonable actuator saturation.

Deadband

This is another real world non linearity that effects all systems. To see the
effcts we develop a SIMULINK model:

Figure-13: SIMULINK model with dead band

27 | P a g e
Simulation results:
%effect of dead band
%simulation
K=1;Kv=0.628;
tf=2;%final time
sim('mdlDead',[0 tf]);

figure;
plot(t,y);
title(['with Dead Band : Step Response for K = ' num2str(K) ', Kp = '
num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

figure;
plot(t,u);
title(['with Dead Band : Control Input for K = ' num2str(K) ', Kp = '
num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines

State Space : Step Response for K = 1, Kp = 5.7, Kv = 0.682

1 with Dead Band : Step Response for K = 1, Kp = 5.7, Kv = 0.628

0.8 1
Motor Position [rad]

0.6 0.8
Motor Position [rad]

0.4 0.6

0.2 0.4

0 0.2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time [s]
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time [s]

Figure-14: Responses with and without dead band

28 | P a g e
We observe that deadband has affected the steady state value which is not 1
as we want it to be. We propose the addition of an integral control term, in
order to manage the effects of this. The new control structure becomes:

Figure-15: Adding integral control

We simulate this system:

29 | P a g e
%simulation
K=1;Kv=0.628+0*0.2;Ki=2;
tf=2;%final time
sim('mdlDead_PI',[0 tf]);

figure;
plot(t,y);
title(['with Dead Band and Integral Control: Step Response for K = '
num2str(K) ', Kp = ' num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

figure;
plot(t,u);
title(['with Dead Band and Integral Control: Control Input for K = '
num2str(K) ', Kp = ' num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines

with Dead Band and Integral Control: Step Response for K = 1, Kp = 5.7, Kv = 0.628

0.8
Motor Position [rad]

0.6

0.4

0.2

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time [s]

Figure-16: Step response with deadband and integral control

30 | P a g e
We observe that the steady state error has now been reduced. But there is a
small overshoot now, which we mitigate by increasing derivative gain (Kv):
%effect of dead band and PI
%simulation
K=1;Kv=0.628+0.2;Ki=2;
tf=2;%final time
sim('mdlDead_PI',[0 tf]);

figure;
plot(t,y);
title(['with Dead Band and Integral Control: Step Response for K = '
num2str(K) ', Kp = ' num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

figure;
plot(t,u);
title(['with Dead Band and Integral Control: Control Input for K = '
num2str(K) ', Kp = ' num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines

31 | P a g e
with Dead Band and Integral Control: Step Response for K = 1, Kp = 5.7, Kv = 0.828

0.8
Motor Position [rad]

0.6

0.4

0.2

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time [s]

Figure-17: Step response with dead band and integral control


(increased Kv)

The control system has been able to reject the effects of dead band by using
integral control and bring back the zero steady state error. The overshot s
also as desired by using the derivative control gain.

Conclusion
We have been given a system. First of all we obtained its step response
using simulink. From the response we noted that the system has no
overshoot but a large rise time. Therefore we systematically proceeded to
add an additional control loop with gain Kv. Then we plot the root locus by
varying this gain. The point where the root locus just leaves the real axis

32 | P a g e
was our point of interest because at this location the poles are critically
damped and we get no overshoot. We calculate that the value of Kv required
to achieve these poles. Using this value perform the simulation in simulink
and observe that the response has overshoot and a small rise time.
Therefore we can conclude that there are many cases in which sample gain
adjustment will not be to meet the specifications .In these case additional
dynamics must be introduced into the system to meet our performance
requirement. In the end, we analyzed the system for non linearities and
suggested suitable controller modifications.. Finally, we can conclude that
our control system is ready to be used in a real world situation.

33 | P a g e
MATLAB CODE
clc;clear all;close all;%clear screen and variables

%parameters
Kp=5.7;
K=0.00095;
Km=46;
T=1;
Kv=0;

%simulation
K=1;Kv=0;
tf=20';%final time
sim('simulink_model',[0 tf]);

figure;
plot(t,y);
title(['Step Response for K = ' num2str(K) ', Kp = ' num2str(Kp) ', Kv = '
num2str(Kv)]);
grid on;%show grid lines
%axis([0 tf 0 1.2]);%axis
tf=20';%final time
sim('simulink_model',[0 tf]);

K=9.5347e-4;
sim('simulink_model',[0 tf]);%run simulink simulation

figure;
plot(t,y);%plot results
title(['Step Response for K = ' num2str(K) ', Kp = ' num2str(Kp) ', Kv = '
num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

%simulation with different K


K=0.0045;Kv=0;
tf=20;%final time
sim('simulink_model',[0 tf]);

figure;
plot(t,y);
title(['Step Response for K = ' num2str(K) ', Kp = ' num2str(Kp) ', Kv = '
num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

%simulation with different Kv


K=1;Kv=0.682;
tf=1;%final time
sim('simulink_model',[0 tf]);

figure;
plot(t,y);

34 | P a g e
title(['Step Response for K = ' num2str(K) ', Kp = ' num2str(Kp) ', Kv = '
num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

%state space simulation


clear tf;
%state space form
A=[0 1;0 -1];B=[0;46],C=[1 0];
Ksf=[Kp Kv];%state feedback

K=1;Kv=0.682;
tf=1;%final time
Nbar=1/0.1754;%pre compensation
sim('mdlss',[0 tf]);

figure;
plot(t,y);
title(['State Space : Step Response for K = ' num2str(K) ', Kp = ' num2str(Kp)
', Kv = ' num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

%root locus
clear tf;
s=tf('s');%laplace variable
Kp=5.7;%Kp
G=(46*s)/((s^2+s+46*Kp));%G

figure;%figure
rlocus(G);%rlocus

%effect of saturation
%simulation
K=1;Kv=0.628;
tf=1;%final time
sim('mdlSat',[0 tf]);

figure;
plot(t,y);
title(['with Saturation : Step Response for K = ' num2str(K) ', Kp = '
num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

figure;
plot(t,u);
title(['with Saturation : Control Input for K = ' num2str(K) ', Kp = '
num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines

%effect of dead band


%simulation
K=1;Kv=0.628;

35 | P a g e
tf=2;%final time
sim('mdlDead',[0 tf]);

figure;
plot(t,y);
title(['with Dead Band : Step Response for K = ' num2str(K) ', Kp = '
num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

figure;
plot(t,u);
title(['with Dead Band : Control Input for K = ' num2str(K) ', Kp = '
num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines

%effect of dead band and PI


%simulation
K=1;Kv=0.628+0.2;Ki=2;
tf=1;%final time
sim('mdlDead_PI',[0 tf]);

figure;
plot(t,y);
title(['with Dead Band and Integral Control: Step Response for K = '
num2str(K) ', Kp = ' num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines
axis([0 tf 0 1.2]);%axis

figure;
plot(t,u);
title(['with Dead Band and Integral Control: Control Input for K = '
num2str(K) ', Kp = ' num2str(Kp) ', Kv = ' num2str(Kv)]);
grid on;%show grid lines

36 | P a g e
References

[1] Franklin, G.F., Powell, J.D., Emami-Naeini, A. and Powell, J.D., 1994. Feedback control of
dynamic systems (Vol. 2). Reading: Addison-Wesley.

[2] Nise, N.S., 2007. CONTROL SYSTEMS ENGINEERING, (With CD). John Wiley & Sons.

37 | P a g e

Anda mungkin juga menyukai