0% found this document useful (0 votes)
10 views21 pages

Digital Control System Assignment

The document outlines an assignment on the Antenna Pointing System, focusing on understanding and analyzing its open and closed loop behaviors. It includes time-domain analysis, digital controller design (Lag, Lead, PID), and stability analysis using MATLAB simulations. Key findings indicate the impact of sampling period and gain on system response, as well as the design of compensators to enhance performance.

Uploaded by

k7r8v9cjnp
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views21 pages

Digital Control System Assignment

The document outlines an assignment on the Antenna Pointing System, focusing on understanding and analyzing its open and closed loop behaviors. It includes time-domain analysis, digital controller design (Lag, Lead, PID), and stability analysis using MATLAB simulations. Key findings indicate the impact of sampling period and gain on system response, as well as the design of compensators to enhance performance.

Uploaded by

k7r8v9cjnp
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

College of Electronic Technology Bani-Walid

Control Department

7th Semester

Digital Control Systems Lab

Assignment : Antenna Pointing System

Prepared by :
Ali Abdulhamid Alhadi Omar

Ali Aebeed Salah

Moutasim Faraj Milad

Qusay Adham Alhamali


Objectives:
1. understand the Antenna Pointing System.
2. analyze the open & closed loop behavior of the system.
3. Apply time-domain analysis (step/ramp response) to evaluate speed,
accuracy, and steady-state error.
4. Design and implement digital controllers (Lag, Lead, PID) using frequency
and time domain analysis.

Introduction :
We define a servomechanism, or more simply, a servo, as a system in which
mechanical position is controlled. Two servo systems, which in this case form an
antenna pointing system, are illustrated in Figure 1.

Figure 1. Antenna Pointing System.


The electric motor rotates the antenna and the sensor, which is a digital shaft
encoder. The output of the encoder is a binary number that is proportional to the
angle of the shaft. For this example, a digital-to-analog converter is used to convert
the binary number to a voltage 𝑣𝑜 (𝑡) that is proportional to the angle of rotation
of the shaft.

 Open-Loop Analysis:
The open-loop block diagram of the Antenna Pointing System is depicted in
Figure 2. Where the 𝜃(𝑡) is the yaw angle. The angle sensor ( a digital shaft
encoder and the data hold ) , where the units of 𝑣𝑜 (𝑡) are volts and 𝜃(𝑡) are
degrees and for the sample period is T = 0.05 s.

Figure 2. Open-Loop Block Diagram for the Antenna Pointing System.

Using MATLAB we can find the transfer function 𝜃(𝑠)/E(s) .

s = tf('s');
T = 0.05;
Gs = 20/(s*s+6*s);
Gz = c2d(Gs,T,'zoh');
zpk(Gz)

the Transfer function 𝜃(𝑧)/E(z) is :


0.022677 (𝑧+0.9049)
𝐺 (𝑧) = (𝑧−1) (𝑧−0.7408)
(1)

For the open loop system, the output angle should follow the input command, but
there is no mechanism to correct errors or reject disturbances.

This means if we apply input voltage e(t) there is no way for the system to
determine the actual angle of the antenna so adding feedback will be necessary.
Figure 3 shows the step response for the open loop system.
Figure 3. Step response for the open loop system.
 Closed Loop & System Time Response Characteristics:
The closed-loop block diagram of the Antenna Control System is depicted in
Figure 4.

Figure 4. Closed-Loop block diagram of the antenna control system.

The closed loop transfer function 𝜃(𝑧)/R(z) :

0.02268 𝑧+0.02052
𝑇 (𝑧 ) = (2)
𝑧 2 − 1.732𝑧 + 0.749

Adding feedback to the system allows the system to compare the actual angle
with the setpoint ( desired angle ). Figure 5 shows the system response for
T=0.05 sec and r(k)=8V , that means the desired angle is 20°.

Figure 5. Closed loop response for antenna control system.


After adding the feedback, the system achieved the desired angle ( final value is
20° ) in settling time 2.16 sec. This response is obtained at sampling period of
T=0.05 sec, to determent the effect of the sampling period on the system now we
will obtain system response for different values of T.

The following MATLAB code shows the system response for different values of T.

s = tf('s');
T = [0.05 0.5 1];
Gs = 20/(s*s+6*s);
hold on
for i=1:3
Gz = c2d(Gs,T(i),'zoh');
sys = feedback(Gz,0.4)
step(sys)
end
legend('T = 0.05 sec','T = 0.5 sec','T = 1 sec');

Figure 6 Shows system response for unit step and ramp input in different values
of T, system specifications are recorded in Table 1.

Figure 6. Step response for antenna control system with different sampling period.

System
T = 0.05 sec T = 0.5 sec T = 1 sec
characteristics
Time constant
0.8 1 1
(𝜏 sec )
Settling time
2.16 2.53 4.37
(T sec)
Rise time
1.23 0.886 0.72
( T sec )
Steady-state
error due 0.76 0.76 0.76
ramp
Table 1 . Antenna control system characteristics for different sampling period.

From the graph and specification table, we observe that increasing sampling
period will cause the system response to change in bigger steps, and the response
take too much time to reach steady state value, and we get zero steady state error
because the system is type 1.

After we observe the effect of the sampling period on the time response now we
will add gain K to the system and see how this gain can effect the response.

The following MATLAB code shows the system response for different values of K.

s = tf('s');
K = [1 5 10];
hold on
for i=1:3
Gs = K(i)*20/(s*s+6*s);
Gz = c2d(Gs,0.05,'zoh');
sys = feedback(Gz,0.4)
step(sys)
end
legend('K = 1','K = 5','K = 10');

Figure 7 Shows system response for unit step and ramp input in different values
of K, system specifications are recorded in Table 2.

(a) (b)
Figure 7. System responses with different gains.

System
K=1 K=5 K = 10
characteristics
Time constant
0.8 1 1
(𝜏 sec )
Settling time
2.16 2.53 4.37
(T sec)
Overshoot% 0 26.2 48.5
Rise time
1.23 0.886 0.72
( T sec )
Steady-state
0.76 0.16 0.08
error due
ramp
Table 2. Antenna control system characteristics for different gains.

From the graphs and specification table, we observe that the response becomes
faster but with more overshoot. Increasing gain K also reduces the steady state
error. When we increase the gain we should keep it in its range of stability.

 Stability analysis :
The system is said to be stable if all the roots of the characteristic equation lie
inside the unit circle in the z-plane.

For the antenna control system, the following MATLAB code draws the zero pole
locations using pzmap function.

s = tf('s');
G = 20/(s^2+6*s);
Gd = c2d(G,0.05,'zoh');
Sysd = feedback(Gd,0.4);
pzmap(sysd)

Figure 8 shows the zero and poles location for the antenna system.

Figure 8. Pole-Zero map of the closed loop antenna control system.

From Figure 8, its clear that closed loop poles lie inside unit circle. Therefore, the
system is stable.

We can also use Routh Hurwitz and Jury's test for determine system stability, the
following MATLAB code uses the Routh Hurwitz method.

s=tf('s')
G=20/(s^2+6*s);
Gd=c2d(G,0.05,'zoh')
gd=(0.02268*z+0.02052)/((z^2-1.741*z+0.7408));
Gw = simplify(subs(gd,z,(1+0.025*w)/(1-0.025*w)));
Tw=Gw/(1+0.4*Gw)
pretty(simple(Tw))
num=270*conv([1 -40],[1 800]);
den=[435117 2509920 3416000];
pzmap(num,den)

Figure 9. Pole-zero map of the closed loop antenna control system using Routh.

From Figure 9, it is clear that the closed loop poles lie in the left half of w-plane.
Therefore, the system is stable.

Another technique to determine stability is Root locus technique. The Root locus
is a loci plot of the characteristic equation roots in the z-plane as a function of gain
K.

For our system, antenna pointing system the root locus will be used to determine
the range of gain K of stability. The following MATLAB code draws the root locus.

s=tf('s');
g=20/(s^2+6*s);
gd=c2d(g,0.05,'zoh')
rlocus(gd*0.4)

Root locus graph is depicted in Figure 10.


Figure 10. Root locus graph for antenna control system.

The stability boundary in the z-plane is the unit circle, from Figure 10 the root
locus crosses the unit circle when gain K = 32, thus , the range of stability is
0<K<32.
The last method for determine the stability of the system is Bode plot, The Bode
plot is a very useful graphical tool for the analysis and design of linear control
systems in the frequency domain.

Like we did in the root locus, we will find the range of stability using bode plot.

s=tf('s');
g=20/(s^2+6*s);
gd=c2d(g,0.05,'zoh')
bode(gd*0.4)

Figure 11. Bode plot for Antenna control system.

As we see from Figure 11, The system is stable because of positive GM and PM and
we can find the range of K for stability as follows :

20log(𝐾 ) = 30 𝐾 = 31.6

So, the range of gain K is : 0<K<31.6 .

 Digital Controller Design :


I. Digital controller design using bode plot :

In this section we will design digital controllers ( Lag, Lead, PID ) to enhance the
antenna system response.

A. Phase lag compensator design :

Phase Lag compensator reduces the system gain at higher frequencies without
reducing the system gain at lower frequencies. Due this, the steady state error is
improved, and the bandwidth has been decreased, which will generally result in
slower system time response.

From the bode plot depicted in Figure 11 shows the system has PM = 75.9°. Large
phase margin indicates that the system has good stability but also means slow
response. Therefore , for this system may be a phase lead compensator or PID
controller can be more efficient to improve the transient response as well.

In this assignment we will apply all the three controllers (Lag, Lead , PID), So, in
this case we will design phase lag compensator with desired phase margin = 80°.

From Figure 12. The phase angle that will achieve the desired phase margin
(Allowing 5° for the phase lag) is: ∠𝐺(𝑗𝜔𝑤1 ) = −180° + 80° + 5° = −95°.
Therefore 𝜔𝑤1 at phase -95° is 0.45 𝑟𝑎𝑑/𝑠𝑒𝑐.

Hence;

𝜔𝑤0 = 0.1𝜔𝑤1 = 0.045 𝑟𝑎𝑑/𝑠𝑒𝑐

Figure 12. Obtaining 𝜔𝑤1 .

Also, from Figure 12, it clear that, the magnitude of |𝐺(𝑗𝜔𝑤1 )| = 9.42𝑑𝑏.
Therefore 𝛼 = 2.958.

Hence;

𝜔𝑤0 𝑟𝑎𝑑
𝜔𝑤𝑃 = = 0.0152 .
𝛼 𝑠𝑒𝑐
Finally the comp. transfer function D(z) can be determined as

2 2
𝜔𝑤𝑃 𝜔𝑤0 + 𝑇 𝑇 − 𝜔𝑤0
𝐾 = 𝑎0 = 0.338 , 𝑧0 = = 0.9977
𝜔𝑤0 𝜔 + 2 2
+ 𝜔
𝑤𝑃 𝑇 𝑇 𝑤0
2
− 𝜔𝑤𝑃
𝑧𝑃 = 𝑇 = 0.99924
2
+ 𝜔𝑤𝑃
𝑇
𝑧 − 𝑧𝑜 𝑧 − 0.9977
𝐷 (𝑧 ) = 𝐾 = 0.338
𝑧 − 𝑧𝑃 𝑧 − 0.99924

The following MATLAB code plots the bode plot and step response for the
uncompensated and compensated systems. Look to Figure 13 & Figure 14.

s = tf('s');
Gs = 20/(s*s+6*s);
Gz = c2d(Gs,0.05,'zoh');
bode(Gz*0.4)
hold on
z = tf('z');
Dz = 0.338*(z-0.9977)/(z-0.99924);
GzDz = series(Gz,Dz);
bode(GzDz*0.4)
figure;
sysuncomp = feedback(Gz,0.4);
syscomp = feedback(GzDz,0.4);
step(syscomp,sysuncomp)

Figure 13. Bode plot for compensated and uncompensated systems.


Figure 14. Step response for compensated and uncompensated systems.

The system specifications with and without the compensator are


recorded in Table 3.

System Uncompensated Compensated


characteristics System System
Time constant
0.8 2.15
(𝜏 sec )
Settling time
2.16 30.9
(T sec)
Overshoot% 0 4.66
Rise time
1.23 3.8
( T sec )
Bandwidth
1.7537 0.5259
(Hz)
Steady-state
error due 0.76 1.16
ramp
Phase Margin 75.9 81.2
Gain Margin
30 39.4
(db)
Table 3. System specifications with and without the phase lag.

From these results it is obvious that the system become slower, adding the phase
lag compensator reduce the bandwidth and also increased the settling time and
adds some overshoot to the system.

For the antenna pointing system it needs more improvement in the transient
response, there for the next section we will implement the phase lead
compensator.

B. Phase lead compensator design :

Phase lead compensator improves the stability margin, and high-frequency


performance such as speed response, is improved. On the other hand, any high-
frequency noise problems are emphasized.

For the Antenna pointing system, we will design also to achieve a phase margin
of 80° using phase lead compensator.

The frequency 𝜔𝑤𝑃 that achieves the three conditions is 2.12 rad/sec.
Figure 15. 𝜔𝑤1 for the lead compensator.
Hence,

|𝐺(𝑗𝜔𝑤1 )| is 0.59 with phase -113°.

After calculation of 𝜔𝑤0 and 𝜔𝑤𝑃 we get :

𝜔𝑤0 = 0.66185 𝑟𝑎𝑑/𝑠𝑒𝑐 , 𝜔𝑤𝑃 = 1.241𝑟𝑎𝑑/𝑠𝑒𝑐

After realization we get the transfer function D(z) :

𝐾 = 1.8487 , 𝑧0 = 0.96744 , 𝑧𝑃 = 0.9398

𝑧 − 𝑧𝑜 𝑧 − 0.96744
𝐷 (𝑧 ) = 𝐾 = 1.8487
𝑧 − 𝑧𝑃 𝑧 − 0.9398

The following MATLAB code plots the bode plot and step response for the
uncompensated and compensated systems. Look to Figure 16 & Figure 17.

s = tf('s');
Gs = 20/(s*s+6*s);
Gz = c2d(Gs,0.05,'zoh');
bode(Gz*0.4)
hold on
z = tf('z');
Dz = 1.8487*(z-0.96744)/(z-0.9398);
GzDz = series(Gz,Dz);
bode(GzDz*0.4)
figure;
sysuncomp = feedback(Gz,0.4);
syscomp = feedback(GzDz,0.4);
step(syscomp,sysuncomp)

Figure 16. Bode plot with and without phase lead compensator.
Figure 17. Step response of the system with and without phase lead compensator.

The system specifications with and without the compensator are


recorded in Table 4.

System Uncompensated Compensated


characteristics System System
Time constant
0.8 0.55
(𝜏 sec )
Settling time
2.16 4.75
(T sec)
Overshoot% 0 0
Rise time
1.23 1.47
( T sec )
Bandwidth
1.7537 2.985
(Hz)
Steady-state
error due 0.76 0.76
ramp
Phase Margin 75.9 80.4
Gain Margin
30 25.3
(db)
Table 4. system specifications with and without phase lead compensator.

From the previous results, we can see that the phase lead compensator has
increased the bandwidth and speed up the response without adding overshoot.
Also, the phase lead compensator did not change the steady state error because
it focus on the transient response, and from the PM we can see that the lead
compensator achieved the desired phase margin with more accuracy than phase
lag but the lead compensator reduce the GM.

C. PID controller design :

The purposes of PD controller are to add positive phase angles to the open loop
frequency response so as to improve the system stability, and to increase closed
loop system bandwidth so as to increase the speed of response

For the Antenna pointing system, we will design also to achieve a phase margin
of 45° using PID compensator.
To draw the bode plot of uncompensated system is shown in figure 18.

s=tf('s');
G=20/(s^2+6*s);
Gd=c2d(G,0.05,'zoh');
bode(0.4*Gd)

Figure 18. Bode plot of the uncompensated system

The frequency 𝜔𝑤𝑃 that achieves the three conditions is 2.12 rad/sec.

Hence,

|𝐺(𝑗𝜔𝑤1 )| is 0.59 with phase -113°.

To determine the parameter of PID compensator

Where θ=[-180+D P.M –∠(𝑗𝜔𝑤1 )]= -22

cos(𝜃)
𝑘𝑝 = |𝐺(𝑗𝜔 = 1.571
𝑤1 )|

𝑘 sin(𝜃)
𝜔𝑤1 𝑘𝑑 − 𝜔 𝑖 = |𝐺(𝑗𝜔
𝑤1 𝑤1 )|

After choosing 𝑘𝑖 =0.004 then 𝑘𝑖 =-0.2986


z+1 z−1
𝐷(𝑧) = 1.571 + 0.0001 ∗ (z−1) − 5.972 ∗ 𝑧

clear all
s=tf('s');
G=20/(s^2+6*s);
Gd=c2d(G,0.05,'zoh');
z=tf('z')
dz=1.571+0.0001*(z+1)/(z-1)-5.972*(z-1)/z;
Gz=series(Gd,dz);
bode(0.4*Gz)

Figure 19. Bode plot with and without PID compensator.


The system specifications with and without the compensator are
recorded in Table 5.

System Uncompensated Compensated


characteristics System System
Peak time
NAN 1.2
(Tsec)
Settling time
2.16 2.65
(T sec)
Overshoot% 0 23.7
Rise time
1.23 0.406
( T sec )
Bandwidth
1.7537 4.9865
(Hz)
Steady-state
error due 0.8 0.4
ramp
Phase Margin 75.9 45.7
Gain Margin
30 7.18
(db)
Table 5. system specifications with and without PID compensator.

From the previous results, we can see that the PID compensator has increased
the bandwidth and speed up the response with adding overshoot to the system.
Also, the PID compensator did change the steady state error because of the
effect from PI and it acts like lag compensator so it is not went to zero steady
state error it is just decreased , and from the PM we can see that the PID
compensator achieved the desired phase margin with high accuracy.

II . using root locus technique


1. A . Phase lag compensator design

The idea of the digital phase Lag compensator design is to place a pole and a
zero close to 𝑧 = 1, where 𝑧𝑜 < 𝑧𝑝 .

We designed the phase lag to obtain desired steady state error to 0.1
assuming unit gain compensator. After calculation we obtain the lag transfer
function to be :

(𝑠 + 0.1)
𝐺𝑐 (𝑠) =
(𝑠 + 0.0133)
The following MATLAB code plots step response for the uncompensated and
compensated systems. Look to Figure 20 . system specifications are recorded
in Table 6.

s=tf('s');
G=20/(s*(s+6))
Gd=c2d(G,0.17,'zoh')
Gc=(s+0.1)/(s+0.013)
Dz=c2d(Gc,0.17,'tustin') f
GdDz=series(Gd,Dz)
ycomp=feedback(GdDz,0.4)
yuncomp = feedback(Gd,0.4);
step (yuncomp,ycomp)

Figure 20. Step response with and without lag compensator.

System Uncompensated Compensated


characteristics System System
Peak time
2.89 2.72
(Tsec)
Settling time
1.79 12.9
(T sec)
Overshoot% 0.0585 5.87
Rise time
1.09 0.974
( T sec )
Bandwidth
1.9778 2.0693
(Hz)
Steady-state
error due 0.8 0.16
ramp
Table 6. System specifictions with and without phase lag compensator.

From the previous results adding phase lag compensator reduced the steady
state error and for sampling period of T = 0.17 sec the system specifications for
the uncompensated system changed from T =0.05 sec.

B . Phase lead compensator design


The idea of the digital Lead compensator design is to shift the root locus to the
left, which resulting in a system respond faster

Design specification:

Design a phase lead compensator to obtain settling time less than 1 sec.

Using sisotool we have to design the lead compensator 𝐺𝑐 O O for the system to
meet the desired specifications.

s=tf('s')

g=20/(s^2+6*s);

sisotool(g,1,0.4)

after designing using sisotool we get

(1+0.38∗𝑠)
𝐺𝑐 (𝑠) = 6.159 ∗
(1+0.015∗𝑠)

Before converting form 𝐺𝑐 (𝑠) to 𝐷(𝑧) we have to determine the sampling


frequency

s=tf('s')
g=20/(s^2+6*s);
gc=6.159*(1+0.38*s)/(1+0.015*s);
G=series(g,gc);
y=feedback(G,0.4);
step(y)
bandwidth(y)

The closed loop bandwidth of the system 𝜔𝐵.𝑊 = 19.488

𝜔𝑠 = 20 𝜔𝐵.𝑊 = 389.76
2𝜋
𝑇= = 0.016
𝜔𝑠

Therefor T=0.01
s=tf('s')
g=20/(s^2+6*s);
gd=c2d(g,0.01,'zoh');
gc=6.159*(1+0.38*s)/(1+0.015*s);
dz=c2d(gc,0.01,'tustin');
G=series(g,gc);
Gd=series(gd,dz);
y=feedback(gd,0.4);
yd=feedback(Gd,0.4);
step(y,yd)

The system with and without compensator

Figure 21. step response with and without controller


The system characteristics with and without is shown in table 7

System characteristics Without controller With controller

Bandwidth(Bw) 3.75 19.488

Settling time (T sec) 2.27 0.998

1.28 0.249
Rise time ( T sec )

Steady-state error due 0.8 0


ramp

Table 7. Antenna control system characteristics with and without controller.

From the graphs and specification table, we observe that the response becomes
faster. adding lead compensator also reduces the steady state error.

You might also like