Scilab Tips Blog Home All Blogs RSS
 Search all posts for:

View all (78) posts »

Analyzing linear control systems in Xcos

Posted By Ievgen Ivanov, Thursday, September 06, 2012
Updated: Thursday, September 06, 2012

Although Scilab has many functions for plotting various characteristics of linear control systems, these functions cannot be easily applied to Xcos diagrams.

The Equalis Control and Power Systems Toolbox [1] offers a new palette of Xcos blocks which allows the user to view plots of important characteristics of a control system defined in Xcos diagram. These characteristics include Step Response, Bode and Nyquist plots (optionally which gain and phase margins), Nichols plot, Pole-Zero plot, and Singular values plot.

In this example we sill use Control and Power Systems Toolbox to analyze a linear model of a permanent magnet DC motor. This motor can be modeled by an electrical circuit in the armature as shown below.

Assuming a constant load, a DC motor can be considered as a SISO system, where the applied voltage Va is the input and the motor speed is the output.

Using standard Xcos blocks (summation, gain, integration), let us create an diagram of this SISO system as shown below.

The input Va can be connected to a constant block (this means a constant voltage). The output w is the speed in rad/s.

Let us use Simulation->Set context in Xcos to set the following values of constants which appear in the diagram:

J=3.2284E-6; b=3.5077E-6; K=0.0274; R=4; L=2.75E-6;

Now let us analyze the obtained SISO system using Control and Power Systems Toolbox. For example, let us build a Bode plot. To do this, we open the Linear Analysis palette and put two Operating_Point blocks and one Bode block on the diagram.

The Operating_Point blocks denote inputs and outputs of a linear system or subsystem in a diagram. They have no effect on simulation. The only parameter of each Operating_Point block is its name (the names should be unique).

Let us set the names of two Operating_Point blocks as "begin" and "end" and connect them as shown below:

The role of Bode block is to build a bode plot of a SISO system located between two operating points ("begin" and "end"). Let us set its parameters as follows:

If the diagram contains at least one Bode block and the user clicks Simulation->Start, Xcos does not start simulation, but instead displays a Bode plot. Note that to run a normal simulation the user can (temporarily) remove Bode block (and all other Linear Analysis blocks except Operating_Point).

Now let us start simulation. Xcos will show the Bode plot of the transfer function of our system.

Analogously, we can build a Nyquist plot and all other plots supported by Control and Power Systems Toolbox.

Attached Thumbnails:

Tags:  Xcos