You are on page 1of 11

Procedure:

1. Open MATLAB window. Click on Simulink from the toolbar.

2. A new window will appear. Select ‘Blank Model’ from this window.

3. The main Simulink window will appear where we’ll assemble our circuit/project. From the
toolbar select ‘Simulink Library Browser’. A small window including certain parameter blocks
will appear as shown below:-
Now select ‘Commonly Used Blocks’ from left side of window and drag ‘Saturation’ block two
times, ‘Gain’ block three times and ‘Sum’ block two times into the untitled Simulink space
area.
4. Also from ‘Continuous’ in Simulink Library drag ‘Transfer function’ block two times onto
‘untitled’ window.

5. Here’s a look of randomly placed blocks


6. In First ‘Saturation’ Block set upper limit=10 and lower limit= -10 by double clicking on
it, as shown in figure below.

7. In Second ‘Saturation‘ Block set Upper limit= +4 and Lower limit= -4 by double clicking
on it, as shown in figure below.
8. Change the signs of both ‘Summer’ Block with positive and negative as shown in figure
below. Click Apply then Ok.
9. In First ‘Gain’ block, double click and change the gain to 2.
10. In second ‘Gain’ block, double click and change the gain to 0.1.
11. Invert the third ‘Gain’ block, then double click on it and change the gain to 0.1.
12. In first ‘transfer function’ block, change denominator as [l r], as shown in figure below.

13. In second ‘transfer function’ block, change denominator as [j b].


14. After arranging components according to circuit diagram we get :-
15. Select whole diagram leaving input output arrows and select ‘Create Subsystem’ by right-
clicking the selection, as shown in figure below:

16. Next the whole system will shrink into a subsystem. Add input and output arrows as:-

17. Add step inputs and scope as follows:-


Step response can be given from:
Simulink Library → Sources → Step Response.

18. Now give scope at output of the subsystem. Scope can be given from:
Simulink Library → Commonly Used Blocks → Scope.

19. Click Simulation from toolbar → Configuration parameters. Now set:


Start: 0.00 and Stop:15.0
Type: Fixed Step
Fixed step size (fundamental Sample time): 0.001
Click apply and ok.

20. Now click on File → Model properties → Call backs → initfcn → Then on write hand side write
the following values:
l=0.008
r=2
j=0.0004
b= 0.001
Click apply and ok.
21. To run the simulation click ‘play’ button or click Simulation → Start.

22. Click on subsystem and then change second block of sum by ++ then click apply and ok.
23. To run the simulation click ‘play’ button or click Simulation → Start.

Note:

Since the Autoscale option wasn’t available so the waveforms are kept as such.

You might also like