Solution for Take Home Exam 1 Problems 2.6, 2.7, 2.8, 2.12, 3.4, 3.5, 3.9, & 3.10. 2.6 For the open-loop system , a) Design feedback assuming you have access to all the state elements. Place the closed-loop system poles at s = [-1 +- 1j, -0.5 +- 5j]. b) Design an estimator for the system so that it has poles at s = [-2 +- 2j, -2 +- 8j]. c) Find the transfer function of the complete controller consisting of the control from part a) and the estimator from part b). Please note that some students achieved better results than this. This is not intended to show the ‘best’ result; it is to illustrate the main elements of a solution procedure and display of results. The matlab code is: function prob_2_6() % sysG = tf(1,[1 0 25 0 0]); sys = ss(sysG); [F,G,H,J] = ssdata(sysG); [F,G,H,J] = ssdata(sys); % part a pc = [-1-i,-1+i,-.5+5i,-.5-5i]; K = acker(F,G,pc) %part b pe = [-2-2*i,-2+2*i,-2+8*i,-2-8*i]; L = acker(F',H',pe)' % part c rsys = ss(F-L*H-G*K,L,-K,J); rsys = reg(sys,K,L); sysCL = -feedback(sys*rsys,1,+1); figure(1) step(sysCL) [num,den] = tfdata(rsys);
, a) Design feedback assuming you have access to all the state elements. Place the closed- loop system poles at s = [-1 +- 1j, -0.5 +- 5j]. b) Design an estimator for the system so that it has poles at s = [-2 +- 2j, -2 +- 8j]. c) Find the transfer function of the complete controller consisting of the control from part a) and the estimator from part b). 6.0000 2.1250 26.2500 25.2500 Problems 2.6, 2.7, 2.8, 2.12, 3.4, 3.5, 3.9, & 3.10. -565.5000 2.6 For the open-loop system K = L = 25 22
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Solution for Take Home Exam 1Problems 2.6, 2.7, 2.8, 2.12, 3.4, 3.5, 3.9, & 3.10.
2.6 For the open-loop system ,
a) Design feedback assuming you have access to all the state elements. Place the closed-loop system poles at s = [-1 +- 1j, -0.5 +- 5j].b) Design an estimator for the system so that it has poles at s = [-2 +- 2j, -2 +- 8j]. c) Find the transfer function of the complete controller consisting of the control from part a) and the estimator from part b).
Please note that some students achieved better results than this. This is not intended to show the ‘best’ result; it is to illustrate the main elements of a solution procedure and display of results.
Transfer function:-970.5 s^3 + 3763 s^2 - 4.391e004 s - 2.747e004----------------------------------------------------------- s^4 + 11 s^3 + 120.2 s^2 + 591.5 s + 1611
0 1 2 3 4 5 60
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8Step Response
Time (sec)
Ampl
itude
poleplacetransfer function
Note the difference in the response between the desired response and the controlled response with the estimator. My only explanation is that it’s an artifact of the estimator placement poles.
2.7 Consider a pendulum with control torque Tc and disturbance torque Td whose differential equation is: . Assume there is a potentiometer at the pin that measures the output angle , that is, .
a) Design a lead compensation using a root locus that provides for an Mp < 10% and a rise time tr < 1 sec.b) Add an integral term to your controller so that there is no steady-state error in the presence of a constant disturbance, Td, and modify the compensation so that the specifications are still met. The code is:
2.8 Consider a pendulum with control Tc and disturbance torque Td whose differential equation is . Assume there is a potentiometer at the pin that measures the output angle , that is, . a) Design a lead compensation using frequency response that provides for an PM > 50 degrees and a bandwidth > 1 rad/sec.b) Add an integral term to your controller so that there is no steady-state error in the presence of a constant disturbance, Td, and modify the compensation so that the specifications are still met.
The main issue guiding the design of the above is to avoid the resonant peak at 2 rad/sec. Consequently, the frequency crossover must be > 2 rad/sec. As shown in the bode plot above the bandwidth > 6.61 rad/sec, thus avoiding instability due to oscillation (see the step response above).
In part b) we are to add an integrator, which will increase the slope of the system. So, the controller has 2 objectives:
1) Avoid resonant peak at 2 rad/sec by crossing over > 2 rad/sec.2) Stabilize an increased slope.
Since we must get more ‘lift’ out of our lead the simplest approach is to provide 2 sections of the original lead as below.
Lead in part a):
Lead in part b):
The matlab code is:
function prob_2_8b()%w = 7;a = w/(10);
b = w*(10);k = 40000;sys1 = tf(1,[1 0 4]);D = k*tf([1 a],[1 b 0])*tf([1 a],[1 b]);sys2 = D*sys1;figure(1)margin(sys1)figure(2)margin(sys2)figure(3)sysdist = feedback(sys1,D);step(sysdist,20)
Note that the integrator is added in the 1st section of D above. Note also, that figure (3) displays the disturbance rejection capabilities of the new system.
2.12 For the open-loop system , use a single lead compensation in
the feedback to achieve as fast a response as possible.
From the bode diagram of the plant model a single lead will only have stabilizing effect up to ~10 rad/sec. Note that it would take 3 or more leads to stabilize the phase margin at 10 rad/sec.
Eigenvalue Damping Freq. (rad/s) -1.06e-001 1.00e+000 1.06e-001 -2.19e+000 1.00e+000 2.19e+000 -8.71e+000 1.00e+000 8.71e+000 -4.96e-001 + 9.41e+000i 5.26e-002 9.43e+000 -4.96e-001 - 9.41e+000i 5.26e-002 9.43e+000 The damping coefficient is 0.0526, which is slightly over 0.05 (the lower limit). Therefore, this is very close to the fastest response while maintaining the damping coefficient limit.
3.4 For the compensator use Euler’s forward rectangular method to
determine the difference equations for a digital implementation with a sample rate of 80 Hz. Repeat the calculations using the backward rectangular method and compare the difference equation coefficients.
3.5 The read arm on a computer disk drive has the transfer function G(s) = 1000/s/s. Design a digital PID controller that has a bandwidth of 100 Hz, a PM of 50 degrees, and has no output error for a constant bias torque from the drive motor. Use a sample rate of 6 kHz.
The 1st step is to design a lead that satisfies the requirements in the continuous time
domain. Therefore, which may be rewritten as
. We may now use pole placement in the numerator to help
achieve the specs. Now we inspect the bode plot of the plant. The plot on the left is the uncompensated plant while the plot on the right is the compensated plant.
We can then place the roots of the numerator significantly below the desired bandwidth using a damping coefficient of 1 for real response. The pole placement concept is
illustrated as where ς = 1 and w = 2π100/f, where f >=4 and
f is used for tuning. The sampling effect on PM is calculated by . The matlab
code follows:
function Prob_3_5()%
G = tf(1000,[1 0 0]);w = 2*pi*100/4.3;% require 2 zeroes to be a factor of ~4 below desired BW% to achieve desired PM. This factor becomes a tuning parameter. T = 1/6000;z = 1;% z = .707;Td = 1/w/w;Ti = Td*2*z*w;k = 120;% k = 70;kk = k*Td/Ti;D = tf(kk*[1 Ti/Td 1/Td],[1 0]);k*[(1+T/Ti+Td/T),-(1+2*Td/T),Td/T] % equation 3.17, page 66figure(1)subplot(2,2,[1 3])margin(G),grid onsubplot(2,2,[2 4])margin(G),grid on,hold onmargin(D*G),grid on,hold offfigure(2)[Gm,Pm,Wcg,Wcp] = margin(D*G);sysCL = feedback(D*G,1);% [mag,phase,w] = bode(sysCL);% loglog(w,mag(:)),grid onstep(sysCL),grid ontitle(['step response PM = ',num2str(Pm-Wcp*180/pi*T/2)])
The step response with final PM is:
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.040
0.2
0.4
0.6
0.8
1
1.2
1.4step response PM = 52.1016
Time (sec)
Ampl
itude
The remaining part is to compute the discrete PID implementation. We may use eqn 3.17, p. 66 of the text. The results are:
3.9 The antenna tracker has the transfer function . Design a continuous lead
compensation so that the closed-loop system has a rise time tr < 0.3 sec and overshoot Mp < 10%. Modify the matlab file fig32.m so that you can evaluate the digital version of your lead compensation using Euler’s forward rectangular method. Try different sample rates, and find the slowest one where the overshoot does not exceed 20%.
For the specs we 1st try to establish the bandwidth: wn = 1.8/tr = 1.8/0.3 = 6 rad/s. So, our bandwidth should be 6 rad/s or greater for a tr < 0.3 s. Mp = 10% is relatively low so try for a large PM. The bode plot of the plant shows that the PM must be raised and the bandwidth increased by the compensator.
A useful guide or starting point for estimating sampling frequencies is shown in figure (3) in the code as shown below:
30 40 50 60 70 80 90 100 110 1200
0.5
1
1.5
Hz
disc
rete
pol
estability analyses for discrete b
By inspection we know to begin somewhere above 30 Hz sampling rate for estimating the sampling rate effects.
3.10 The antenna tracker has the transfer function . Design a continuous
lead compensation so that the closed-loop system has a rise time tr < 0.3 sec and overshoot Mp < 10%. Approximate the effect of a digital implementation to be
, and estimate Mp for a digital implementation with a sample rate of 10
Hz.
We basically repeat 3.9 with a different means of estimation of the sampling rate effects. The matlab code is shown below. function Prob_3_10()%close allG = tf(10,[1 2 0]);k = 5;w = 5;a = w/2;b = w*2;D = tf(k*[1 a],[1 b]);figure(1)
tfin = 10;Hz = 10;t = [0:0.01:tfin];t1 = [0:0.01:1];y = step(feedback(D*G,1),t);ymax = (max(y)/y(end)-1)*100;step(feedback(D*G,1),t),hold ony = step(feedback(D*G*tf(2*Hz,[1 2*Hz]),1),t);ymax = [ymax,(max(y)/y(end)-1)*100];step(feedback(D*G*tf(2*Hz,[1 2*Hz]),1),t1),hold on, grid ontitle(['step, [k a b] = ',num2str([k a b]),... ', Mp = ',num2str(ymax)])