svozkan avatar

Simple Control System Design with XCOS - Scilab Tutorial

svozkan

Published: 11 Jun 2018 › Updated: 11 Jun 2018Simple Control System Design with XCOS - Scilab Tutorial

Simple Control System Design with XCOS - Scilab Tutorial

What Will I Learn ? 

  • You will learn how to simulate dynamic systems in Xcos
  • You will learn how to design a simple feedback system with transfer function
  • You will learn Proportional, Integral, Derivative Gains

Requirements 

  • Basic programming knowledge
  • Basic control system design knowledge
  • Scilab 6.0.1 or higher

Difficulty

  • Basic

Tutorial Contents

Xcos is a very powerful tool which provides us building dynamic system with block diagram representation. Instead of just typing codes and check for spelling or other errors this tool uses blocks that are alreadly build and coded

alt

Figure1: Block Representation in Xcos

By the help of Xcos what are we going to design is a feedback control system. Therefore, we should first know what is a feedback control system. It can be showed as in Figure [2];

alt

Figure2: Feedback System

As can be seen from the Figure [2], a feedback system can be defined as; we have a dynamic system which responses to a given input and we are controlling it by the output. This kind of systems are called also Closed-Loop Systems. If we do not feed the output back into input these systems are called Open-Loop Systems. We are now feeding the output back and "Controlling" the system in a way but the important thing is that we need to control the system in a way that the system obeys certain requirements. These requirements can be achieved with different controlling techniques but in this tutorial i will talk about "Classical Control Techniques" Proportional, Derivative, Integral which is called PID controller. A PID controller is;

alt

Figure3: PID Controller Scheme

Setting Up The System and Simulation

We will assume DC-Motor which is represented with a simple transfer function and its input is voltage and output is RPM and we will control the output with a PID controller. The transfer function is;

alt

Figure4: DC-Motor Transfer Function Representation

From the Xcos Palette Browser the transfer function can be found from Continuous time systems/ CLR. Other blocks we need for simulation can be found from Palette Browser and typing search; STEPFUNCTION, SUMf, CMSCOPE, CLOCK_c, PID, GAIN, respectively. They are;

alt Figure5: Blocks Needed

Open-Loop vs Closed-Loop

Now, check both systems;

alt

Figure6: Open-Loop

alt

Figure7: Closed-Loop

First set PID gains as;
alt

Figure8: PID Gains

Responses of both Closed and Open Loop systems to a given step input are;

alt Figure9: Responses with PID = [1 1 1]
Now by adjusting the PID gains we will try to converge to given input. After several trials, I have found the PID gains as;
alt

Figure10: New PID Gains

With the PID gains given in Figure [10] our Closed Loop response changes as;

alt Figure11: Response with PID = [28 19 0.5]
As we can see from the Figure [11], our control system works really good with small error we have converged to the given input. We can see the importance of the control system in this example. I hope this tutorial will be helpful for you guys. Thank you :)

Proof of Work

  • [Xcos File] (https://drive.google.com/open?id=1o4kTgG7dlMon_icaeK1Nv4d1DphYjuEM)

Leave Simple Control System Design with XCOS - Scilab Tutorial to:

Written by

It's All About Control

Read more #utopian-io posts


Best Posts From svozkan

We have not curated any of svozkan's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From svozkan