You are on page 1of 13

2016

1st order in XCOS - Scilab


Tenet Technetronics is official Training Partners for

SCILAB.

M.Mohamed Ibrahim
Tenet Technetronics
08-NOV-16

Tenet Technetronics 1
Application Notes

Contents
Introduction .2
Open XCOS . 2
Palette browser

Example for 1st order transfer function . 3


Simple demos

11

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 2
Application Notes

Introduction
Scilab is an open source, cross-platform numerical computational package and a highlevel, numerically oriented programming language. Xcos is Scilab tool dedicated to the
modeling and simulation of hybrid dynamic systems including both continuous and
discrete models. Models can be designed, loaded, saved, compiled and simulated.

Open XCOS
From Scilab console window, typing -->XCOS
Otherwise, click XCOS icon

Application menu ->XCOS


XCOS opens with two window
1. Palette browser
2. Untitled XCOS window

Figure 1: Palette browser

Figure 2: XCOS window


Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 3
Application Notes

Palette browser
Palette browser contains different types of blocks. To design diagram, select the
required blocks in palette browser and place the blocks into XCOS window by using
drag & drop option. Blocks are then connected each other using their different ports
(input, output, event) in order to create the simulated model.

Example for 1st order transfer function using XCOS


We are required to use following blocks in a first order transfer function analysis.
Table -1: Blocks required for First Order system

Step 1: Select the above blocks in palette browser and then place the blocks in
XCOS window by drag & drop.

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 4
Application Notes

Figure 3: First Order System Block Selection

Step 2: Arrange the blocks in XCOS window and then connected to required ports.

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 5
Application Notes

Figure 4: First Order System Block Connection

Step 3: After completing the connections, click


- simulation run icon. At the
bottom of the window, the simulation in progress message is displayed till the
simulation process is in progress and then the result will be displayed.

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 6
Application Notes

Figure 5: First Order System Block - Simulation

Figure 6: First Order System Block output Graph


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 7
Application Notes
Step 4: If you want to modify any of the parameters of Continuous time system block,
double click on the CLR block and change the parameters.

Figure 7: First Order System Block Properties Editing

Step 5:Set context menu containing Scilab script allows easy to use of functions and
variables.
Simulation-> set context
For example: enter the Y=1 & Tau=1 in set context window

Figure 8: First Order System Block Properties setting Assignment contrd


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 8
Application Notes

Step 6: We can use this variables in CLR block.


Double click on the CLR block and then change the parameters.

Figure 9: First Order System Block Properties setting Assignment contrd

Step 7: The new transfer function is displayed on the block

Figure 10: First Order System after Block Properties setting

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 9
Application Notes
Step 8: If we want to modify final integration time and cscope parameters
Goto, Simulation ->setup
Enter final integration value as 5 and click OK

Figure 11: Output Graph Simulation Time Setup

Step 9:Doule click cscope block and choose the values


For example : Ymin=0, Ymax =1.2 and refresh period=5

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 10
Application Notes

Figure 12: Output Graph y Axis Setup


Click OK
Step 10: Restart the simulation and result will be displayed.

Figure 13:Output Graph For modified block Parameters


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 11
Application Notes
Step 11: Replace the step function by sine wave generator and then restart the
simulation .The output will be displayed.

Figure 14: First Order System with Sinusoidal input

Simple Demos:
1. Step function in Scilab

Figure15: Step Function Output A simple view


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 12
Application Notes

2.

Sine wave generator in Scilab

Figure 16: Sine Wave Generator Output A simple view


3.

Pulse generator

Figure 17: Pulse Generator Output - A Simple view


For more information please visit: www.tenettech.com
For technical query please send an e-mail: info@tenettech.com
Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

You might also like