Upcoming SlideShare
×

Systems Analysis & Control: Steady State Errors

13,763 views

Published on

In the context of control engineering feedback loops, these slides describe how to find the steady-state error between a target and the system.

http://controleducation.group.shef.ac.uk/OER_index.htm

1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
13,763
On SlideShare
0
From Embeds
0
Number of Embeds
28
Actions
Shares
0
194
0
Likes
1
Embeds 0
No embeds

No notes for slide

Systems Analysis & Control: Steady State Errors

1. 1. Overheads for ACS211 Systems analysis and control Anthony Rossiter Department of Automatic Control and Systems Engineering University of Sheffield www.shef.ac.uk/acse © University of Sheffield 2009 This work is licensed under a Department of Automatic Control Creative Commons Attribution 2.0 License. and Systems Engineering
2. 2. Contents • ACS211: Compensation and steady-state errors • Final value theorem (FVT) • Fast response • Illustration of offset • What about the inputs? • Gain insufficient • Examples • MATLAB CODE • Offset free tracking • Offset free tracking requirement (steps). • Integral action • MATLAB CODE • Tutorial questions (at home) • Tracking ramps • Offset to ramps • Solutions • Figures for 1st and 3rd pairs (errors only) • Zero offset to ramps • Tutorial questions (at home) • Figures for offsets • Extra tutorial question: validation • Examples of closed-loop transfer functions • Reminders • Given • MATLAB code to investigate k • Credits Department of Automatic Control and Systems Engineering
3. 3. 3 ACS211: Compensation and steady-state errors Anthony Rossiter Dept. ACSE Some of this is revision of ACS114 Department of Automatic Control and Systems Engineering
4. 4. 4 Final value theorem (FVT) Convergent signals only For analysis of offset, students should be able to prove the following (was done in ACS114). lim y ( t ) lim sY ( s ) t s 0 Examples: 1 2t Y (s) lim s 0 sY ( s ) 0; { y (t ) e } s 2 1 t 2t Y (s) lim s 0 sY ( s ) 0; { y (t ) e e } (s 1)( s 2) 1 1 1 2t Y (s) lim s 0 sY ( s ) ; { y (t ) (1 e )} s(s 2) 2 2 Department of Automatic Control and Systems Engineering
5. 5. 5 Fast response • How do we get a system to respond fast to an error between target and output? • What is the mathematical expression for this? • Why is this law insufficient to give offset free tracking in general? Think about this for a few minutes and tell me. Department of Automatic Control and Systems Engineering
6. 6. 6 In these slides assume following feedback structure Department of Automatic Control and Systems Engineering
7. 7. 7 Illustration of offset Step Response 1 1.2 G 2 s 3s 2 1 0.8 G=tf(1,[1 3 2]) Amplitude K=1 K=1; 0.6 K2=10 offset target K2=10; 0.4 figure(1);clf reset 0.2 step(feedback(G*K,1),feedba ck(G*K2,1)); 0 0 0.5 1 1.5 2 2.5 3 3.5 4 hold on Time (sec) plot([-0.1,0,0,4],[0,0,1,1],'r'); axis([-0.1 4 0 1.2]); legend('K=1','K2=10','target'); Note how as gain increases, speed of response improves, but always an offset. Department of Automatic Control and Systems Engineering
8. 8. 8 What about the inputs? Outputs Note how the input 1 K=1 amplitude depends K2=10 Amplitude target upon the error 0.5 (target –output) and the gain K. 0 0 0.5 1 1.5 2 2.5 3 3.5 4 Time (sec) A bigger gain means Inputs a bigger initial input 10 so a faster 5 Amplitude response and a 0 smaller offset. -5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time (sec) In steady-state we have consistency from: y=G(0)u, u=K(r-y) which gives y=[G(0)K/(1+G(0)K)] r of Automatic Control Department and Systems Engineering
9. 9. 9 Gain insufficient It is clear that gain alone is insufficient to remove offset. e(s) r (s) G ( s )u ( s ) e(s) r (s) G ( s ) K ( s )e( s ) u (s) K ( s )e( s ) (1 G ( s ) K ( s )) e ( s ) r (s) 1 e(s) r (s) 1 G (s)K (s) 1 1 1 Let r(s)=(1/s) lim s 0 se ( s ) lim s 0 s . and use FVT. 1 G (s)K (s) s 1 G (0) K (0) Department of Automatic Control and Systems Engineering
10. 10. 10 Examples Find the steady state offset for the following, system controller pairs, assuming the target is a unit step. 1 1 1 G G G 2 s 2s 1 ; s 3 3s 2 3s 1 ; (s 10 )( s 2) K 2 K 0 .5 K 8 Department of Automatic Control and Systems Engineering
11. 11. 11 Answers 1 1 1 G G G s 2 2s 1 ; s 3 3s 3s 2 1 ; (s 10 )( s 2) K 2 K 0 .5 K 8 ERRORS 1 System 1 1 1 1 A pu e 0.5 ml d t i 1 G (0) K (0) 1 2 3 0 0 1 2 3 4 5 6 7 Time(sec) Step Response 1 1 2 System 2 Amplitude 0.9 1 G (0) K (0) 1 0 .5 3 0.8 0.7 0 1 2 3 4 5 6 7 8 9 10 StepmResponse Ti e (sec) System 3 Amplitude 0.9 0.8 1 1 20 0.7 0 . 71 1 G (0) K (0) 1 (8 ) 28 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 20 Time (sec) Department of Automatic Control and Systems Engineering
12. 12. 12 MATLAB CODE G1=tf(1,[1 2 1]) K1=2; Note there are spaces G2=tf(1,[1 3 3 1]) between these numbers, K2=0.5; so it is G3=tf(1,[1 12 20]) [1 space 3 space 3 space K3=8; 1] figure(1);clf reset subplot(311) You can use commas if step(feedback(1,G1*K1)); that is easier to read title('ERRORS','Fontsize',18) subplot(312) You may be able to copy step(feedback(1,G2*K2)); and past this code straight subplot(313) into MATLAB from the step(feedback(1,G3*K3)); PDF file. Department of Automatic Control and Systems Engineering
13. 13. 13 Offset free tracking • What conditions are required for offset free tracking of steady targets?  how do we control speed in a car?  what are the key steps and concepts?  what form of control law is this? • Having understood the key concept, can we prove this mathematically? Department of Automatic Control and Systems Engineering
14. 14. 14 Offset free tracking requirement (steps). Begin from the FVT [Assume target is a unit step or 1/s ] 1 1 1 lim t e (t ) lim s 0 se ( s ) lim s 0 s . 1 G (s)K (s) s 1 G (0) K (0) It is clear that e(t) tends to zero if and only if the term G(0)K(0) is infinite. Clearly with no Zero offset requires either G(s) or K(s) cancelling derivative term to include an integrator that is a term of the form (1/s). Department of Automatic Control and Systems Engineering
15. 15. 15 Integral action Most practical control laws include an integrator to ensure offset free tracking of constant targets. ERRORS 1 1 G 2 0.5 s 2s 1 Amplitude 0 .4 0 K s -0.5 0 5 10 15 20 25 Time (sec) 1 G 3 2 1 s 3s 3s 1 0.5 0 .2 Amplitude K 0 s -0.5 0 5 10 15 20 25 30 35 Time (sec) Department of Automatic Control and Systems Engineering
16. 16. 16 MATLAB CODE G1=tf(1,[1 2 1]) K1=tf(0.4,[1 0]); Note the term [1 0] defines G2=tf(1,[1 3 3 1]) (s+0) K2=tf(0.2,[1 0]); figure(2);clf reset i.e. coefficient of 1 on s subplot(211) and coefficient of 0 on the step(feedback(1,G1*K1)); constant title('ERRORS','Fontsize',18) subplot(212) step(feedback(1,G2*K2)); title(' ','Fontsize',18) Department of Automatic Control and Systems Engineering
17. 17. 17 Tutorial questions (at home) Find the offset for a unit step target for the following pairs of compensators and systems. Validate all your answers with MATLAB. 1 1 (s 3) G G G s 2 2s 3 ; s 3 5s 2 3s 2 ; (s 1)( s 2 )( s 4) K 4 K 0 .6 K 8 s 3 1 G 2 G 3 2 (s 3) s 2s 1 s 5s 3s 2 G ; ; 3 s 5s 2 3s 4 (s 2) K K 0 .6 K 0 .8 s s Department of Automatic Control One is not as expected. WHY? and Systems Engineering
18. 18. 18 ERRORS 1 Figures for Amplitude 0.5 0 0 1 2 3 4 5 6 previous page Time (sec) Step Response Amplitude 0.9 0.8 0.7 0 5 10 15 20 25 Time (sec) Step Response 1 ERRORS Amplitude 6 x 10 0.5 2 Amplitude 0 0 0.5 1 1.5 2 2.5 3 3.5 4 0 4.5 Time (sec) -2 0 50 100 150 Time (sec) 1 Amplitude 0 -1 0 50 100 150 200 250 300 350 Time (sec) 1 Amplitude 0 -1 0 2 4 6 8 10 12 14 Time (sec) Department of Automatic Control and Systems Engineering
19. 19. 19 Tracking ramps 1. Why would you want to track a ramp given this diverges to infinity? 2. How would you compute the offset to a ramp target? 3. How will an actuator supply an input big enough to track a ramp in general? Discuss this with you neighbours briefly. WARNING: When using MATLAB, remember only to compute convergent signals, hence you cannot easily plot ramp responses which go to infinity. Department of Automatic Control and Systems Engineering
20. 20. 20 Targets that are ramps May operate over limited time scales. Circular motion (DVD players, etc.). As input energy is limited, usually ramps can only be tracked asymptotically where the system model itself contains an integrator. Department of Automatic Control and Systems Engineering
21. 21. 21 Offset to ramps Revert back to the FVT but now use a target of r(s)=(1/s2). [or scaled variant as appropriate] 1 1 1 e(s) r (s) . 2 1 G (s)K (s) 1 G (s)K (s) s 1 1 1 lim t e (t ) lim s 0 se ( s ) lim s 0 s . 2 or 1 G (s)K (s) s sG ( s ) K ( s ) Clearly, the error diverges to infinity unless there is an integrator in G(s) or K(s). 1 lim t e (t ) lim s 0 sG ( s ) K ( s ) Department of Automatic Control and Systems Engineering
22. 22. 22 Examples Find the offset to a ramp r=(1/s2) for the following compensator system pairs. 1 1 G G 3 2 2 s 2s 1 ; s 3s 3s 1 0 .4 0 .2 ( s 3) K K s (s 4) 1 G 3 2 s 3s 3s 1 0 .2 K s Department of Automatic Control and Systems Engineering
23. 23. 23 Examples Find the offset to a ramp r=(1/s2) for the following compensator system pairs. 1 1 G G 3 2 2 s 2s 1 ; s 3s 3s 1 0 .4 0 .2 ( s 3) K K s (s 4) 1 G 3 2 s 3s 3s 1 0 .2 K s Department of Automatic Control and Systems Engineering
24. 24. 24 Solutions Find the offset to a ramp r=(1/s2) for the following compensator system pairs. 1 G 2 s 2s 1 lim sG ( s ) K ( s ) 0 .4; e 2 .5 s 0 0 .4 K s 1 G 3 2 s 3s 3s 1 lim s 0 sG ( s ) K ( s ) 0; e 0 .2 ( s 3) K (s 4) 1 G 3 2 s 3s 3s 1 lim sG ( s ) K ( s ) 0 .2; e 5 s 0 0 .2 K Department of Automatic Control s and Systems Engineering
25. 25. 25 Figures for 1st and 3rd pairs (errors only) ramp=0:20; time=ramp; ERRORS G1=tf(1,[1 2 1]) 20 K1=tf(0.4,[1 0]); 15 Amplitude G2=tf(1,[1 3 3 1]) 10 K2=tf(0.2,[1 0]); 5 figure(2);clf reset 0 subplot(211) 0 2 4 6 8 10 12 14 16 18 20 lsim(feedback(1,G1*K1),time,ramp); Time (sec) title('ERRORS','Fontsize',18) 20 subplot(212) lsim(feedback(1,G2*K2),time,ramp); 15 Amplitude title(' ','Fontsize',18) 10 5 0 0 2 4 6 8 10 12 14 16 18 20 Time (sec) Department of Automatic Control and Systems Engineering
26. 26. 26 Zero offset to ramps Look at the FVT and determine how to get zero offset for a ramp target. Tell me what you think. Department of Automatic Control and Systems Engineering
27. 27. 27 Zero offset to ramps Clearly, zero offset requires two integrators in G(s)K(s) so that: 2 M (s) 1 s G (s)K (s) 2 lim s 0 lim s 0 0 s sG ( s ) K ( s ) sM ( s ) Warning: Throughout we have assumed a simple feedback structure. You must modify all rules if the feedback structure is different (e.g. more compensators, something in return path, etc.). Department of Automatic Control and Systems Engineering
28. 28. 28 Tutorial questions (at home) Find the offset for a ramp target r=(1/s2) for the following pairs of compensators and systems. Validate all your answers with MATLAB. (s 3) 1 1 G G G (s 1)( s 2 )( s 4) s 2 2s 3 ; s 3 5s 2 3s ; 2 K 4 K 0 .6 K s s 3 s 1 G 2 G 3 2 (s 3) s 2s 1 s 5s 3s G ; ; 3 s 5s 2 3s 0 .4 (s 2) K K 6 K 0 .8 s s Department of Automatic Control and Systems Engineering
29. 29. Tutorial questions for 29 home 1. How might you deal with targets that are parabola? 2. Why in general would a controller containing proportional and integral be a good idea? [Usually denoted PI and the most common structure in industry]. 3. Industry often uses PID. What does the D stand for and why does this help? What problems can it introduce? [Look at some books if you are stuck] Department of Automatic Control and Systems Engineering
30. 30. 30 Figures for offsets ERRORS ERRORS 20 20 Amplitude Amplitude 10 10 0 0 2 4 6 8 10 12 14 16 18 20 2 4 6 8 10 12 14 16 18 20 Time (sec) Time (sec) Linear Simulation Results 20 20 Amplitude Amplitude 10 0 0 2 4 6 8 10 12 14 16 18 20 -20 2 4 6 8 10 12 14 16 18 20 Time (sec) Linear Simulation Results Time (sec) 20 20 Amplitude Amplitude 10 10 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20 Time (sec) Time (sec) Department of Automatic Control and Systems Engineering
31. 31. 31 Extra tutorial question: validation MATLAB can be used to G1=tf(1,[1 2 3]) validate your K1=4; computations in several easy ways: G2=tf(1,[1 5 3 0]) 1. Compute and display K2=0.6; closed-loop responses as in these notes. Gc1=feedback(G1*K1,1) 2. Compute closed-loop gain1=bode(Gc1,0) transfer function Gc2=feedback(G2*K2,1) explicitly and evaluate steady-state gain. gain2=bode(Gc2,0) Department of Automatic Control and Systems Engineering
32. 32. 32 Examples of closed- loop transfer functions Try these examples by hand and with MATLAB: 1 G 4 4 2 s 2s 3 Gc 2 G c (0) 0 . 57 K 4 s 2s 7 7 1 G 0 .6 3 s 5s 2 3s Gc 3 2 G c (0) 1 K 0 .6 s 5s 3s 0 .6 Gc(0) gives steady-state output for a step input r(s)=1/s. Department of Automatic Control and Systems Engineering
33. 33. 33 Reminders 1. The closed-loop must be stable or the FVT does not apply. 2. Next we will consider how to determine whether a closed-loop is stable or not and also whether performance is expected to be good or bad. 3. In previous years the lecturer spent some time on state space models. I have omitted this year to avoid overload, however awareness of state space is essential in the longer term. Spend a few hours looking at this in the text books. The lecturer of ACS214/206 will assume some familiarity! 4. State space is introduced formally in year 3. Department of Automatic Control and Systems Engineering
34. 34. Given G (s) 2 ; K (s) k s 2 s 3 s 1. Find the closed-loop transfer functions from target to input and target to output. 2. Find the open-loop and closed-loop poles for k=1. Which are better and why? 3. Determine the open-loop (usual to ignore K(s) for open loop) and closed-loop offset for a unit step and unit ramp. 4. Propose a value for k. Give a justification. Department of Automatic Control and Systems Engineering
35. 35. Given G (s) 2 ; K (s) k s 2 s 3 s 1. Find the closed-loop transfer functions from target to input and target to output. GK 2k (s 2) G cy ( s ) ; 1 GK 2k (s 2) s(s 3) K 2k (s 2 )( s 3) G cu ( s ) ; 1 GK 2k (s 2) s(s 3) 2. Find the open-loop and closed-loop poles for k=1. Which are better and why? 2 pc 2k (s 2) s(s 3) s (2k 3) s 4k ; 2 k 1 pc s 5s 4 (s 1)( s 4 ); po s(s 3 ); Department of Automatic Control and Systems Engineering
36. 36. Given G (s) 2 ; K (s) k s 2 s 3 s • Determine the open-loop (usual to ignore K(s) for open loop) and closed-loop offset for a unit step and unit ramp. Open-loop steady-state for a step is 2/3. Offset for a ramp will be infinite. Closed-loop steady state errors are 1 1 3 e ( step ) 0; e ( ramp ) 1 G (0) K (0) sGK k .2 .2 • Best value for k involves a compromise between speed of response and input activity. See MATLAB for illustration. Department of Automatic Control and Systems Engineering
37. 37. MATLAB code to investigate k G=tf(2,[1 3]); K=tf([1 2],[1 0]); Gcy=feedback(G*K,1); Gcu=feedback(K,G); figure(1);clf reset pzmap(Gcy); step(Gcy,Gcu);legend('Output','Input'); figure(1);clf reset k=1:.5:4;clear u y t t=linspace(0,2,200); for kk=1:7; [y(:,kk),tt]=step(feedback(G*K*k(kk),1),t); [u(:,kk),tt] = step(feedback(K*k(kk),G),t); end subplot(211); plot(t,y); subplot(212);plot(tt,u); legend('k=1','k=1.5','k=2','k=2.5','k=3','k=3.5','k=4'); Department of Automatic Control and Systems Engineering
38. 38. How fast can response get? Use MATLAB to try a very large value of k step(feedback(G*K*1000,1),t) Where do poles go as k tends to infinity? Department of Automatic Control and Systems Engineering