Sie sind auf Seite 1von 52

4K410 MOTION CONTROL EXERCISES AND EXPERIMENTS

S. Colak 0754862 J.C. Prez Muoz 0755654

Professor M. Steinbuch

Technische Universiteit Eindhoven Mechanical Engineering Department Systems & Control 2010/2011

CONTENTS
CONTENTS................................................................................................................................................... 1 LIST OF FIGURES ........................................................................................................................................ 2 1. SYSTEMS AND CONTROLLER DESIGN ................................................................................................ 4 1.2. Interpreting a Bode Diagram .............................................................................................................. 4 1.3. Estimating Transfer Functions ........................................................................................................... 5 1.4. Control of a motion system ................................................................................................................ 8 1.5. Load feedback exercise ................................................................................................................... 12 2. STABILITY .............................................................................................................................................. 14 2.1. Inverted pendulum ........................................................................................................................... 14 2.2. Non-minimum phase systems .......................................................................................................... 17 3. DESIGN FOR PERFORMANCE ............................................................................................................. 19 3.1. Non-collocated plant ........................................................................................................................ 19 3.2. Performance vs. Robustness ........................................................................................................... 21 3.3. Wafer stage exercise ....................................................................................................................... 23 4. FREQUENCY RESPONSE MEASUREMENTS ..................................................................................... 27 4.2. Frequency response function of a mass system ............................................................................. 27 4.3. Closed loop FRF measurement ....................................................................................................... 29 5. FEEDFORWARD CONTROL ................................................................................................................. 33 5.1. Mass Feedforward design ............................................................................................................... 33 5.4. Feedforward design ......................................................................................................................... 34 6. The Digital Environment .......................................................................................................................... 35 6.1. Delay and Sampling ......................................................................................................................... 35 6.2. Digital Control Systems .................................................................................................................... 36 MOTION CONTROL EXPERIMENTS ........................................................................................................ 39 Experiment 2. Frequency Response Measurements .............................................................................. 39 Experiment 3. Feedforward tuning .......................................................................................................... 43 Experiment 4. Loop shaping game ......................................................................................................... 45 REFERENCES ............................................................................................................................................ 51

LIST OF FIGURES
Figure 1. Frequency response for system H1 ............................................................................................... 4 Figure 2. Frequency response for system H2 ............................................................................................... 5 Figure 3. Frequency response of systems H1 and H2 ................................................................................... 6 Figure 4. Frequency response for system H1 and the fitted model S1 .......................................................... 7 Figure 5. Frequency response for system H2 and the fitted model S2. ......................................................... 7 Figure 6. Mass-spring-damper-mass system................................................................................................ 8 Figure 7. Bode diagram for systems H1 and H2. ........................................................................................... 9 Figure 8. Model of the system H1 controlled with a lead filter with gain........................................................ 9 Figure 9. Error of the system using an unitary step at 0.1 seconds. .......................................................... 10 Figure 10. Time specifications at different phase margins. ........................................................................ 11 Figure 11. Time specifications at different Bandwidths. ............................................................................. 12 Figure 12. Nyquist plot for the system H with a PD controller (Left) and closed loop response (Right). .... 13 Figure 13. Nyquist plot (Left) and close loop response (Right) for the system with PD and Notch controller. .................................................................................................................................................................... 13 Figure 14. Bode diagram (Left) and control effort (Right) of the system H with a Notch+Lead filter controller...................................................................................................................................................... 14 Figure 15. Bode diagram for the inverted pendulum. ................................................................................. 15 Figure 16. Nyquist diagram for the inverted pendulum with controller C1=1 (Left) and C2=-0.55 (Right). .. 15 Figure 17. Step response of the closed loop inverted pendulum with controller C1 and C2. ...................... 16 Figure 18. Nyquist plot (Left) and closed loop step response (Right) of the inverted pendulum using controller C. ................................................................................................................................................. 16 Figure 19. Bode diagram of systems H1 and H2. ........................................................................................ 17 Figure 20. Bode diagram (Left) and Nyquist plot (Right) for the system H2 using the controller C1. .......... 18 Figure 21. Nyquist plot (Left) and close loop step response (Right) for the system C2H2. ......................... 19 Figure 22. Bode diagram (Left) and Time response (Right) of the d to e transfer function. ....................... 20 Figure 23. Time response for the d to e transfer function when the controller has 2 poles at 2Hz with damping factor 0.01 (Left) and 0 (Right). .................................................................................................... 20 Figure 24. Mass-spring-damper system. .................................................................................................... 21 Figure 25. Bode diagram (Left) and control sensitivity function (Right) for the system H with control C1. . 22 Figure 26. Step response for the nominal system and controller C1 (Left) and systems with different mass value using controller C2 (Right). ................................................................................................................ 22 Figure 27. Bandwidth (Top left), Modulus margin (Top Right), settling time (Bottom left) and maximum overshoot (Bottom right) vs. mass. ............................................................................................................. 23 Figure 28. Measured data and fitted model for the wafer stage. ................................................................ 24 Figure 29. Diagram for the closed loop wafer stage with disturbances in the measurements and the output. ......................................................................................................................................................... 24 Figure 30. Complementary sensitivity of the system. ................................................................................. 25 Figure 31. Complementary sensitivity obtained with controller C2. ............................................................. 26 Figure 32. Measurement error (Top), FFT of the measurement error (Center) and system output with unitary step reference (Bottom). ................................................................................................................. 26 Figure 33. PD-controller mass model with noise signal after the controller block. ..................................... 27 Figure 34. Signals in time domain (Left) and Frequency domain (Right). .................................................. 27 Figure 35. FRF of the sensitivity of the system and Coherence function. .................................................. 28 Figure 36. Computed open loop FRF from the sensitivity. ......................................................................... 28 Figure 37. FRF of the PD controller and the plant. ..................................................................................... 29 Figure 38. Simulink model used for the closed loop FRF measurement. ................................................... 29

Figure 39. Closed loop sensitivity and its coherence. ................................................................................. 30 Figure 40. Process sensitivity and its coherence. ....................................................................................... 30 Figure 41. FRF measurement of the plant. ................................................................................................. 31 Figure 42. Sensitivity and process sensitivity coherences, FRF of the plant with 60s simulation time. ..... 32 Figure 43. Sensitivity and process sensitivity coherences, FRF of the plant with 120s simulation time. ... 32 Figure 44. Sensitivity and process sensitivity coherences, FRF of the plant with 240s simulation time. ... 33 rd Figure 45. Acceleration for the 3 order reference (Top), error without feedforward (Center) and error with acceleration feedforward (Bottom). ............................................................................................................. 34 Figure 46. Feedforward model. ................................................................................................................... 34 Figure 47. Acceleration, error without feed forward and error with feedforward......................................... 35 Figure 48. Represents the phase drop due to delay ................................................................................... 36 Figure 49. Magnitude Frequency response of a lead filter and its discrete time equivalents. ................... 37 Figure 50. Magnitude Frequency response of a lead + notch filter and its discrete time equivalents. ....... 38 Figure 51. Simulink scheme of the closed loop FRF measurement. .......................................................... 39 Figure 52. FRF of the plant. ........................................................................................................................ 40 Figure 53. FRF of the plant measured with 3 different sample frequencies. .............................................. 41 Figure 54. FRF measured with different PD controllers. ............................................................................. 42 Figure 55. Open-loop FRF using QadScope and Closed-loop FRF. .......................................................... 43 Figure 56. Motor feedback scheme for feedforward tuning. ....................................................................... 43 Figure 57. Setpoint trajectory used for the feedforward tuning. .................................................................. 44 Figure 58. Tracking error and acceleration without using feedforward. ...................................................... 44 Figure 59. Tracking errors obtained with and without feedforward. ............................................................ 45 Figure 60. Expected motor and load feedback responses. ........................................................................ 46 Figure 61. Simulink scheme for the FRF measurements. .......................................................................... 46 Figure 62. measured closed loop sensitivity and coherence. ..................................................................... 47 Figure 63. Controller frequency response................................................................................................... 47 Figure 64. Plant FRF measurement. ........................................................................................................... 48 Figure 65. Frequency response for C2(s)H(s) (left) and Sensitivity (Right). ............................................... 49 Figure 66. Measured open loop and sensitivity for the plant. ..................................................................... 49 Figure 67. Time response of the load feedback setup. ............................................................................... 50

1. SYSTEMS AND CONTROLLER DESIGN


1.2. Interpreting a Bode Diagram
(a) System H1(s)

Figure 1. Frequency response for system H1

The magnitude diagram starts with constant value so there is no integrator in the system. It is assumed -1 0 that diagrams start at frequency 10 Hz. At frequency 10 , System H1(s) has 2 stable poles because of the peak in the magnitude and approximately -180 phase change. At a frequency between 2Hz and 3Hz, there is a zero in the system and it is very close to first two stable poles and thats why phase diagram could not reach -180. At frequency 20Hz, there is a zero because it changes phase diagram +90. At frequency 30Hz, there are two stable poles which causes -180 phase change in the system. If slope of magnitude and phase are checked for higher frequencies, it could be seen that relative degree is 2. Also, in the system there are 4 poles and 2 zeros which shows relative degree is 2. (b) System H2(s) -1 It is assumed that frequency at the beginning of the diagram is 10 Hz. Magnitude diagram starts with a negative slope which indicates that the system has integrators. Every integrator adds -90 phase change, so the phase diagram starts in -360 instead of 0 which indicates system has 4 integrators. At frequency 0.9 Hz, system has 2 zeros because of +180 phase change and temporary decreasing of the magnitude diagram, the real phase value of the system is -360 + 180 = -180 and this agrees with phase diagram. At frequency 4 Hz, system has again 2 zeros which causes +180 phase change. At frequency 20 Hz and 40 Hz, there is a stable pole which results -90 phase change in the system. Finally, the system has 5 poles and 4 zeros which shows relative degree is 1. Also, the slope for higher frequencies is -1 which indicates relative degree is 1.

Figure 2. Frequency response for system H2

1.3. Estimating Transfer Functions


The frequency response of both systems is presented in the Figure 3. Its possible to determine that system H1 is unstable because it has 2 unstable poles located between 7.25 Hz and 7.5 Hz, while system H2 has two stable poles at the same frequency. From the bode diagram, it can be inferred that System H1 has 6 poles, 4 zeros and no integrators, then the command used to fit the model was: [num,den] = frfit(H1,hz,[6,4,0],1) The fitted model is = with N1(s) and D1(s) approximated as: s + 9.1995s + 6.2172s + 4.5961 10 s + 7.8594 10 s + 1.3927 10

N s = 0s 1.0658 10

D s = 1s + 5.8698s + 8.0999 10 s 6.8218 10 s + 3.4707 10 s 7.1509 10 s + 6.9253 10

In the other hand, it can be inferred that System H2 has 8 poles, 2 zeros and no integrators, then the command used to fit the model was: [num,den] = frsfit(H2,hz,[8,2,0],1)

The fitted model is

N s = 0s + 6.3949 10 s 2.3283 10 s + 2.1234 10 s 1.0376 10 s 2.9297 10 s + 7.4363 10 s + 1.1860 10 s + 2.4101 10 D s = 1s + 4.4030 10s + 1.2447 10 s + 2.7233 10 s + 3.9497 10 s + 2.1569 10 s + 1.5483 10 s + 2.8260 10 s + 3.0534 10

with N2(s) and D2(s) approximated as:

20 0 -20

20|H1| 20|H2|

Magnitude

-40 -60 -80 -100 -120 -140 -160 -1 10


0 1 2 3

10

10

10

10

Hz
200 150 100 50 0 -50 -100 -150 -200 -1 10
0 1 2 3

H1 phase H2 phase

Phase angle

10

10

10

10

Hz

Figure 3. Frequency response of systems H1 and H2

From the model of system H1(s) we have that the unstable poles of the model are: 1.1182e+000 +4.5786e+001i, 1.1182e+000 -4.5786e+001i Which are located at the frequency 45.786/2 = 7.2871 Hz, this result matches with the previous results. In the Figure 4 and Figure 5 the frequency response of the fitted models are presented and compared with the data. For frequencies higher than 200 Hz the fitted magnitudes arent close to the data, but this could be explained if the data contains noise. Also, the phase diagrams of the fitted models dont have the phase delay present on the data, this is because the fitted model are in continuous time but the data presents the phase delay caused by the sampling process.

0 -20 -40

20|H1| 20|S1|

Magnitude

-60 -80 -100 -120 -140 -1 10

10

10

10

10

Hz
200 150 100 50 0 -50 -100 -150 -200 -1 10
0 1 2 3

H1 phase S1 phase

Phase angle

10

10

10

10

Hz

Figure 4. Frequency response for system H1 and the fitted model S1

50

20|H2| 20|S2|

Magnitude

-50

-100

-150

-200 -1 10

10

10

10

10

Hz
200 150 100 50 0 -50 -100 -150 -200 -1 10
0 1 2 3

H2 phase S2 phase

Phase angle

10

10

10

10

Hz

Figure 5. Frequency response for system H2 and the fitted model S2. The plant S2 is easy to control at 20 Hz, because is stable and closed-loop stable, so to achieve a good performance at 20Hz is enough to make the gain higher and increase the phase using a lead filter.

1.4. Control of a motion system


We consider the classic mass-spring-damper-mass system depicted in Figure 6.

Figure 6. Mass-spring-damper-mass system. The transfer function from F to x1, H1 is given by: = The resonance frequency of the system is = + 1

+ .

and the anti-resonance frequency is

The transfer function from F to x2, H2 is given by = = +

Given the values m1=0.015 kg, m2=0.045kg, d=0.4Ns/m and k=2200N/m, the bode diagrams of H1 and H2 are presented in the Figure 7, its possible to identify the zeros of the system H1 at 35.1 Hz. For frequencies lower than 10 Hz the two systems have the same response, then both systems have a bandwidth of 0.65 Hz, also the two system have two poles at 71.03 Hz as expected. For frequencies higher than 1000 Hz, system H1 has slope -2 meanwhile system H1 has slope -3, this is because the system H2 has only one zero.

50 0

20|H1| 20|H2|

Magnitude

-50 -100 -150 -200 -250 -300 -1 10


0 1 2 3 4

10

10

10

10

10

10

Hz
200 150

H1 phase H2 phase

Phase angle

100 50 0 -50 -100 -150 -200 -1 10 10


0

10

10

10

10

10

Hz

Figure 7. Bode diagram for systems H1 and H2. The model of the system with the designed controller, a Lead filter with gain, is presented in Figure 8. The gain is 429, the zero and pole of the lead filter are located at 20/3 Hz and 60 Hz respectively. The error of the system with a unitary step at 0.1 seconds is presented in Figure 9, the overshoot in this case is 0.35 (or 35%), the rising time is close to 0.025 seconds ant the settling time is about 0.08 seconds. In Figure 10, the time specifications obtained with a bandwidth of 20 Hz and different phase margin, as presented in Table 1, are plotted. In this figure its possible to distinguish that the Maximum overshoot diminish when the phase margin increases, this is because bigger phase margins mean that the phase at the crossing frequency is closer to -90 degrees and, then, the poles of the system have lower real parts which translates in less overshoot. We also can see that the rising time its almost constant in all the cases, this is because the controller has a faster response that the system dynamics, then the rising time depends more in the system.

e Error

K/(2*pi*20/3).s+K 1/(2*pi*f2)s+1 Step Controller

1/m1*[1 d/m2 k/m2] s4 +(d/m2+d/m1)s3 +(k/m1+k/m2)s2 H1

t Clock t

Figure 8. Model of the system H1 controlled with a lead filter with gain.

0.8

0.6

Error (m)

0.4

0.2

-0.2

-0.4

0.05

0.1

0.15

0.2

0.25

0.3

Time (s)

Figure 9. Error of the system using an unitary step at 0.1 seconds.

Table 1. Phase margin specification and parameter of the controller Phase Margin 53.6 56.1 58 59.5 60.8 62.6 64.5 65.5 66.4 67 67.9 Gain 429 423 419 417 415 412 410 409 408.7 408.2 407.9 Lead filter pole 60 70 80 90 100 120 150 175 200 225 275

10

Time specifications vs Phase margin at 20 Hz of Bandwidth


0.4 Rising Time Maximum overshoot Settling time

0.35

0.3

0.25

0.2

0.15

0.1

0.05

0 52

54

56

58

60

62

64

66

68

Phase margin (Degrees)

Figure 10. Time specifications at different phase margins. The same experiment was done maintaining the phase margin with the value 53.6 degrees and changing the bandwidth with the specification presented in Table 2, in this case the settling time doesnt have significant changes, as expected. The overshoot in this case increases because the changes in the bandwidth with constant phase margin lead to lower modulus margin which in inversely related to the maximum overshoot. The settling time diminish as the bandwidth increases because higher bandwidth means faster responses of the system, leading to lower settling times. Table 2. Bandwidth specifications and parameters of the controller. Lead filter pole 150 82 63.5 60 59.8 59.5

Bandwidth 10.47 12.71 16.42 20 20.48 21.53

Gain 150 200 300 429 450 500

11

Time specifications vs Bandwidth with Phase Margin 53.6


0.4 Rising Time Maximum overshoot Settling time

0.35

0.3

0.25

0.2

0.15

0.1

0.05

0 10

12

14

16

18

20

22

Bandwidth (Hz)

Figure 11. Time specifications at different Bandwidths.

1.5. Load feedback exercise


The transfer function for this system is: 1.711 10 + 1.566 10 + 16.71 + 9.073 10

We used a PD (Gain + Phase lead) controller with K=0.0035 and D=0.0035/(2*pi*1.2) so the zero of the controller is in the frequency 1.2 Hz. The 2 stable poles are limiting the Bandwidth because they create a loop in the Nyquist plot than can be corrected with only a phase lead controller, so we can only reduce the loop so it doesn't encircle the -1 point by diminishing the gain and then we can add the phase lead to shift the phase angle to obtain a stable behavior of the plant+controller. The Nyquist plot of the system with the PD controller is presented in Figure 12 along with the closed loop response, in th Nyquist plot is possible to see that there are not encirclements of the (0,-1) point and the closed loop response displays a stable behavior.

12

Closed Loop Response


1.4

0.6 0.4

1.2 1

Amplitude

0.2 0 -0.2 -0.4 -0.6 -1.5 -1 -0.5 0 0.5

0.8 0.6 0.4 0.2 0

0.5

1.5

2.5

Time (s)

Figure 12. Nyquist plot for the system H with a PD controller (Left) and closed loop response (Right). Now, we add a notch filter to the controller which has the goal to reduce the peak caused by the poles of the plant so the bandwidth can be modified by increasing the gain, and the phase lead helps to stabilize the plant adding the phase shift necessary close to the bandwidth. The notch has the zeros and poles at 50 Hz with damping 0.1 and 0.9 for the zeros and the poles respectively. In Figure 13 both nyquist plot and closed loop response are plotted, in this case the system has a faster response but the maximum overshoot is increased.
Closed Loop Response
2 1.8
1.5 1

1.6 1.4

Amplitude

0.5 0 -0.5 -1 -1.5 -3 -2 -1 0 1 2

1.2 1 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1

Time (s)

Figure 13. Nyquist plot (Left) and close loop response (Right) for the system with PD and Notch controller. Now, assuming that the control effort cant be higher than 10V for a step setpoint of 1mm, we remove the PD controller and we add a lead filter with zero at 5 Hz and pole at 16 Hz. In this case the notch has its zeros and poles at 50 Hz but the damping is 0.1 for both. In the Figure 14 the bode diagram and the control effort after a step of 1 mm are plotted, the bandwidth of the system is 12.09 Hz and the maximum control effort is 0.5 V.

13

Bode Diagram 100 0 Magnitude (dB)

Control effort - Reference response


0.5 0.4

-100 -200 -300 -400 -90

Control effort [V]


-1 0 1 2 3 4 5 6

0.3 0.2 0.1 0 -0.1 -0.2

Phase (deg)

-180

-270

-360 10 10 10 10 10 10 10 10 Frequency (Hz)

0.2

0.4

0.6

0.8

Time (s)

Figure 14. Bode diagram (Left) and control effort (Right) of the system H with a Notch+Lead filter controller.

2. STABILITY
2.1. Inverted pendulum
Given the inverted pendulum linear model around the equilibrium point and the parameter values, the bode diagram is presented in the Figure 15, we observe on the Bode diagram that we have 1 stable pole between 0.02 and 0.03 Hz, and another 2 poles close to 2 Hz but it seems like one is stable and the other not because the phase diagram doesnt exhibit changes, then also knowing about the zero on the origin, we can say that the system is unstable. The poles of the system are: = 1.2187 10 = 0.22218 They are located at the frequencies 1.922 Hz, 1.9397 Hz and 0.035362 Hz respectively, and these frequencies agree with the previous results. Using the simpler controllers C1=1 and C2=-0.55, we obtain the Nyquist diagram presented in Figure 16, because we have an unstable pole the Nyquist diagram needs to have one counterclockwise encirclement of the point (-1,0), neither of the both controllers satisfies this, so both closed loop are unstable. In Figure 17 the step response of the closed loops are presented, this responses agree with the previous result: the closed loops are unstable. = 1.2076 10

14

Bode Diagram 50 0 Magnitude (dB) -50 -100 -150 -200 90

Phase (deg)

45

0 10
-2

10

-1

10

10

10

10

10

10

Frequency (rad/sec)

Figure 15. Bode diagram for the inverted pendulum.

Nyquist Diagram 0.8


0.4

Nyquist Diagram

0.6

0.3

0.4

0.2

0.2 Imaginary Axis


Imaginary Axis

0.1

-0.2

-0.1

-0.4

-0.2

-0.6

-0.3

-0.8 -1

-0.5

0 Real Axis

0.5

1.5

-0.4 -1

-0.8

-0.6

-0.4

-0.2

0.2

0.4

Real Axis

Figure 16. Nyquist diagram for the inverted pendulum with controller C1=1 (Left) and C2=-0.55 (Right).

15

1000 800 600 400 200 0 -200 -400 -600 -800 -1000 0 0.2 0.4 0.6 0.8 1 C1 C2

Time (s)

Figure 17. Step response of the closed loop inverted pendulum with controller C1 and C2. In order to obtain a stabilizing controller, we use a negative gain, a lead filter and a weak integrator. The weak integrator help to counter the action of the zero of the system. The model of the controller is: = 18 + 2 0.5 2 60 2 10 +1 +1

The nyquist plot and the step response of the closed loop using the controller C, are presented in the Figure 18, where its possible to check that the Nyquist diagram has one counterclockwise encirclement of the (-1,0) point, giving the stable behavior showed in the time response.

Nyquist Diagram 1.6 4 1.4 3 1.2 2 1 Amplitude 0 -1 -2 -3 -4 -20 -15 -10 Real Axis -5 0 0 0 0.1 0.2 0.3 1

Step Response

Imaginary Axis

0.8

0.6

0.4

0.2

0.4

0.5 Time (sec)

0.6

0.7

0.8

0.9

Figure 18. Nyquist plot (Left) and closed loop step response (Right) of the inverted pendulum using controller C. For stable open loop systems we know that the system doesn't have unstable poles, so we don't need to create a encirclement of the (-1,0) point in the Nyquist diagram, in other words: we only need to be sure that our plant+controller have phase angle between -180 and -90 in the bandwidth frequency.

16

2.2. Non-minimum phase systems


The Bode diagram for the systems H1 and H2 is presented in the Figure 19, we can see that magnitudes are equal, but the phase diagrams differ because H2 has a unstable zero, this unstable zero can be written as -(6-s) and that's the reason for the phase diagram to start at +90 degrees. The name nonminimum phase corresponds to the fact that the phase for this system is = 1000 6 + 20 + 5000 + 180

In other words, the unstable zero introduces a phase-shift of +180 in the phase diagram.

Bode Diagram 40 H1 20 Magnitude (dB) 0 -20 -40 -60 90 H1 H2 Phase (deg) 0 H2

-90

-180 10
-2

10

-1

10

10

10

Frequency (Hz)

Figure 19. Bode diagram of systems H1 and H2. As the system H1 is stable, we only need to mode the phase diagram to the right in order to increase the bandwidth, that's possible with a lead-lag controller, then is possible to finally adjust the exact bandwidth using the gain. The controller has the expression: +1 = 18 2 20 +1 2 90

The modulus margin is 3.2864 and the phase margin is 43.088. The open loop Bode diagram for system C1xH2 is presented in Figure 19 along with the Nyquist plot of the system, the phase margin in this case is 46.740. The Nyquist plot of this system has a (clockwise) encirclement of the point (-1,0), which means that the system has one unstable closed loop pole. Because the integrator on the system, the encirclement is a infinite loop, and the position of the encirclement (right hand or left hand plane) should

17

be derived by replacing s in the transfer function for with 90 its possible to check the resulting angle, as presented in [1]. = 18 2 20 Then, if is close to 0, 2 90 +1 +1 1000

90and a really small , then

6 + 20 + 5000

And using the fact that = , we have then that the angle of the infinite loop is 180 as goes from -90 to 90, in other words the infinite loop goes from 270 to 90 crossing through 180 meaning that is located at the left hand plane.

Bode Diagram 100

Nyquist Diagram 60

50 Magnitude (dB)

40

20 Imaginary Axis
-50

-100 90

-20
Phase (deg) 0

-90

-40

-180 10
-2

10

-1

10

10

10

10

10

-60 -4

-2

4 Real Axis

10

12

Frequency (Hz)

Figure 20. Bode diagram (Left) and Nyquist plot (Right) for the system H2 using the controller C1. The new stabilizing controller for H2 has the form = 2.22 2 12 1

This controller give us = 5.9dB, a phase margin of 58.4 and a Bandwidth of 0.47 Hz. In this case, the bandwidth of the controller + plant system is limited by the frequency of the non-minimum phase zero which is located at 6 2 = 0.9549 Hz. In Figure 21 the Nyquist plot and the time response of the closed loop for the system C2H2 are plotted, and again the Nyquist plot exhibits a infinite loop but in this case this loop is located at the right hand plane, thus the close loop system has 0 unstable poles.

2 +1 2 12

18

Nyquist Diagram

Step Response 1.2

0.8
0.5 Imaginary Axis

Amplitude

0.6

0.4

-0.5

0.2

0
-1

-0.2
-1 -0.9 -0.8 -0.7 -0.6 -0.5 Real Axis -0.4 -0.3 -0.2 -0.1 0

0.5

1 Time (sec)

1.5

2.5

Figure 21. Nyquist plot (Left) and close loop step response (Right) for the system C2H2.

3. DESIGN FOR PERFORMANCE


3.1. Non-collocated plant
For the given plant, the stabilizing controller is constructed with a gain, a lead filter and a notch. In this case the notch is used to attenuate the resonance of the system at 52.3 Hz and the lead filter helps to achieve the desired phase at the desired bandwidth (10Hz). In this case the controller has the structure: + 1 2 52.3 = 0.756 2 6 +1 2 30 2 52.3 = 1+ 2 0.1 +1 2 52.3 2 0.5 + +1 2 52.3 +

The transfer function from the disturbance to the error is given by the expression

The bode diagram of the transfer function from d to e and the time response of this system are plotted in Figure 22, when the sine disturbance with amplitude 1 and frequency 2 Hz is applied, the error has a periodic response with an amplitude larger than 1 and frequency 2 Hz. Looking at the bode diagram, any disturbance signal with a frequency lower than 7 Hz will have a direct effect on the error, because the transfer function has magnitude larger than 0 for those frequencies.

19

Bode Diagram

1 d 0.5
Magnitude (dB)

50 0 -50 -100 -150

0 -0.5 -1

0.2

0.4

0.6

0.8

1 1.2 Time (s)

1.4

1.6

1.8

2
-200 180

2 e
Phase (deg) 90 0 -90 -180 -270

1 0 -1 -2

0.2

0.4

0.6

0.8

1 1.2 Time (s)

1.4

1.6

1.8

10

10

10

10

10

Frequency (rad/sec)

Figure 22. Bode diagram (Left) and Time response (Right) of the d to e transfer function. To achieve the disturbance rejection specification error less than 0.01 within 0.5 seconds, we need to create an anti-resonance at the 2 Hz frequency for the d to e transfer function. This can be possible adding two poles at 2 Hz in the controller with a damping factor of 0.01, but then the phase will change drastically making the system unstable, then we add two zeros at 2 Hz in the controller with a damping factor of 0.95, this works like adding a notch at the d to e transfer function. In order to make the error converge to zero, we need to made the damping factor of the two poles in the controller equal to zero. In the Figure 23 the time response of the system with the improved controller with the poles with damping factor 0.01 and 0, we can see that the error in the second case goes to zero.
1 d 0.5 0 -0.5 -1
0.5 0 -0.5 -1 1 d

0.5 Time (s)

1.5

0.5 Time (s)

1.5

0.1 e 0 -0.1 -0.2 -0.3

0.1 e 0 -0.1 -0.2 -0.3

0.5 Time (s)

1.5

0.5 Time (s)

1.5

Figure 23. Time response for the d to e transfer function when the controller has 2 poles at 2Hz with damping factor 0.01 (Left) and 0 (Right).

20

3.2. Performance vs. Robustness


We consider here the mass-spring-damper system presented in Figure 24, this system has the model: = 1 + +

Figure 24. Mass-spring-damper system. Well assume that m = 0.5kg, d = 0.5Ns/m and k = 40N/m. We need to design a controller that achieve a module margin lower than 6 dB and that has steady state error equal to 0 for stepwise references, furthermore, this controller must accomplish < 50dB, open loop bandwidth lower or equal to 3 Hz and maximum order equal to 2. To achieve the < 50dB constraint we need a lowpass filter to limit the magnitude of CS, in the other hand, we need a integrator to achieve the 0 steady state error. A PD controller will help to improve the settling time. We are interested in achieve the constraints on the Control Sensitivity function, so the first performance measure is the magnitude of CS for large frequencies. After that, the steady state error, the maximum overshoot and the settling time are the other 3 measures of the performance of the controller, we expect a maximum overshoot of 20% and a settling time lower than 2 seconds, with the performance constraint that steady state error should be 0 for stepwise references. The finally designed controller is: + 1 + 2 0.6 = 60 2 2 +1 2 10

The bode diagram and control sensitivity function of this controller are presented in Figure 25, the bandwidth for the open loop is 2.6440 Hz, the modulus margin is 5.6377 dB, the phase margin is 30.1447 degrees, the settling time with an unitary step is 1.3351 seconds and the maximum overshoot is 18.55% while we have 0 steady state error. We can see that the control sensitivity function is lower than 50 dB for frequencies larger than 2Hz. This controller has the lower settling time achieved meanwhile accomplish all the design and performance constraints.

21

Bode Diagram 50
120 100

Sensitivity function

Magnitude (dB)

Magnitude (dB) Phase (deg)


-2 -1 0 1 2 3

80 60 40

-50

-100 0 -45 Phase (deg) -90 -135 -180 10 10 10 10 10 10 Frequency (Hz)

20 45 0 -45 -90 -135 -180 10


-2

10

-1

10

10

10

10

Frequency (Hz)

Figure 25. Bode diagram (Left) and control sensitivity function (Right) for the system H with control C1. Now, taking in account that the mass has an uncertainty of 0.1 kg, we change the parameters of the controller in order to have a maximal performance for every possible value of the mass parameter. In this case, the new controller is: + 1 + 2 0.45 = 58 2 2 +1 2 10

The time response of the nominal system with the controller C1 is presented in Figure 26 along with the responses using controller C2 of the systems with mass 0.4kg, 0.5kg and 0.6kg. The settling time with the robust controller is increased but its still lower than 2 seconds, the maximum overshoot also remains lower than 20%. In the nominal case, the system has a bandwidth of 2.5910 Hz, a module margin of 5.0306 dB, a phase margin of 32.9847 degrees, a settling time of 1.8585 seconds and a maximum overshoot of 12.99%.
Step Response 1.4 Controller C and m=0.5kg
1

Step Response 1.4 m = 0.4 m = 0.5 1.2 m = 0.6

1.2

Amplitude

0.6

Amplitude

0.8

0.8

0.6

0.4

0.4

0.2

0.2

0.5

1 Time (sec)

1.5

2.5

0.5

1.5 Time (sec)

2.5

3.5

Figure 26. Step response for the nominal system and controller C1 (Left) and systems with different mass value using controller C2 (Right). To illustrate the behavior of the robust controller, Figure 27 presents the graph for the bandwidth, modulus margin, settling time and maximum overshoot for different values of the mass. Its is possible to

22

check that every performance constraint is accomplished, but also that the settling time is minimum for a mass value close to 0.5kg.

3 2.9 2.8 2.7 (dB) 2.6 2.5 2.4 2.3 2.2 0.4 0.45 0.5 Mass (kg) 0.55 0.6 (dB) Bandwidth

6 Modulus margin 5.5

4.5

4 0.4

0.45

0.5 Mass (kg)

0.55

0.6

1.94 Settling time 1.92 1.9 (%) (s)

16 Maximum overshoot 15 14 13 12

1.88 1.86 1.84 0.4

11 10 0.4

0.45

0.5 Mass (kg)

0.55

0.6

0.45

0.5 Mass (kg)

0.55

0.6

Figure 27. Bandwidth (Top left), Modulus margin (Top Right), settling time (Bottom left) and maximum overshoot (Bottom right) vs. mass. When comparing C1 and C2, we can conclude that the more robust controller cant achieve the performance achieved by a controller designed for a particular system without uncertainty, normally some performance measures will be increased when the robust controller is used, like the maximum overshoot or the settling time, but other measures could be reduced as for example the bandwidth, leading to a slightly slower response of the system.

3.3. Wafer stage exercise


After loading the wafer stage FRF measurements, we plotted the Bode diagram of the data and we identified the presence of 2 integrators, 8 zeros and 10 poles. This can be inferred after observing the phase changes between 100Hz and 200Hz. Then using the command [num,den] = frsfit(frf,hz,[12,8,2],1); We obtain the model of the fitted wafer stage. In Figure 28 the bode diagram for the real data and the fitted model are plotted, the fitted model is used to design the controller for the plant.

23

100 Data Fitted model Magnitude (dB) 50

-50

-100 0 10

10

10 Frequency (Hz)

10

10

200 Data Fitted model Phase (Degrees) 100

-100

-200 0 10

10

10 Frequency (Hz)

10

10

Figure 28. Measured data and fitted model for the wafer stage. The controller has a PD controller with the zero at 400 Hz, an notch at 1210 Hz and a lead filter to increase the phase around 400 Hz, its structure is: = 5.5 2 400 +1 2 1210 2 0.01 +1 +1 2 1210 2 120 2 + + 1 2 1200 + 1 2 1210 +

The achieved bandwidth is 395 Hz, the modulus margin 7.5dB and the phase margin is 38.8 degrees and the gain margin is infinite. Now, assuming there are disturbances in the output and in the measurement as depicted in Figure 29, the transfer function, called complementary sensitivity, from to e is given by = 1+

2 1210

Figure 29. Diagram for the closed loop wafer stage with disturbances in the measurements and the output. In this case, if the measurement error has frequencies of 100 Hz and higher, non all these frequencies arent suppressed because the complementary sensitivity has magnitude higher than 0dB for frequencies between 100Hz and 600 Hz as showed in Figure 30, this is caused because the open loop bandwidth is close to 400Hz.

24

Bode Diagram 50

Magnitude (dB) Phase (deg)

-50

-100

-150 720

540

360

180 10
1

10

10

10

10

Frequency (Hz)

Figure 30. Complementary sensitivity of the system. In order to suppress the error measurements with frequencies equal or higher than 100 Hz, we add a notch filter at 100 Hz and we change the desired bandwidth to a value lower than 100 Hz in this case 25Hz. The new controller has the structure: = 0.05 2 120 2 0.01 + +1 2 1210 2 1210 2 + +1 2 1210 2 1210 2 0.01 +1 +1 2 100 2 12 2 0.95 + + 1 2 150 + 1 2 100 +

+1

2 100

The complementary sensitivity obtained with this controller is presented in Figure 31, its possible to observe that measurement errors with frequencies equal or higher than 100Hz are suppressed. To check this, we implemented the fitted system and the designed controller in simulink and we add a sinusoidal measurement error with frequencies 100Hz, 200Hz and 400Hz, as reference we used an unitary step. In Figure 32 we plot the measurement error , its fast Fourier transform and the obtained output y, we can see that the measurement error is suppressed and that the error is close to 0.

2 100

25

Complementary sensitivity 50

Magnitude (dB) Phase (deg)

-50

-100

-150 900 720 540 360 180 10


0

10

10

10

10

10

Frequency (Hz)

Figure 31. Complementary sensitivity obtained with controller C2.

1 0.5 0 -0.5 -1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

Time (s)
0.8 FFT() 0.6 0.4 0.2 0 0 50 100 150 200 250 300 350 400 450 500

Frequency (Hz)
1.5 y 1 0.5 0 -0.5 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

Time (s)

Figure 32. Measurement error (Top), FFT of the measurement error (Center) and system output with unitary step reference (Bottom).

26

4. FREQUENCY RESPONSE MEASUREMENTS


4.2. Frequency response function of a mass system
We need to create a simulink model with a PD-controlled mass of 1kg, with bandwidth of 10Hz, which can track a prescribed setpoint as function of time. We injected a noise signal just behind the controller block as presented in Figure 33.

xs To Workspace Random Number

d To Workspace3

0 Constant

DCT pd Dctpd
e To Workspace1 u To Workspace2

1 s

1 s

y To Workspace4

Integrator Integrator1

Figure 33. PD-controller mass model with noise signal after the controller block. We simulated the model over 120s with the fixed step Euler solver with step size 0.001s. Using an reference equal to 0, we obtain the signals presented in Figure 34, where we can see that e=-y. From the time domain plot, we cant obtain more information about the signals. On the other hand, frequency domain plots let us see that even when the disturbance is white noise, the control signal only has frequency components between 0 Hz and 100 Hz and 400 Hz and 500 Hz. Meanwhile the error and output signals only have low frequency components.
x 10
-3

5 0 -5

0.02

e y 0 20 40 60 Time (s) 80 100 120

0.01 0 0 x 10
-3

50

100

150

200 250 300 Frequency (Hz)

350

400

450

500

5 d 0 -5 0 20 40 60 Time (s) 80 100 120

1 0.5 0

50

100

150

200 250 300 Frequency (Hz)

350

400

450

500

2 0 -2 0 20 40 60 Time (s) 80 100 u

0.02 0.01 0 0 50 100 150 200 250 300 Frequency (Hz) 350 400 450 D

120

500

Figure 34. Signals in time domain (Left) and Frequency domain (Right).

27

We obtained the FRF of sensitivity of the system along with the coherence function, and we plotted them in Figure 35. Before 10 Hz, magnitude of sensitivity has negative values which agree with expected bandwidth because controller is designed with bandwidth 10 Hz. The coherence function is close to 1 as expected because system is linear and signals are not correlated. After 400 Hz, magnitude dropped because of sampling process.

100 Magnitude S 0 -100 -2 10 200 Phase S 0 -200 -2 10 1 Coherence S 0.5 0 -2 10

10

-1

10 10 Frequency (Hz)

10

10

10

-1

10 10 Frequency (Hz)

10

10

10

-1

10 10 Frequency (Hz)

10

10

Figure 35. FRF of the sensitivity of the system and Coherence function. We computed the open loop FRF from the sensitivity FRF. Bandwidth is equal to 10 Hz. Phase margin is close to 90. Gain margin is approximately 1/24.03 dB and the modulus margin is 0.6dB. For high frequencies (larger than 10 Hz), the phase of the FRF exhibits a drop caused by the sampling process.

100 Magnitude CP 50 0

-50 -2 10

10

-1

10 10 Frequency (Hz)

10

10

200 Phase CP 100 0 -100 -200 -2 10


-1 0 1 2 3

10

10 10 Frequency (Hz)

10

10

Figure 36. Computed open loop FRF from the sensitivity.

28

After measuring the FRF response of the PD controller, we used that FRF along with the FRF of the open loop system to compute the FRF response of the double integrator (The plant), the results are plotted together in the Figure 37. We can see that the plant FRF resembles a double integrator, because its magnitude has a -2 slope and the phase is close to 180 until the phase starts to drop because the sampling process.

200 100 0 -100 -200 -2 10 Magnitude PD controller Magnitude P

10

-1

10 10 Frequency (Hz)

10

10

200 100 0 -100 -200 -2 10 Phase PD Controller Phase P 10


-1

10 10 Frequency (Hz)

10

10

Figure 37. FRF of the PD controller and the plant.

4.3. Closed loop FRF measurement


We used the controller and plant model given in the simulink model frf_ex3.mdl, we introduce a noise signal between the controller and the plant, as showed in Figure 38. To measure the sensitivity of the closed loop system, we use the signals d and u.
e To Workspace3 u To Workspace

0 Constant Controller d Random Number To Workspace1 Plant

y To Workspace2

Figure 38. Simulink model used for the closed loop FRF measurement.

29

In Figure 39, the closed loop sensitivity and its coherence are plotted, The coherence is not equal to 1 for frequencies lower than 2 Hz because the magnitude of the sensitivity as such frequencies is lower than 0dB, then noise measurements are dominant. The measurement is reliable at frequencies between 2 Hz and 400 Hz.
Magnitude (dB)

20 Magnitude S 0 -20 -1 10 200 Phase S 0 -200 -1 10 1 Coherence S 0.5 0 -1 10

10

10 Frequency (Hz)

10

10

Phase (Degrees)

10

10 Frequency (Hz)

10

10

Magnitude (dB)

10

10 Frequency (Hz)

10

10

Figure 39. Closed loop sensitivity and its coherence. In order to measure the process sensitivity of the closed loop, we need to use the signals d and e, in order to obtain its FRF measurement and coherence. This measurements are plotted in Figure 40, where we can see again that the coherence has problems when the process sensitivity is lower than 0 dB, making the noise more dominant in this case. We can conclude that measurement is reliable for frequencies between 2 Hz and 100 Hz.
100 Magnitude PS 0

-100 -1 10 200 0

10

10

10

10 Phase PS

-200 -1 10 1 0.5

10

10

10

10 Coherence PS

0 -1 10

10

10

10

10

Figure 40. Process sensitivity and its coherence.

30

To determine the plant dynamics using the closed loop and process sensitivities, we divide the process sensitivity by the sensitivity, obtaining the FRF measurement of the plant: = 1+ 1+ 1 =

The FRF results are plotted in Figure 41. Bad amplitude estimate could be caused by correlated signals or nonlinearities. In this case, because we use r=0 and white noise, we are sure that the signals are uncorrelated, but we aren't sure about the nonlinearities. The phase drop is mainly caused by the sampling process and the way to diminish this problem is using higher sampling frequencies.
100 Magnitude P 50 0 -50 -100 -1 10 200 Phase P 100 0 -100 -200 -1 10

10

10

10

10

10

10

10

10

Figure 41. FRF measurement of the plant. To study the effects of the different values of nfft and the simulation time, we repeat this process with time simulations of 60s, 120s and 240s, while we use for nfft the values needed to obtain sample resolutions of 0.0625Hz, 0.125Hz and 0.25Hz, this values are 16000, 8000 and 4000 respectively. In Figure 42, Figure 43 and Figure 44 we plotted all these results. We can see that the sensitivity has higher coherence when the nfft is higher, but the process sensitivity coherence shows that higher values of nfft make the noise more dominant in the process sensitivity. We also see that higher simulation times result in FRF measurements that arent dominated by the noise, which means that in order to have reliable FRF measurements, we need to have a high nfft and a high simulation time.

31

Coherence S 1 150 100 50 0.6 0 0.4 -50 0.2 Time = 60, nfft = 16000 Time = 60, nfft = 8000 Time = 60, nfft = 4000 10
-1

Magnitude P

0.8

-100 -150 -2 10

Time = 60, nfft = 16000 Time = 60, nfft = 8000 Time = 60, nfft = 4000 10
-1

0 -2 10

10

10

10

10

10

10

10

10

Coherence PS 1 200 150 0.8 100 0.6 50 0 0.4 -50 Time = 60, nfft = 16000 Time = 60, nfft = 8000 Time = 60, nfft = 4000 10
-1

Phase P

-100 -150
0 1 2 3

0.2

Time = 60, nfft = 16000 Time = 60, nfft = 8000 Time = 60, nfft = 4000 10
-1

0 -2 10

10

10

10

10

-200 -2 10

10

10

10

10

Figure 42. Sensitivity and process sensitivity coherences, FRF of the plant with 60s simulation time.
Coherence S 1 150 Magnitude P

0.8

100

0.6

50

0.4

0.2

Time = 120, nfft = 16000 Time = 120, nfft = 8000 Time = 120, nfft = 4000 10
-1

-50

Time = 120, nfft = 16000 Time = 120, nfft = 8000 Time = 120, nfft = 4000 10
-1

0 -2 10

10

10

10

10

-100 -2 10

10

10

10

10

Coherence PS 1 200 150 0.8 100 0.6 50 0 0.4 -50 Time = 120, nfft = 16000 Time = 120, nfft = 8000 Time = 120, nfft = 4000 10
-1

Phase P

-100 -150
0 1 2 3

0.2

Time = 120, nfft = 16000 Time = 120, nfft = 8000 Time = 120, nfft = 4000 10
-1

0 -2 10

10

10

10

10

-200 -2 10

10

10

10

10

Figure 43. Sensitivity and process sensitivity coherences, FRF of the plant with 120s simulation time.

32

Coherence S 1 150

Magnitude P

0.8

100

0.6

50

0.4 Time = 240, nfft = 16000 Time = 240, nfft = 8000 Time = 240, nfft = 4000 10
-1

0 Time = 240, nfft = 16000 Time = 240, nfft = 8000 Time = 240, nfft = 4000 10
-1

0.2

-50

0 -2 10

10

10

10

10

-100 -2 10

10

10

10

10

Coherence PS 1 200 150 0.8 100 0.6 50 0 0.4 -50 Time = 240, nfft = 16000 Time = 240, nfft = 8000 Time = 240, nfft = 4000 10
-1

Phase P

-100 -150 -200 -2 10

0.2

Time = 240, nfft = 16000 Time = 240, nfft = 8000 Time = 240, nfft = 4000 10
-1

0 -2 10

10

10

10

10

10

10

10

10

Figure 44. Sensitivity and process sensitivity coherences, FRF of the plant with 240s simulation time.

5. FEEDFORWARD CONTROL
5.1. Mass Feedforward design
We want to control a system with transfer function

In this case we use a stabilizing controller to achieve an stable closed loop with bandwidth of 10 Hz, the controller has the structure: = 2 8.78 2 0.1 +1 +1 +1 2 8.78 2 3.9 2 4.2 0.018 + 1 2 0.19 + + 1 2 38 + 1 2 52 + 1 2 8.78 +
rd

In the Figure 45 the acceleration pattern used for the 3 order reference and the error obtained with this -3 controller are plotted, the maximum error is 2.1x10 , we also observed that the error is 0 when the acceleration is 0 (When we have constant velocity). The acceleration feedforward parameter corresponds to the mass of the system if we thought of this as an analogue of the mass-damper-spring system, then the feedforward gain is Ka=1/1000. In Figure 45 we plotted the new error which is close to 0 for all the

2 8.78

33

interval when the acceleration is constant and has a maximum value of 2x10 changes.
0.5

-4

after the acceleration

Acceleration

-0.5

0 x 10
-3

10

15

20 Time (s)

25

30

35

40

4 2 0 -2 -4

Error with Ka=0

0 x 10
-4

10

15

20 Time (s)

25

30

35

40

4 2 0 -2 -4

Error with Ka=1/1000

10

15

20 Time (s)

25

30

35

40

Figure 45. Acceleration for the 3 order reference (Top), error without feedforward (Center) and error with acceleration feedforward (Bottom).

rd

5.4. Feedforward design


We use the model given in the simulink model feedforward.mdl, presented in Figure 46. We need a relatively low bandwidth controller for feedforward design because we need a controller that allows us to see the phenomena of mass acceleration, viscous damping and dry friction, and a high bandwidth controller will have such fast response that wouldn't allow us to see those phenomena.

Kfa Gain t Clock T o Workspace3 Sign Kfc Gain2 Kfv

Ref3

acc vel pos

Gain3
In1 Out1

Plant

Lead / lag acc To Workspace1 pos To Workspace2 e T o Workspace

Figure 46. Feedforward model.

34

In Figure 47 we plotted the acceleration pattern used and the error without feedforward controller, in this -2 -4 case the maximum error is 1.4x10 . After tuning the Kfc value to 1.6x10 the maximum error diminished -4 -6 to 8.1x10 , then with the Kfv value tuned to 5x10 we obtain an error close to 0 when the acceleration is 0 -4 -6 and a maximum error of 4x10 . After tuning the Kfa value to 9.6x10 , we obtain a maximum error of -6 8.4x10 .
0.5 Acceleration 0 -0.5

10 Time (s)

12

14

16

18

20

0.02

Error without feedforward


0

-0.02

0
-3

10

12

14

16

18

20

Time (s) 1 0 -1 x 10

K fc tunned K fc Kfv tunned K fc Kfv Kfa tunned 0 x 10


-5

10 Time (s)

12

14

16

18

20

1 0 -1

K fc Kfv Kfa tunned

10 Time (s)

12

14

16

18

20

Figure 47. Acceleration, error without feed forward and error with feedforward.

6. The Digital Environment


6.1. Delay and Sampling
It is known that sampling process makes the continuous time systems discrete. Also, sampling introduces the delay to the system as a typical non linear phenomenon. The delay frequency response Hd (jw) is given below with a total delay time Td. = = cos sin cos = sin wT = + sin tan

=1

As expressed above equation, -Td is seen in the phase equation. It causes decrease of phase due to delay. Also, sampling and calculation cause delay which is independent from frequency of the input. Resulting phase delay calculation is shown below:

35

At 10 Hz , the resulting phase delay given the total delay time is: 10Hz = 10 2 1.1

= 1 10

+ 100 10

= 1.1 10 180 = 3.96 2

= 1.1

In Figure 48, we plotted the phase delay obtained with the given. total delay time.

0 -5 -10 -15 -20 -25 -30 -35 -40 -1 10

Phase delay (Degrees)

10

10

10

Frequency (Hz)

Figure 48. Represents the phase drop due to delay

6.2. Digital Control Systems


Firstly a lead controller with a zero at 10 Hz and a pole at 100 Hz is designed as shown below, +1 0.01592 + 1 = 2 10 = + 1 0.001592 + 1 2 100

In Figure 49 we presented the frequency response of the lead controller and different discrete time equivalents

36

1.2 1 Magnitude (dB) 0.8 0.6 0.4 0.2 0 -0.2 -1 10


0 1 2 3 4

C zoh foh Tustin Prewarping Matched

10

10

10 Frequency (Hz)

10

10

80 60 Phase (Degrees) 40 20 0 -20 -40 -60 -80 -1 10 C zoh foh Tustin Prewarping Matched 10
0

10

10 Frequency (Hz)

10

10

Figure 49. Magnitude Frequency response of a lead filter and its discrete time equivalents. Firstly, discrete functions are valid up to half of the sampling frequency. As seen in the Figure 49, zero order method gives the worst approximation. On the other hand, other methods give approximately same solution. In addition, before 3 Hz, all methods are accurate. Between 3 Hz and 300 Hz, it can be said that except zero order method, all methods give accurate approximation to continuous time system but Tustin and Prewarping approximations give a little bit better solution compared to First Order and Matched. After 300 Hz, none of them gives close solution to continuous time system. Finally, it can be said that all approximations provide best solutions for low frequencies. Additional to lead controller, a notch added to the system with a depth of 20 dB and a damping of the zeros of 0.01 at 200 Hz. = 200 2 + 2.0.01 + 1 1.008. 10 200 2 = 2.0.1 + + 1 1.008. 10 200 2 + 8.866 007 + 8.866 007 + 0.01593 + 0.001751 + 1 + 1

In the frequency response of the continuous time controller and its discrete time equivalents is plotted, as mentioned above, discrete functions are only valid up to half of the sampling frequency. After that point, due to aliasing, data is lost.

200 2

37

1.4 1.2 1 Magnitude (dB) 0.8 0.6 0.4 0.2 0 -0.2 -1 10 10


0

C zoh foh Tustin Prewarping Matched

10

10 Frequency (Hz)

10

10

80 60 Phase (Degrees) 40 20 0 -20 -40 -60 -80 -1 10 C zoh foh Tustin Prewarping Matched 10
0

10

10 Frequency (Hz)

10

10

Figure 50. Magnitude Frequency response of a lead + notch filter and its discrete time equivalents. When magnitude and phase diagrams are examined, it is seen that Zero-order is the worst one. If the controller was designed to stabilize a plant with a real resonance at 200 Hz, the best controller option is the matched controller, because it's the only one that show the same anti-resonance at 200 Hz and a similar phase with the 200 Hz sampling frequency. If the frequency to 1KHz is increased, the First-Order hold controller could be used too, at 2KHz we can use all the controller but the zero order hold controller, because its gain and phase doesn't match the designed controller. Discretizing a continuous time controller can sometimes yield closed loop instability because several reasons: The discretization process always causes a phase lag, which can change the response the controller at the desired frequency. The discretization method also create anti resonances that the original controller doesn't exhibit, depending on the sampling frequency. 3, some discretization method need high sampling frequency in order to match all the resonances and anti resonances of the designed controller. Aliasing is the another problem for closed loop instability because after some point data is lost.

38

MOTION CONTROL EXPERIMENTS


Experiment 2. Frequency Response Measurements
For parts a, b and c use the closed loop Simulink scheme. Connect the setup in the motor-feedback case. a. Determine the plant FRF using a sampling frequency of 2000 Hz. What do you observe? Try to relate all (anti-)resonances and phase phenomena to the setup. Measurements are made in closed-loop, so the relevant signals are the control effort, u, and the disturbance, d. In this case the simulink scheme is presented in the Figure 51. We used 240 seconds of measurements with the given sample frequency.
1 Out2 3 Out4

0 Constant

Input

Output

ENC0 [rad] DAC0 (motor) [V] ENC1 [rad]

simple01
Random Number 2 Out3

Pato setup1

Figure 51. Simulink scheme of the closed loop FRF measurement. Using the equations presented on the lecture, we first calculate the Sensitivity function of the closed loop using the command: nfft = 2^14; [S hz]=tfestimate(d,u,hann(nfft),nfft/2,nfft,fs); In order to calculate the FRF of the system, we need to calculate first the FRF of the used controller which has the next transfer function: = 2 200 0.005 + 0.2 + 2 200 +1

This controller is a PD controller with a second order low-pass filter with 200 Hz frequency. The equation that allows us to find the FRF of the system is: = 1

So we can obtain the FRF of the system using the next commands: CFR=squeeze(freqresp(C,hz)); H=CFR.^-1.*((S).^(-1)-1); The response of the system is shown in the Figure 52, we can observe that after 1 Hz the phase of the plant is -180 and the magnitude has a -2 slope, which is caused by the 2 integrators that theoretically the

39

system has. We also observe the existence of 2 stable zeros close to 40 Hz and 2 stable poles close to 50 Hz, and this behavior is the expected from the theory. The phase lag between 0.1 and 1 Hz could be explained by the friction present in the motor and the setup, this friction causes the motor to be stopped when the applied force is not high enough. The system seems to have another dynamic close to 1 KHz which is the maximum frequency we can obtain with the sample frequency of 2 KHz, this is a good reason to change the sample frequency to a higher one.

100 Magnitude of the plant 50 0 -50 -100 -150 -1 10

Magnitude (dB)

10

10

10

10

Frequency (Hz)
200 Phase of the plant 100

Phase

-100

-200 -1 10

10

10

10

10

Frequency (Hz)

Figure 52. FRF of the plant. b. Change the sampling frequency to 4000 Hz and 8000 Hz (or 1000 HZ) respectively and again determine the plant FRF. Compare the measurements. What do you observe? Using the same commands used in part a. with the sampling frequencies 4000 Hz and 1000 Hz, we obtain two new FRF for the plant. These FRF are presented in Figure 53, the position of the zeros and poles of the plant are the same for the 3 measured FRF, and the phase diagrams are similar too. We can observe that the system exhibits two stable poles near to 1000 Hz, this poles may be part of the motor system because the motor is the actuator of the system and we are measuring all the setup together. Also, its clear that the poles at 1000 Hz can only be measured when the sampling frequency is higher than 2000 Hz. The most important difference between the measured FRFs of the plant is that the phase diagrams look more like expected when the sampling frequency increases, for example the 180 degrees shift caused by the 2 poles of the plant is more evident with the 4000 Hz sampling frequency. Also, the lag between the phase diagrams can be explained by the sampling process, because this process introduces a lag in the system of the half of the sample time, then when the sampling frequency increases the sampling time diminishes as the lag in the system.

40

100 50 4 KHz 2 KHz 1 KHz

Magnitude (dB)

0 -50 -100 -150 -200 -2 10 10


-1

10

10

10

10

10

Frequency (Hz)
200 4 KHz 2 KHz 1 KHz

100

Phase

-100

-200 -2 10

10

-1

10

10

10

10

10

Frequency (Hz)

Figure 53. FRF of the plant measured with 3 different sample frequencies. c. Design 2 or 3 different PD-controllers with significantly different bandwidths and measure the sensitivity and plant FRF of the system for each controller. Interpret results, and determine the influence of the bandwidth on your measurements. The bandwidth of the system is approximately 8 Hz and, looking at the FRF of the system, we can conclude that a PD controller will change the bandwidth of the system increasing the bandwidth when the Proportional part increases and the Derivative part remains constant and decreasing the bandwidth as the Proportional part decreases. We designed 3 different PD controllers and using the FRF of the system we calculated the new Bandwidth as presented in the Table 3. Table 3. Designed PD controllers and approximated bandwidth CONTROLLER 1 2 3 P 2 0.05 4 D 0.005 0.005 0.005 Bandwidth (Hz) 54 9 75

The measured FRF of the system with the different PD controllers is presented in Figure 54, we can observe how the controllers with higher bandwidth are more sensitive to lower frequencies, causing the measured FRF to be affected on those lower frequencies and the measured FRFs are closer for frequencies higher than 12 Hz. This could be caused by the fact that the controllers with higher bandwidth have, in this case, a higher stiffness and the disturbance has to be higher in order to move the mass. As conclusion, we could claim that in order to obtain good closed loop FRF measurement in our setup we need to use controllers with low bandwidth.

41

100 50 C1 C2 C3

Magnitude (dB)

0 -50 -100 -150 -200 -1 10 10


0

10

10

10

10

Frequency (Hz)
200 C1 C2 C3

100

Phase

-100

-200 -1 10

10

10

10

10

10

Frequency (Hz)

Figure 54. FRF measured with different PD controllers. d. Measure again the plant FRF, but now in open-loop using QadScope. Compare the result with the closed-loop measurement. For the open-loop measurement, we used 4000 Hz as sampling frequency and a white noise signal as input for the system, the FRF is presented in the Figure 55. We can observe that the measurements are similar, but looks like the open-loop FRF has a higher gain, causing the bandwidth of the system to be close to 200 Hz, when the closed-loop bandwidth was at 8 Hz. In the other hand, the open-loop phase diagram has a 180 degrees shift compared with the closed-loop measurement, this can be explained by a -1 factor in the transfer function, caused by a wrong wire connection of the output or the input of the system, meanwhile this wrong connection doesnt affect the closed-loop measurement because the closed-loop measurement takes account for every gain in the system. As another conclusion, we can be more confident of FRF measurements in closed-loop.

42

200

scope 1: [counts/V in dB]

100

Open-Loop with QadScope Closed-Loop with Simulik

-100

-200 10

10

10

10

freq [Hz]
200

scope 2: [deg]

100

-100

-200 10

10

10

10

freq [Hz]

Figure 55. Open-loop FRF using QadScope and Closed-loop FRF.

Experiment 3. Feedforward tuning


For this experiment we use the motor feedback case with the pato01.mdl scheme, we use the outputs presented in the Figure 56, at the beginning we set the feedforward gains at 0 and we tuned the controller to obtain a tracking error suitable for the feedforward tuning process. The setpoint used is presented in Figure 57.

Kfa Kfa Clock Actual time in s Kfv 4 Out1 -KRef acc scaling 5
On/Of f

Kfv Kfc Sign 3 e Kfc 2 u

start

Ref3

acc vel pos

Out2

ENC0 [rad] DAC0 (motor) [V] Output ENC1 [rad]

Input

Ref power

Controller
Out3 6 Noise 1 w

Pato setup

Figure 56. Motor feedback scheme for feedforward tuning.

43

150 Set point position (rad) 100 50 0 -50 0 2 4 6 8 10 Time (s) 12 14 16 18 20

100 Velocity Velocity (rad/s) 50 0 -50 -100 0 2 4 6 8 10 Time (s) 12 14 16 18 20

400 Acceleration (rad/s ) Acceleration 200 0 -200 -400 0 2 4 6 8 10 Time (s) 12 14 16 18 20


2

Figure 57. Setpoint trajectory used for the feedforward tuning. The PD controller used has proportional gain Kp=1 and derivative gain Kv=0.1. In Figure 58 we plotted the tracking error along with the acceleration with the feedforward gains set to 0. In this case we can see that the error is different from 0 even when the velocity is constant (Acceleration equal to 0).

0.6 Error 0.4 Error (rad) 0.2 0 -0.2 -0.4

6 Time (s)

10

12

300 Acceleration 200 Acceleration (rad/s )


2

100 0 -100 -200 -300

6 Time (s)

10

12

Figure 58. Tracking error and acceleration without using feedforward. We used the real time QadScope in order to check the error while tuning the feedforward gains. After the tuning process, the feedforward gains were set to the values: Kfc=0.0035, Kfv=0.0005, Ka=4.7

44

The tracking error obtained with the feedforward controller is presented in Figure 59 and compared with the error without feedforward and the acceleration pattern, the maximum error was diminished until 10% the original tracking error and is close to 0 when the acceleration is 0. We can say that the oscillations on the error are caused by the position encoding process.

0.05 Error with Feedforward Error (rad)

-0.05

254

256

258 Time (s)

260

262

264

0.6 0.4 Error (rad) 0.2 0 -0.2 -0.4 0 2 4 6 Time (s) 8 10 12 Error without feedforward

400 Acceleration (rad/s ) Acceleration 200 0 -200 -400 254 256 258 Time (s) 260 262 264
2

Figure 59. Tracking errors obtained with and without feedforward.

Experiment 4. Loop shaping game


We are using the load feedback setup for this experiment, based in the results from exercise 1.4. Control of a motion system, we can expect that the new system has the same frequency response that the motor feedback case without the 2 zeros close to 30 Hz, in this case we expect only one zero close to 2000 Hz, as plotted in Figure 60. This figure was obtained using the FRF measurements of the motor feedback case in Experiment 2. Frequency Response Measurements, but eliminating the 2 zeros and adding the expected zero. Based in this expected result, we designed a stabilizing controller for the plant composed by a lead filter, a notch and a second order lowpass filter, the two last ones block were added by the experience working with the motor setup. The resulting controller has the structure: +1 = 2 1 +1 2 9 2 800 2 +1 2 800 2 + +1 2 800 + 1 2 0.2 +1 2 200

2 800

2 200

45

Bode Diagram 100 Motor feedback 0 Magnitude (dB) -100 -200 -300 -400 360 Motor feedback Load feedback Phase (deg) 180 Load feedback

-180 10
0

10

10

10

10

10

Frequency (Hz)

Figure 60. Expected motor and load feedback responses. We used DCtools in shapeit to obtain the discrete time equivalent of our controller and implemented this in matlab to perform a FRF measurement of the system, the simulink scheme is presented in the Figure 61, in this case we introduce a noise signal between the controller and the plant in order to measure the sensitivity of the closed loop system.
2 Out2 3 Out3

ENC0 [rad]
0 Constant

Input

Output

DAC0 (motor) [V] ENC1 [rad]

Controller
4 Out4 Random Number 1 Out1

Pato setup1

Figure 61. Simulink scheme for the FRF measurements. After measuring the disturbance and control signal, we calculated the sensitivity of the closed loop and its coherence and plotted them in Figure 62, we observe that the coherence is lower than 1 for the frequencies lower than 2 Hz, this could be caused by the low sensitivity at those frequencies, making the noise the dominant signal. Our first conclusion is that our measurements are reliable for the frequencies between 2 and 2000 Hz. Using the measured response of the controller, presented in Figure 63, and the measured sensitivity, we obtain the plant FRF using the expression: = 1

46

5 Magnitude (dB) 0 -5 -10 -15 -20 -1 10 100 Phase (Degrees) Phase S 50 0 -50 -1 10 10
0

Magnitude S

10

10 Frequency (Hz)

10

10

10

10

10 Frequency (Hz)

10

10

1.4 1.2 Coherence 1 0.8 0.6 0.4 -1 10 10


0

Coherence

10

10 Frequency (Hz)

10

10

Figure 62. measured closed loop sensitivity and coherence.

Bode Diagram 0

Magnitude (dB) Phase (deg)

-50

-100

-150

-200 450 360 270 180 90 0 10


0

10

10 Frequency (Hz)

10

Figure 63. Controller frequency response. The resulting plant FRF measurement in plotted in Figure 64, where we can see that the frequency start approximately at -180 (We should remember that the measurements are reliable after 2 Hz) and we have the phase 180 drop caused by the 2 poles close to 52.5Hz. Also we can see how the noise becomes dominant for high frequencies where the magnitude of the plant is lower than 0 dB and that the phase has a constant drop caused by the sampling process.

47

50 Magnitude plant 0 Magnitude (dB) -50 -100 -150 -200 -250 -300 -1 10
0 1 2 3 4

10

10

10 Frequency (Hz)

10

10

200 150 Phase (Degrees) 100 50 0 -50 -100 -150 -200 -1 10 10


0

Phase plant

10

10 Frequency (Hz)

10

10

Figure 64. Plant FRF measurement. Using this measurement, we designed a controller with a higher bandwidth keeping in mind the constraint |S|<6dB. In this case we use a PD controller with a notch filter and a lead filter to achieve stability and a higher bandwidth, we also include the notch filter at 800Hz and the low pass filter at 200Hz trying to avoid the high frequency resonances of the plant. The final controller has the structure: = 2 20 +1 2 4 +1 +1 1 2 0.2 +1 2 200

2 52

We achieve a Bandwidth of approximately 17.3 Hz, as showed in the Figure 65, and the modulus margin is approximately 5.873dB which is lower than the given constraint. Both open loop frequency response and sensitivity for the plant and the controller are plotted in the Figure 65.

2 52

2 0.1 +1 2 52 2 0.5 + +1 2 52 +

2 800

2 800

2 +1 2 800 2 + +1 2 800 +

2 36

2 200

48

open loop
Magnitude [dB]
X: 17.33 Y: 0.04125

sensitivity
Magnitude [dB] 20 0 -20 -40
X: 25.63 Y: 5.873

0 -100 -200 10
0

10

10

10

10

10

10

10

180 Phase []

180 Phase [] 90 0 -90 -180


10
0

90 0 -90 -180 10 Frequency [Hz]


1

10

10

10

10 Frequency [Hz]

10

10

Figure 65. Frequency response for C2(s)H(s) (left) and Sensitivity (Right). We implemented the controller in an experiment and we measured all the variables like in the previous parts, in this case our plant is still stable. The plots for the achieved open loop and sensitivity are presented in Figure 66. The obtained bandwidth is approximately 7.6Hz and the modulus margin is 4.833dB, both lower than the designed values. This could be explained by the discretization of the controller, because we use shapeit to obtain the discrete time equivalent of our designed controller, but we dont have completely control on the discretization method.
100 Magnitude (dB) Measured Open loop 0
X: 7.568 Y: -0.3088

Magnitude (dB)

20 0 -20 -40 -1 10 150 100 50 0 -50 -1 10 10


0 0 1

X: 52 Y: 4.833

-100 -200 -1 10 200 100 0 -100 -200 -1 10 10


0 0 1 2 3 4

Measured Sensitivity 10 10 10 Frequency (Hz)


2

10

10 10 Frequency (Hz)

10

10

10

10

Measured Open loop

Phase (Degrees)

Phase (Degrees)

Measured Sensitivity

10 10 Frequency (Hz)

10

10

10 10 Frequency (Hz)

10

10

Figure 66. Measured open loop and sensitivity for the plant. In order to check the performance of the designed controller, we plotted the time response of the output, the disturbance between the controller and the plant and the error of the system in Figure 67. We can observe that the maximum error without disturbances is 0.19rad meanwhile with noise disturbance the maximum error increases to 0.29rad. This allows us to conclude that our controller has a good performance even in presence of noise.

49

300 200 100 0 -100 0 10 20 30 40 50 Time (s) 60 70 80 90 100 xs y

2 d 1 0 -1 -2 0 10 20 30 40 50 Time (s) 60 70 80 90 100

0.4 e 0.2 0 -0.2 -0.4 0 10 20 30 40 50 Time (s) 60 70 80 90 100

Figure 67. Time response of the load feedback setup.

50

REFERENCES
[1] Witvoet, G. 4K410 Motion Control Lectures, Mechanical Engineering Deparment, Technische Universiteit Eindhoven, 2010. [2] Matlab R2010a Reference. The Mathworks. [3] Ogata, K. Modern Control Engineering, Fourth edition. Pearson Education International, 2002.

51

Das könnte Ihnen auch gefallen