Cs - Assign Matlab Original 2013

21
7/28/2019 Cs - Assign Matlab Original 2013 http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 1/21 MATLAB ASSIGNMENT  NURUL HAFIZAH SAAD 51211211425 TUN AYUNI DIYANA BT ARIFFIN 51210112054 1. OBJECTIVE 2. METHODOLOGY 

Transcript of Cs - Assign Matlab Original 2013

Page 1: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 1/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120541 

1. OBJECTIVE

2. METHODOLOGY 

Page 2: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 2/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120542 

3. DESIGN PROBLEM

A unity feedback control for a vehicle manoeuvring system is given in the following

diagram:

where K = 100 and G(s) =)8)(4(

12

s s s

 

The initial design of the system is not very good with regards to the step input. As an

engineer, you have been given the task to improve certain performance criteria of the

system. To complete your assignment, you are to analyse the system design and give some

recommendations for improvement. You are required to submit a complete report detailing

your work.

Page 3: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 3/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120543 

3.1 TASK A (Problem Identification)

i. Calculation

T(s) =

()() 

=

() 

 

ii. Command

step calculates the step response of a dynamic system. For the state space case, zero

initial state is assumed. When it is invoked with no output arguments, this function plots

the step response on the screen. step(sys) plots the step response of an

arbitrary dynamic system model sys. This model can be continuous or discrete, and SISO

Page 4: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 4/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120544 

or MIMO. The step response of multi-input systems is the collection of step responses for

each input channel. The duration of simulation is determined automatically, based on the

system poles and zeros.

iii. Result 

a. time (step) response

The step function is one of most useful functions in MATLAB for control design. Given a

system representation, the response to a step input can be immediately plotted, without 

need to actually solve for the time response analytically. A step input can be described as

a change in the input from zero to a finite value at time t = 0. By default, thestep command performs a unit step (i.e. the input goes from zero to one at time t = 0).

The basic syntax for calling the step function is the following, where sys is a defined LTI

object.

Peak Response

Rise Time

Page 5: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 5/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120545 

b. frequency response (bode plot)

A Bode plot is a graph of the transfer function of a linear, time-invariant system

versus frequency, plotted with a log-frequency axis, to show the system's frequency

response. It is usually a combination of a Bode magnitude plot, expressing the

magnitude of the frequency response gain, and a Bode phase plot, expressing the

frequency response phase shift . 

A Bode phase plot is a graph of phase versus frequency, also plotted on a log-

frequency axis, usually used in conjunction with the magnitude plot, to evaluate how

much a signal will be phase-shifted. For example a signal described by: Asin(ωt ) may

be attenuated but also phase-shifted. If the system attenuates it by a factor x and

phase shifts it by −Φ the signal out of the system will be ( A/ x ) sin(ωt  − Φ). The phase

shift Φ is generally a function of frequency. Phase can also be added directly from the

graphical values, a fact that is mathematically clear when phase is seen as the

imaginary part of the complex logarithm of a complex gain.

Phase Margin

Gain Margin

Page 6: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 6/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120546 

c. Root Locus

In addition to determining the stability of the system, the root locus can be used to

design the damping ratio and natural frequency of a feedback system. Lines of constant damping ratio can be drawn radially from the origin and lines of constant 

natural frequency can be drawn as arcs whose center points coincide with the origin.

By selecting a point along the root locus that coincides with a desired damping ratio

and natural frequency a gain, K, can be calculated and implemented in the controller.

More elaborate techniques of controller design using the root locus are available in

most control textbooks: for instance, lag, lead, PI, PD and PID controllers can be

designed approximately with this technique.

The definition of the damping ratio and natural frequency presumes that the overall

feedback system is well approximated by a second order system; i.e. the system has a

dominant pair of poles. This is often not the case, so it is good practice to simulate the

final design to check if the project goals are satisfied.

RHSLHS

Page 7: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 7/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120547 

3.2 TASK B (Design Solution)

Improve the system with new design to make the system are stable.

i. Command 

Page 8: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 8/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120548 

a. Step response

b. Bode Plot 

Settling Time

Gain Margin

Phase Margin

Peak response

Rise Time

Steady State

Page 9: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 9/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 512101120549 

c. Root locus 

LHS

Page 10: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 10/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205410 

3.3 TASK C (System Analysis)

From the task A, the system is not stable. The reason why system is not stable is because of 

a given step input. However, the system can be improved to achieve stability.

Step response above not stable. After 30 seconds, step response overshoot. The system can

be improved by changing the value of K to decrease the percentage of overshoot. Bychanging the value of gain, the percentage of new system can less a bit from initial system.

Gain value must less than given value. Additional, if gain value is changed it better to

change the value of natural frequency also. By changing it, overshoot can be decrease.

Damping factor also give an effect of the step response. If the damping factor more than 1,

the system is overdamped, damping factor less than 1 the system are underdamped while

for equal to 1 is under the critically damped condition.

For frequency response,

Page 11: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 11/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205411 

For the system, frequency response is not stable because value of gain margin was

0rad/sec and phase margin was 1.68rad/sec. What make it happen? It happened because

of pole and zero placement and value. For frequency response, it just consider at the

system without looking at the feedback. Frequency response are depends on step input 

value (pole and zero). However, the order to change the value of step order gain will

affected.

Page 12: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 12/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205412 

For root locus,

For the very simple system of this problem, there were many ways to find how the roots

varied as we varied the gain of the system. For a more complicated system this is not easy.

The root locus plot gives us a graphical way to observe how the roots move as the gain, K, is

varied.

Page 13: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 13/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205413 

Comparison between Task A and Task B

STEP RESPONSE COMPARISON

TASK A

The system is not stable

because it not achieved

constants. That why the

system is not stable. It has

overshoot at after it consta

and the settling time are bi

From this system, can

recognize the condition of

system whether it 

underdamped or so on.

TASK B

The system is near to achie

stability because after it 

overshoots, the graph isready to constant. The

settling time for the system

are quickly comparing the

initial one. The graph is

under the underdamped

condition with the value of

damping factor is 0<ζ<1. B

change the value of gain an

zeros, the stability are

achieved.

Page 14: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 14/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205414 

FREQUENCY RESPONSE COMPARISON

TASK A

The system is not stablebased on the value of gain

margin and phase margin.

TASK B 

Gain margin and phase

margin are in the positive

value. The stability of syste

can determine by look at 

value positive at gain and

phase margin. Without 

change the poles value, the

stability can achieved

because it just depends on

zeroes and gain value.

Page 15: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 15/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205415 

ROOT LOCUS COMPARISON

TASK A

Number of branches = 4

Stability = Unstable

TASK B

Number of branches = 3

Stability = stable

Page 16: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 16/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205416 

Description Task A Task B

Transfer Function

 

 

Root Locus Dragging the locus to the

right hand side (RHS) of the

graph

The locus to the left hand

side (LHS) of the graph

Bode diagram  Gain margin (Gm) for

bode diagram is negative

infinity in magnitude (db)

 Phase margin (Pm), -34.6

deg at (1.68 rad/sec)

  Gain margin (Gm) for

bode diagram is 46.6 dB

(at 3.08 rad/sec).

  Phase margin (Pm), 65.7

deg at (0.323 rad/sec)

Step Response  Peak response, the graph

is undamped and also

inversely

 Settling Time, unstable

and the value was infinity

  Peak amplitude was at 

1.18 and %OS at 17.8

  The rise time is 3.93s

  The settling time was

stable which is 28.4s

  The final value which isthe steady state are 1.

1.  SETTLING TIME

The settling time of an amplifier or other output device is the time elapsed from the

application of an ideal instantaneous step input to the time at which the amplifier output 

has entered and remained within a specified error band, usually symmetrical about the

final value. Settling time includes a very brief propagation delay, plus the time required

for the output to slew to the vicinity of the final value, recover from the overload

condition associated with slew, and finally settle to within the specified error. The

settling time that we’ve got in Task A was unstable and the value was infinity. It’s also

had low performance in the system. But in Task B, the settling time was stable and the

value was 28.4s.

2.  RISE TIME

The effect of additional pole in the left-half s-pane (LHP) tends to slow the system down,

this make the rise time of the system, for example, will become larger. When pole is far

to the left of the imaginary axis, it is effect tend to be small. The effect becomes more

pronounced as the pole moves toward the imaginary axis. That’s why in this assignment 

Page 17: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 17/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205417 

the additional on the poles are not included, but by doing additional on the zeros it give

a huge different for stabilizing. The effect on extra zeros in the LHP has the opposite

effect, as it tend to speed the system up. According the result in Task B, the value for rise

time was 3.93s compared to Task A that was infinity.

3.  STEADY STATE

Steady state error is defined as the difference between the input and the output for a

prescribed test input as time (t) goes to infinity. A system in a steady state has numerous

properties that are unchanging in time.

4. GAIN MARGIN

The gain margin is the amount of gain increase or decrease required to make the loop

gain unity at the frequency where the phase angle is –180° (modulo 360°). In other

words, the gain margin is 1/g if g is the gain at the –180° phase frequency. Similarly, the

phase margin is the difference between the phase of the response and –180° when the

loop gain is 1.0. The frequency at which the magnitude is 1.0 is called the unity-gain

 frequency or gain crossover frequency . It is generally found that gain margins of three or

more combined with phase margins between 30 and 60 degrees result in reasonable

trade-offs between bandwidth and stability. Gain margin is the amount you can increase

the gain of a system before achieve the 0 dB gain. In conclusion the gain is a measured of 

how far from instability a system is.

5.  PHASE MARGIN

The phase margin Pm is in degrees. The gain margin Gm is an absolute magnitude. Phase

margin is the amount of phase the system can lag before achieve the 180° phase lag. In

conclusion the gain is a measured of how far from instability a system is.

Page 18: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 18/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205418 

6.  ROOT LOCUS

Based on the experiment that I had done, the root locus was not stable on the s-plane

was because the value of gain was high for system to generate. So, the stability on the

damping factor on step respond can be stabilizing by reducing the gain from 100 to 1.

Next, by adjusting the value and add the zeros from [1] to [ 1 0 10 1 ], the root locus

diagram show by dragging the locus to the negative side of the graph can be stabilize but 

if the locus is more to the positive side, it show that it was not stable.

On the other hand, the effect of a zero far away to the left of the imaginary axis tends to

be small. It becomes more pronounced as the zero moves closer to the imaginary axis.

For the additional zero in the right-half s-plane (RHP) has a delaying effect much moresevere than the addition of a LHP pole. The RHP zero causes the response to start 

toward the wrong direction. It will move down first and become negative. System with

RHP zeros are called non minimum Phase system (for reasons that will become clearer

after the discussion of the frequency design methods) and are typically difficult to

control. System with only LHP poles (Stable) and LHP zeros are called minimum phase

system.

The changing gain that the system poles and zeros actually move around in the S-

plane. This fact can make life particularly difficult, when to solve higher-order

equations repeatedly, for each new gain value. The solution to this problem is a

technique known as Root-Locus graphs. Root-Locus allows graph the locations of the

poles and zeros for every value of gain, by following several simple rules.

Page 19: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 19/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205419 

Trial and Error Solution

Here is some example that we had to examine the behavior of the system varies as K

changes, so let's try several values of K. Let's arbitrarily try K=1, 10 and 100 so that we

have a wide range of K values.

K Xfer Function Step ResponseK=1

K=10

Page 20: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 20/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

TUN AYUNI DIYANA BT ARIFFIN 5121011205420 

K=100

The response with K=1 was too slow, the response with K=100 was too oscillatory, and the

response with K=10 is almost just right, though we may want to adjust K to get a little bit 

less overshoot. Clearly this method is rather "hit-or-miss" and it may take us a long time to

find a suitable value for K.

Page 21: Cs - Assign Matlab Original 2013

7/28/2019 Cs - Assign Matlab Original 2013

http://slidepdf.com/reader/full/cs-assign-matlab-original-2013 21/21

MATLAB ASSIGNMENT

 NURUL HAFIZAH SAAD 51211211425

4. CONCLUSION

From this assignment, we can conclude that by determining the Step Response, Bode Plot 

and Root Locus will helps us analyzing a control system performance. Through this

graphical method, direct portrayal of the system can be obtained as a whole especially

referring to transient response.

Thus, from this assignment we’re need to investigate the poles and zeros’ position and in

using software (Matlab) is much better from manually analyzing the system. Through the

information of the graphical method we’re can

Apart from that, the stability of a system can also be known by referring to the route of the

root locus. Techniques of drawing for Step Response, Bode Plot and Root Locus have been

discussed in systematically which involve number of rules that need to be understood.Relevant examples are included to ensure that readers can understand and use them to

solve problems for other system as well.