Anda di halaman 1dari 7

Department of Electrical Engineering

Control System

Faculty Member: Dated:

Lab Engineer: Sanan Ahmad Semester:

Lab Engineer: Zafarullah Session:

Group:

LAB-2 Modeling of State-Space

Name Report Viva


Reg. No. Total / 15
Marks / 10 Marks / 5

10 | P a g e
2.1 Objective
To obtain the Transfer Function of system (differential) equation, Its State-Space Model, Its Block diagram
(Simulink model).

2.2 Equipment/Apparatus
2. Software: Matlab and Simulink
2.3 Conduct of Lab
4. Students are required to perform this experiment using the equipment provided.
5. Students are required to work in groups specified by lab engineers.
6. Students are advised to seek help from the course instructor, lab engineers, assigned teaching
assistants (TA) and lab attendants.

2.4 Theory and Procedure


Consider the mechanical system shown in Figure 2-1. We assume that the system is linear. The external
force u(t) is the input to the system, and the displacement y(t) of the mass is the output. The displacement
y(t) is measured from the equilibrium position in the absence of the external force. This system is a single-
input, single-output system. From the diagram, the system equation is

+ + =
Let suppose m=1, b=0.9, k=1; Then

+ 0.9 + =
Its Transfer Function is given as

( 2 + 0.9 + 1) () = 1 ()
() 1
= 2
() ( + 0.9 + 1)

Figure 2-1 Mechanical System

11 | P a g e
This system is of second order. This means that the system involves two integrators. Let us define state
variables x1(t) and x2(t) as

2 () = ()
1 () = ()
Then we obtain

2 = = 1
1 = 0.9 1 2 +
The output of the Equation is

= 2
State Space is given as

= +
= +
1 0.9 1 1 1
[ ]=[ ][ ] + [ ]
2 1 0 2 0
1
= [0 1] [ ] + [0]
2

2.4.1 Matlab Code


The Matlab code is given as below. Compare the theoretical results with Matlab results

num=[1] %numerator
den=[1 0.9 1] %denominator
transf=tf(num,den) %transfer Function
[A,B,C,D]=tf2ss(num,den) % transfer function to State Space
step(transf) % Step response of the tf

2.4.2 Block Diagram of System


The Block Diagram of the Given Mathematical Function is given in the Figure 2-2

Figure 2-2 Block Diagram

12 | P a g e
2.4.3 Simulink Model
Following are the steps to make a Simulink model

Figure 2-3 Step 1


1

Figure 2-4 Step 2

Figure 2-5 model Window

1. Click on the Simulink Library as shown in Figure 2-3

13 | P a g e
2. Click on the button as shown in Figure 2-4 to create model or use File>New>Model or use
short key Ctrl + N
3. A new window will appear as show in Figure 2-5
4. Use the Simulink Library to Drag and Drop the block from it to the model window
5. Derivative and integrator will be available in Simulink>Continuous as in Figure 2-6 or you
can search it in search bar

Figure 2-6 Continuous Blocks

6. Remaining blocks (Sum, Gain, Constant) can be seen in Commonly Used Blocks
7. Step and Scope are in Source and Sink respectively
8. Interlink the blocks (Click, Drag the line while clicking and move to second block leave the
click) as in Figure 2-7

Figure 2-7 Connections


9. After Completing the Model, it will look as shown in Figure 2-8
10. Save the Model and click the Run button or use Simulation>Run or CTRL + T
11. Double click the Scope to see the graph. Graph will be as shown in Figure 2-9
12. Compare the Graph from Simulink with the Matlab step response Graph

14 | P a g e
Figure 2-8 Model in Simulink

Figure 2-9 Graph from Scope

Note: Change the Graph Colors. Go to parameters >Styles and change the properties as in Figure 2-10

White White Black

Figure 2-10 Scope Parameters


Black

15 | P a g e
2.5 Exercise
After doing the procedure in section 2.4 do the following exercise

1. Do same as in section 2.4 with the following third order equation


+ 14 + 56 + 160 =

2.6 Answer the Following


1. What the tf2ss command do?
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
2. What the step command do?
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________

2.7 Student Learning Outcomes


What you have learnt in the lab? describe.

16 | P a g e

Anda mungkin juga menyukai