联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Matlab编程Matlab编程

日期:2023-05-14 10:11

Department of Mechatronics and Robotics

MEC208 Instrumentation and Control System

S2, 2022-2023

Computer Lab (Lab 2):

Control System CAD and CAS using MATLAB

Dr. Chee Shen LIM (MEC208, Part 2)

Name:

Student ID:

Group (1 or 2):

Date:

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 4 of 14

? ver22-23-20230504, by C. S. Lim

Report Format

The format of the lab/assignment report should be of the following:

? The report should be of single column, font size 11, font style “Times New Roman”.

Please be reminded that handwritten reports will NOT be accepted.

? All figures must be clearly numbered and all plots must be clearly labelled.

? In your report, whenever necessary, you are expected to explain concisely your approach

(i.e., with full sentence and proper grammar, but please avoid unnecessarily long

explanation).

? In your answer for each question, do also include all MATLAB code/script that you used

to obtain the answers or plots (note: do not separately submit those raw .m files; answer

for each question should contain some MATLAB scripts). These codes/scripts should be

copied properly into the report, and should be standalone. For example, if you include

the code for Question 2a, you must make sure that the codes in this part alone (not linked

to other parts) can be copied by the marker into MATLAB for a quick, successful

verification.

? For analytical questions, whenever necessary, do also include your analysis and derivation.

Marks will be given on the following basis:

? The 10 questions in the “Computer Lab Work” section carry a total of 100 marks. Each

question carries 5 to 15 marks, depending on the complexity of the questions.

? Sub-marks will be awarded to technically correct analyses and comments, MATLAB

scripts, mathematical derivation (as necessitated by the questions), graphs/plots (and

annotations of the plots), and numerical answers. All analysis and comments should have

proper sentence structure and correct grammar.

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 5 of 14

? ver22-23-20230504, by C. S. Lim

Examples

This part is to introduce about how to start using the Control System Toolbox in MATLAB for

control system CAD and CAS. You are suggested to go through the examples (in this section, or

even from other online resources) before you start working on the assignment tasks.

Example 1: Input a system described by a transfer function

To construct a system model in MATLAB, the command “tf” can be used. For example, to obtain

the following input transfer function:

????2 + ???? + 1

????4 + 2????

3 + 5???? + 2

???? + 1

????4 + 2????

3 + 3????

2 + 3???? + 10 ? 10

????2 + 3

? sys1=tf([1 1 1], [1 2 0 5 2])

Transfer function:

s^2 + s + 1

---------------------

s^4 + 2 s^3 + 5 s + 2

>> sys1=tf([1 1], [1 2 3 3 10])

Transfer function:

s + 1

------------------------------

s^4 + 2 s^3 + 3 s^2 + 3 s + 10

>> sys2=tf([10], [ 1 0 3])

Transfer function:

10

-------

s^2 + 3

>> sys=sys1*sys2

Transfer function:

10 s + 10

-----------------------------------------------

s^6 + 2 s^5 + 6 s^4 + 9 s^3 + 19 s^2 + 9 s + 30

Example 2: Find the system’s zeros and poles

The commands used for this task are “pole” and “zero”. From the signs of system poles, you can

determine if the system is stable. For example, given the system G(s):

????(????) = 1

????2 + ???? + 1

Using MATLAB, the system’s poles can be obtained as follows:

>> pole(sys)

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 6 of 14

? ver22-23-20230504, by C. S. Lim

ans =

-0.5000 + 0.8660i

-0.5000 - 0.8660i

>>

Given another example with system zeros:

????(????) = 2????2 + ???? + 3

????4 + 2????3 + 5????2 + 6???? + 7

>> sys=tf([2 1 3],[1 2 5 6 7])

Transfer function:

2 s^2 + s + 3

-----------------------------

s^4 + 2 s^3 + 5 s^2 + 6 s + 7

>> zero(sys)

ans =

-0.2500 + 1.1990i

-0.2500 - 1.1990i

>>

Example 3: Obtain the system model in pole-zero format

It is at times helpful to control designers to express a system into a form of first/second-order

components. For example, given G(s) below, one can express it to pole-zero format as follows:

????(????) = 1

????4 + ????3 + 3????2 + 2???? + 6

>> sys=tf([1], [1 1 3 2 6])

Transfer function:

1

---------------------------

s^4 + s^3 + 3 s^2 + 2 s + 6

>> zpk(sys)

Zero/pole/gain:

1

----------------------------------------------

(s^2 + 1.969s + 2.609) (s^2 - 0.9693s + 2.3)

>>

There are many other control-related numerical tools in MATALB. See some of the listed examples

in Part II.

Example 4: Obtain impulse, step, and ramp input responses

The commands used for obtaining the time responses against unit-step and unit-impulse inputs are,

respectively, “step()” and “impulse()”. Taking the following system as the example, its step and

impulse responses can be obtained as follows:

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 7 of 14

? ver22-23-20230504, by C. S. Lim

1

????3 + 2????2 + 3???? + 5

>> sys1=tf([1], [1 2 3 5])

Transfer function:

1

---------------------

s^3 + 2 s^2 + 3 s + 5

>> step(sys1)

>> impulse(sys1)

To obtain system ramp input response, the following can be done. Note that the title change is

necessary to avoid confusion.

>> sys2=tf([1], [1 0])

Transfer function:

1

????

>> step(sys1*sys2)

>> title('Ramp Response')

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 8 of 14

? ver22-23-20230504, by C. S. Lim

Example 5: Obtain the equivalent/effective transfer function of a closed-loop system

The relevant command is “feedback”. You can obtain the description of this command from

MATLAB help, i.e., using command “>>help feedback”. For example, given that a system has a

forward-path transfer function G(s)

????(????) = 1

????2 + ???? + 1

and feedback-path transfer function H(s)

????(????) = 1

???? + 1

The closed-loop transfer function of the feedback system is obtainable through the following

commands:

>> sys1=tf([1],[1 1 1])

>> sys2=tf([1],[1 1])

>>sys_closed_loop=feedback(sys1,sys2,-1)

Transfer function:

s + 1

---------------------

s^3 + 2 s^2 + 2 s + 2

>>

At this stage of learning, you should be able to obtain the closed-loop transfer function through

analytical means. You are encouraged to check whether the numerical tools actually give you the

correct answer. At times, through cross-checking, you may find that there are some minor mistakes

in your own derivation or MATLAB scripts. You may also attempt the simulation questions at the

end of each chapter in the course textbook.

Optional

Before attempting the questions, apart from the numerical tools introduced above, it may be helpful

to you to spend some time understanding other numerical tools/functions (not in any particular

order) available to you in the Control System Toolbox of MATLAB.

tf

step

impulse

ramp

partfrac

ilaplace

plot

feedback

series

pzmap

pole

zero

ss

tf2ss

lsim

expm

hold on

hold off

Others (your own effort)

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 9 of 14

? ver22-23-20230504, by C. S. Lim

Computer Lab Work (10 questions)

Problem 1 [9 marks]

Consider the differential equation

????3????(????)

????????3 + 10

????2????(????)

????????2 + 58

????????(????)

????????

+ 136????(????) = 26????(????)

where y(0) = ?????(0) = ?????(0) = 0. With the help of the numerical tools of solving partial fraction

and/or inverse Laplace transform, determine the solutions/responses of ????(????) for, respectively, unit

impulse, unit step, and unit ramp of input x(t). In each case, show the s-domain partial fractions

before expressing the final time-domain expressions. Then, through the numerical tools in

MATLAB, obtain the output’s time response plots of each case for the first 5 seconds.

Problem 2 [5 marks]

Consider the block diagram in Figure P2.

Figure P2: Control block diagram with the following G and H transfer functions.

????1 = 1

???? + 2 ????2 = 1

????2 + 2???? + 2 ????3 = ???? + 1

????2 + 3 ????4 = 1

???? + 5

????1 = 2???? + 3

????2 + ???? + 2

????2 = ????

???? + 4 ????3 = ????2 + 1

????3 + 6

(a) Use an m-file to reduce the block diagram in Figure P2, obtain the equivalent closed-loop

transfer function of the above system.

(b) Use the numerical tools available, generate a pole-zero map in the graphical form and

calculate the poles and zeros of the closed-loop transfer function. Comment on the overall

system stability.

????1 ????2

????3

????3 ????4

????1 ????2

+ + +

+

? ?

????(????) ????(????)

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 10 of 14

? ver22-23-20230504, by C. S. Lim

Problem 3 [8 marks]

Consider the system

?????

1

?????

2

?????

3

 =  

?1 1 0

0 ?1 1

0 0 ?2

 

????1

????2

????3

 +  

0

0

1

 ????

y = [1 0 0]

????1

????2

????3

(a) Use the numerical tools in MATLAB, e.g., tf, determine the transfer function ????(????) =

????(????)/????(????).

(b) Assume ????(????) is a pulse input of magnitude 1 that lasts for a 2-seconds duration starting at

0 s (i.e., a pulse input means a step input that lasts for a short period), plot the response of

the system state x with initial condition ????(0) = [1 1 0]????, for 0 ≤ ???? ≤ 10.

(c) State the ????(3) values the same initial condition and input as part (b). Determine and

comment on how these x values at t = 3 s will be different if the input is never excited

(means zero for the entire 10 s period).

Problem 4 [5 marks]

Consider the closed loop transfer function

????(????) = 2s2 + 3s + 1

????5 + 3????4 + 2????3 + 5????2 + 5???? + 5

(a) Explain Routh-Hurwitz stability criterion with your own words. Then, use the RouthHurwitz criterion to determine whether the system is stable. If it is not stable, how many

poles are in the right-half plane?

(b) Compute the poles of ????(????) and then verify the result in part (a).

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 11 of 14

? ver22-23-20230504, by C. S. Lim

Problem 5 [15 marks]

Consider the following transfer function:

????(????) = 6s2 + 18s + 14

????4 + 7????3 + 12????2 + 17???? + 14

(a) Identify the dominant complex poles and complex zeros (if any) of the system. Then,

calculate the dominant complex poles’ natural frequency, damping factor, characteristic

rise time (0 to 100%), peak time, percent overshoot and 2% settling time.

(b) Plot and clearly label the unit-step response of G(s).

(c) Obtain from the figure in part (b) the exact rise time, peak time, percent overshoot, and 2%

settling time of the output response. Compare and comment on the difference between them

and the answers from part (a). [Hint: you may need to write the code manually to find these

values.]

Problem 6 [13 marks]

A control system is shown in Figure P6.

Figure P6

(a) Using MATLAB, plot the root locus assuming an ideal sensor H(s) = 1.

(b) It is found later than the sensor has a 1 second delay in the measurement, resulting in H(s)

being e-s instead of just “1”. Using MATLAB, plot the new root locus. Clearly state the

assumption used.

(c) Refer to the theoretical/characteristic behavior of second-order complex poles as the design

guides, analyze the root locus in part (b) and propose suitable ???? value that produces an

overall step response with a percent overshoot less than 15 % and with (approximately) the

shortest possible 2% settling time. Explain and verify your gain selection.

1

????(????2 + 3???? + 5)

????(????)

+

?

????(????) ????(????)

Process

Sensor

????(???? + 1)

(???? + 5)

Controller

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 12 of 14

? ver22-23-20230504, by C. S. Lim

Problem 7 [10 marks]

Figure P7 is a block diagram model of a model for an altitude-rate control system.

Figure P7

(a) Assume that Gc is yet to be designed (means Gc = 1), plot the system’s unit-step response.

(b) Through a series of control design, it is decided that Gc should the form of ???????? =

????(????+2)2(????+5)

(????+10)2(2????+0.1)

, where (????+2)2

(????+10)2 is a essentially a cascaded lead compensator, and K is the

control gain to be designed. If it is desired to place a pair of the closed loop poles as close

as possible to ???? = ?2 ± ????2 for a quick/fast transient response, use the numerical tools in

MATLAB to estimate the most suitable value of K. Show all relevant plots in the process

of finding this gain. Then, state the damping factor and natural frequency of the dominant

complex poles.

(c) Use the selected K value in part (b), obtain the step and ramp responses for the first 10

seconds. Clearly label the plot.

Problem 8 [10 marks]

Figure P8 shows a closed-loop system with a tunable feedback parameter k, where k is a positive

number.

Figure P8

1

????

2???? + 0.1

????2 + 0.2???? + 2

1

+

?

????(????) ????(????)

Hydraulic servo Aircraft

Rate gyro

????????

Controller

1

????

10

(2???? + 1)(???? + 5)

????

+

?

????(????) ????(????)

+

?

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 13 of 14

? ver22-23-20230504, by C. S. Lim

(a) Draw a root locus diagram to reflect the effect of changing k. Then, determine the range of

possible k values that can produce a pair of dominant oscillatory/complex poles with the

characteristic damping factor more than 0.4 and the characteristic 2% settling time less

than 1.6 s.

(b) Analyze the plot in part (a) and propose the final value of k that can produce a quicker

possible response. Then, plot the unit-step response of the output y(t), and comment on the

effect of third pole onto the overall behavior of the system.

Problem 9 [15 marks]

An aircraft’s pitch rate model is shown in Figure P9. The model characteristics have the following

values:

???????? = 3, ???? = 0.2, ???? = 0.15

The gain factor K1, however, will vary over the range 0.01 at lightweight cruise conditions to 0.2

at heavy-weight descent conditions. K2 is the controller gain.

Figure P9

The flight control system must provide good handling characteristics and comfortable flying

conditions. The desired closed-loop characteristics of the dominant roots of the control system

shown in Figure P10 should have a damping factor of ???? = 0.7071.

(a) Sketch the root locus as a function of the scalar gain K1K2.

(b) Determine the gain K2 necessary to yield the dominant oscillatory roots with ???? = 0.7071

when the aircraft is in the heavy-weight descent condition.

(c) With the K2 gain found in part (b), determine the ???? of the dominant oscillatory roots under

lightweight descent condition. Comment on the difference between the two damping

factors values, and the effect to the aircraft under lightweight cruise condition.

????1(???????? + 1)

????2 + 2???????????????? + ????????

2

????2(???? + 1)2

(???? + 9)(???? + 90)

+

?

????(????) ????(????)

10

???? + 10

1

Controller Actuator Aircraft dynamics

Rate gyro

MEC208 Lab 2: Control System CAD and CAS using MATLAB

Page 14 of 14

? ver22-23-20230504, by C. S. Lim

Problem 10 [10 marks]

As a new control engineer in Suzhou electric vehicle company, you are assigned tasks to analyze

and propose a solution to the EV Interior permanent magnet motor’s speed control problem shown

in Figure P10, where R is the reference input, ???????? is the torque disturbance, and ???? is the motor

speed. You are supposed to justify your design solution using the control system understanding

from Part 2 of the module (in the form of textual description), mathematical derivation, simulation

result, or any other means deemed appropriate.

Figure P10

(a) Parameters of the motor speed dynamic’s transfer function are measured by a junior

mechanical engineer as ???? = 1 ± 0.01 and ???? = 0.1 ± 0.01 , where the “±0.01 ” is the

measurement tolerance. Your first task is to propose a suitable form of controller ????????(????) that

can eliminate the steady-state motor speed error due to step disturbance. Explain your

answer with sufficient evidences, and suggest the gain/parameter value(s) accordingly.

(b) If it is found later that a mistake was committed by the junior mechanical engineer, in which

the average ???? value obtained through the experiments should be 0.01 instead of 0.1.

Discuss whether the proposed controller ????????(????) by you in part (a) is still suitable. If yes,

explain and justify your answer with sufficient evidences; otherwise, explain and then

suggest modification to the proposed controller ????????(????) for improvement.

~~ The End. Enjoy! ~~

1

???????? + ???? ????????(????)

+

?

???????????????? ????(????)

Motor

Controller speed dynamics

????????(????)

????(????) +

+


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp