Sie sind auf Seite 1von 6

Simulink: Start the Simulink by typing Simulink in MATLAB Now press Ctrl+N to create the model file in which

Simulink blocks can be placed Basic Elements: There are two major classes of items in Simulink: 1. Blocks and lines. Blocks are used to generate, modify, combine, output and display signals. Lines are used to transfer signals from one block to another. Classes of Blocks: There are several general classes of blocks: Sources: Used to generate various signals Sinks: Used to output or display signals Discrete: Linear, discrete-time system elements(transfer functions, state-space models etc.) Linear: Linear, continuous-time system elements and connections (summing junctions, gains etc.) Non-Linear: Nonlinear operations (arbitrary functions, saturations, delay etc.) Connections: Multiplex, De-multiplex, system macros etc.

The block shown below has an unused input terminal on the left an an unused output terminal on right:

Lines transmit signals in the direction indicated by the arrow. Lines must always transmit signals from the output terminal of one block to the input terminal of another block. Lines can never inject a signal into another line; lines must be combined through the use of a block such as a summing junction. Signal: Signal can be either a scalar signal or a vector signal. For single-input, single-Output systems, scalar signals are generally used. For Multi-Input, Multi-Output systems, vector signals are often used , consisting of two or more scalar signals. The lines used to transmit scalar & vector are identical. Type of signal carried by line is determined by the blocks on either side

Second Order System: Unit step Response: The transfer function for a second order control system with complex poles is given by the following expression:

T.F. =

2 2 +2+2

Draw the unit step response of following transfer function, where n =5 & =0.5 also calculate Tp , T s.

Source Code:
wn=5; z=0.5; num=[wn^2]; den=[1 2*z*wn wn^2]; a=tf(num,den);

unit step response for zeta=0.5

step(a,'c') % here 'c' is for colour name i.e cyan it's the property of step command % text(0,2.7,'unit step response for zeta=0.5') %Here 0 is x & 2.7 is for y-axis position where text is placed% axis([-0.2 3.5 0 1.5]) % here -0.2 is starting limit of x axis and 3.5 is last limit similarly for y-axis(0-to-1.5)% tp=pi/(wn*sqrt(1-(z^2))) ts=4/(z*wn)
1.4 Step Response

1.2

Amplitude

0.8

0.6

0.4

0.2

0.5

1.5 Time (seconds)

2.5

3.5

System stability and routh Hurwitz criteria: The Routh Hurwitz criterion is a method to determine whether a linear system is stable or not by examining the location of the roots of the characteristic equation of the system. Infact, the method determines only if there are roots that lie outside the left half plane; it does not actually compute the roots. The Routh Hurwitz Test requires that there be no sign changes in the first column of the Routh array, for the system to be stable. The number of changes equal to the number of poles on RHP( Right half Plane) poles. The Routh Hurwitz test is performed on the denominator of the transfer function. Routh Hurwitz tests: There are three tests of the routh Hurwitz Criteria. For convenience, we will use N as the order of the polynomial (the value of the highest exponent of s in D(s) ) D(s) = a0 + a1s +a2s2 + ..+aNsN Rule 1: All the coefficients ai must be present (non-zero) Rule 2: All the coefficients ai must be positive Rule 3: If Rule 1 and Rule 2 are both satisfied, then from Routh array from the coefficients ai. There is one pole in the right hand s-plane for every sign change of the members in the first column of the routh array (any sign changes, therefore, mean the system is unstable). Range of K for stability. Steady state error: Steady state error is defined as the difference between input and output of the system in the limit as time goes to infinity (1.2. when the response has reached the steady state). The steady state error will depend upon the type of input (step, ramp etc.) as well as the system type ( 0,1 or 2) Note: Steady state error analysis is not useful for stable system. Three system types are: Type 0 Systems Steady state error formula Static Error constant Error Type 1 Systems Steady State error Formula Static Error Constant Error Type 2 Systems Steady State error Formula Static Error Constant Error Step Input 1/(1+Kp) Kp=Constant 1/(1+Kp) Step Input 1/(1+Kp) Kp= 0 Step Input 1/(1+Kp) Kp= 0 Ramp input 1/Kv Kv=0 Ramp Input 1/Kv Kv=constant 1/Kv Ramp Input 1/Kv Kv= 0 Parabolic input 1/Ka Ka=0 Parabolic Input 1/Ka Ka=0 Parabolic Input 1/Ka Ka=constant 1/Ka

Root Locus Plot: The root locus gives the closed loop function trajectories as a function of the feedback gain k(assuming negative feedback). Root Loci are used to study the effects of varying feedback gains on closed loop pole location. In turn, these locations provide indirect information on the time and frequency responces.

rlocus(sys) calculates and plots the root locus of the linear control systems.
[r,k]=rlocus(sys)

rlocfind returns the feedback gain associated with a particular set of poles on the root loci.
It works both on continuous and discreete time SISO systems [k,poles]= rlocfind(sys) % rlocfind(sys,p)%

Pole computes the poles p of a control.


p=pole(sys)

pzmap(sys) plots the pole zero map of the continuous or discrete time LTI model sys.
pzmap(sys) [p,z]=pzmap(sys)

damp calculates the damping factor and natural frequencies of the poles of an LTI model sys
[wn,z]=damp(sys) [wn,z,p]=damp(sys)

zero computes the zeros of a control system


z=zero(sys) [z,gain]=zero(sys) % returns the gain in the zero pole gain sense%

The angle criterion: The angle criterion is used to determine the departure angle for the parts of the root locus near the open loop poles and the arrival angles for the parts of the root locus near the open loop zeros. When used with magnitude criterion the angle criterion can also be used to determine whether or not a point in the s-plane is on the root locus.

Bode plot analysis: A bode plot is a diagram in which the phase shifts or the gain of an amplifier, a servomechanism or other device is plotted against frequency to show frequency response, logarithmic scales are coustomary used for gain and frequency.

Used for: Design to gain and phase margin specification Adjust bandwidth Add notch filter for disturbance rejection

In MATLAB bode computes the magnitude and phase of the frequency response of LTI models.

bode(sys) plots the bode response of an arbitrary LTI model sys. This model can be continuous or
discrete and SISO or MIMO. In MIMO case, bode produces an array of bode plots, each bode plot showing the bode response of one particular I/O channel.

bode(sys,w) explicitly defines the frequency range or frequency points for the plot. To focus on a
particular frequency interval [wmin,wmax], set w=(wmin,wmax). To use particular frequency points set w to the vector of desired frequencies. bode(sys1,sys2,sysN) plots the bode response of LTI models on a single figure. All systems must have the same number of Inputs and Outputs. Gain Margins & Phase Margin: The gain margin is the amount of gain increase required to make the loop gain unity at the frequency where the phase angle is -180 . 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 crossover frequency. It is generally found that the gain margins of three or more combined with phase margin between 30 & 60 degrees result in reasonable trade-offs between bandwidth and stability. It can be calculated as: [Gm,Pm,Wg,Wp]=margin(sys)

margin computes the gain margin Gm , the phase margin Pm, and the corresponding crossover
frequencies , Wg and Wp given the SISO open loop model sys. [Gm,Pm,Wg,Wp]=margin(mag,phase.w)

margin calculates the minimum gain margin Gm , Phase Margin Pm and associated crossover frequencies
of SISO open-loop models, Wg and Wp . The gain and phase margin indicates the relative stability of the control system when the loop is closed. Note: You can also display these margins graphically: margin(hd)

Nyquist Analysis: A Nyquist plot is a graph used in signal processing in which the magnitude and phase of a frequency plot are plotted on orthogonal axes. This plot combines the two types of Bode plots (magnitude & phase) on a single graph, with the frequency as a parameter along the curve. It is useful for accessing the stability of a system with feedback. It shows the amplification/attenuation and phase shift of the signal in the complex plane. It's command is simple: nyquist(tf)

Das könnte Ihnen auch gefallen