Scilab/C4/Simulating-a-PID-controller-using-XCOS/English-timed
From Script | Spoken-Tutorial
Revision as of 16:09, 24 May 2018 by PoojaMoolya (Talk | contribs)
Time | Narration |
00:01 | Welcome to the spoken tutorial on Simulating a PID controller using Xcos. |
00:07 | In this tutorial we will learn how to implement a PID controller in Xcos. |
00:13 | Ensure that Scilab is installed on your computer. |
00:17 | I am recording this tutorial on Ubuntu 16.04 64-bit Operating System and using Scilab 6.0.0 |
00:27 | As a pre-requisite, watch the tutorial Xcos Introduction. |
00:32 | This tutorial will make you comfortable with the Xcos environment. |
00:37 | Also, we will use the firstorder.xcos file created in that tutorial. |
00:43 | Hence, it is important that you practice the tutorial before continuing so that you have the file with you. |
00:50 | Some basic knowledge of PID controller is necessary. |
00:54 | Assuming that you have satisfied the pre-requisites, let us begin with the tutorial. |
00:59 | First of all, we will launch Scilab. |
01:03 | Then go to Applications and select Xcos. |
01:08 | Or in your Scilab console window, type Xcos and press Enter. |
01:15 | By doing this, two windows will open.
|
01:23 | On the Untitled-Xcos window, click on File and then click on Open. |
01:30 | Browse to the directory where the file firstorder.xcos is saved. |
01:36 | Choose that file and click on Ok. |
01:40 | Now, Double-click on the transfer function block. |
01:44 | Check that you are using the same transfer function as I am using. |
01:49 | For me, the numerator is 1 and denominator is 2 asteric s plus 1
Which is 2 multiplied by s plus one. |
02:01 | Click on Ok. |
02:03 | Double-click on the Step block. |
02:06 | Check that you are using the same step input parameters as I am using. |
02:11 | For me the Step time is 1, the Initial value is 0 and the Final value is 2.
Click on OK |
02:20 | Click on Simulation on the menu bar and choose Start to simulate the file. |
02:27 | Expect a similar plot which ensures that the file has no mistakes. |
02:32 | Switch to the Palette Browser. |
02:35 | Click on Continuous time systems category. |
02:39 | Drag and drop the PID block, which is here, inside the Xcos window |
02:46 | Click on the Signal Routing category. |
02:49 | Drag and drop the Mux block, which is here, inside the Xcos window. |
02:55 | Click on Mathematical Operations category. |
03:00 | Drag and drop the Summation block, which is here, inside the Xcos window. |
03:07 | Note that this block, by default, subtracts the second input from the first input. |
03:14 | We will use this default configuration of the summation block. |
03:18 | Click on the line joining the step input block and transfer function block. |
03:24 | Then press the Delete button to delete it. |
03:27 | Drag the step input block away from the transfer function block. |
03:31 | Click on the line joining the transfer function block and the cscope block. |
03:36 | Then press the Delete button to delete it. |
03:40 | Drag the cscope and clock input block away from the transfer function block |
03:46 | Place the PID block before the transfer function block. |
03:50 | Place the summation block before the PID block. |
03:54 | Place the Mux block between the transfer function block and cscope block. |
03:59 | Adjust the blocks, if required, so that they all come in a line. |
04:04 | Connect the step input block to the first input port of the summation block. |
04:10 | Note that this is the positive input port of the summation block. |
04:15 | Connect the output port of summation block to the input port of PID block. |
04:21 | Connect the output port of PID block to the input port of transfer function block. |
04:27 | Connect the output port of transfer function block to the lower input port of Mux block. |
04:33 | Connect the output port of Mux block to the input port of the cscope block. |
04:39 | Locate the line connecting the step input block and the summation block. |
04:44 | Connect the input port of Mux to that line. |
04:48 | Use the left mouse click to create line bends while making the connection. |
04:54 | Locate the line joining the transfer function block and the Mux block. |
04:59 | Connect the second input port of the summation block to that line. Use line bends wherever necessary. |
05:08 | Double-click on the PID block to open its parameter setting dialog box. |
05:14 | Here you can set the Proportional, Integral and Derivative gains. |
05:18 | Please note that the Integral gain should be considered as 1 by tau I, where tau I is the integral time. |
05:28 | We will use the default settings. Click on Cancel to use the default settings. |
05:34 | We are now ready to run the simulation. |
05:37 | Notice that we are using the step input block as a setpoint variable. |
05:42 | The PID controller will generate an input to the Transfer Function block. |
05:47 | It will be such that the output of the transfer function block matches the setpoint. |
05:53 | Click on Start simulation button available on the menu bar. |
05:58 | Expect a graphic window to open. It will have two variables plotted in a single plot. |
06:07 | The step plot is the setpoint which has a final value of 2. |
06:12 | The curved plot which is green in color, is the output of the transfer function which tries to meet the setpoint value of 2. |
06:22 | You can now change the PID settings and learn how they affect the output. |
06:28 | Pause the video here and solve the given exercises. |
06:33 | Implement a Proportional Controller only. That is, only P and not PID |
06:40 | Change the proportional gain such that the setpoint matches the output but without overshoots. |
06:47 | Include the output of the summation block in the plot. |
06:51 | You may use CMSCOPE to keep it separate. |
06:55 | Compare it visually with the output of the PID block |
06:59 | This brings us to the end of this tutorial. Let us summarize. |
07:04 | In this tutorial we learnt : To modify the firstorder.xcos file to implement a PID controller |
07:12 | Configure each block as per the simulation requirements |
07:16 | Setup the simulation parameters |
07:19 | The video at the following link, summarizes the Spoken Tutorial project.
Please download and watch it. |
07:26 | The Spoken Tutorial Project Team conducts workshops and gives certificates.
For more details, please write to us. |
07:34 | Do you have questions in THIS Spoken Tutorial? |
07:37 | Please visit http://forums.spoken-tutorial.org |
07:43 | Choose the minute and second where you have the question |
07:47 | Explain your question briefly |
07:50 | Someone from our team will answer them |
07:53 | The Spoken Tutorial forum is for specific questions on this tutorial |
07:58 | Please do not post unrelated and general questions on them |
08:03 | This will help reduce the clutter |
08:05 | With less clutter, we can use these discussions as instructional material |
08:11 | Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.. More information on this mission is available at the link shown. |
08:23 | This is Rupak Rokade signing off. Thanks for joining. |