Difference between revisions of "Single-Board-Heater-System/C2/Implementing-Proportional-Controller-on-SBHS-remotely/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "'''Title of script''': '''Implementing proportional controller on SBHS Remotely''' '''Author: Rupak Rokade''' '''Keywords: SBHS, Virtual labs, tutorial''' {| style="borde...")
 
 
Line 19: Line 19:
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| In this tutorial we will learn to:
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| In this tutorial we will learn to:
  
 
+
# Use '''Ziegler-Nichols tuning method''' to calculate '''proportional controller gain'''
# Use '''Ziegler-Nichols''' tuning method to calculate '''proportional''' '''controller''' gain
+
# Modify '''step test''' code to design a '''proportional controller'''
 
+
# Implement this '''proportional controller''' on '''SBHS'''
# Modify step test code to design a '''proportional''' '''controller'''
+
 
+
# Implement this '''proportional''' '''controller''' on '''SBHS'''
+
 
+
 
+
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show Slide
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Ensure that '''Scilab''' is installed on your computer.
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"|  
 +
Ensure that '''Scilab''' is installed on your computer.
  
  
Also, ensure that you have internet connectivity before you begin with this tutorial.
+
Also, ensure that you have '''internet''' connectivity before you begin with this tutorial.
  
  
Line 39: Line 35:
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show Slide
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| As a pre-requisite, watch the tutorial on <nowiki><!--StartFragment--></nowiki>'''Using SBHS Virtual labs on Windows OS'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| As a pre-requisite, watch the tutorial on '''Using SBHS Virtual labs on Windows OS'''
  
  
This tutorial is available on the spoken tutorial website.
+
This tutorial is available on the '''Spoken Tutorial''' website.
  
  
It will teach you how to do a basic '''step test''' experiment on '''SBHS,''' remotely
+
It will teach you how to do a basic '''step test''' experiment on '''SBHS,''' remotely.
  
  
You also need to have basic knowledge of '''PID''' tuning
+
You also need to have basic knowledge of '''PID''' tuning.
  
 
|-
 
|-
Line 62: Line 58:
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Browse to the folder, as per narration
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| In my machine, the '''data file''' is within '''Scilab codes windows '''folder''' >> step test '''folder >> '''logs''' folder.
+
 
 +
Point to the file.
 +
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| In my machine, the '''data file''' is within the '''Scilab_codes_windows '''folder >> '''step test '''folder >> '''logs''' folder.
  
  
Line 76: Line 74:
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''Downloads'''
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''Downloads''' on LHS.
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| On the left hand side, click on '''Downloads'''
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| On the left hand side, click on '''Downloads.'''
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''SBHS Analysis Code '''link
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''SBHS Analysis Code '''link >> save on '''Desktop'''.
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Download the file '''SBHS Analysis Code '''and save it on the '''Desktop.'''
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Download the file '''SBHS Analysis Code '''and save it on the '''Desktop.'''
  
Line 87: Line 85:
  
  
The file downloaded will be in zip format.
+
The file downloaded will be in '''zip''' format.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Right click on the zip file and choose extract here
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Right click on the zip file >> choose '''Extract here'''.
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Right-click and extract the contents of the zip file.
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Right-click and extract the contents of the '''zip''' file.
  
  
Line 104: Line 102:
  
  
The '''Step Analysis''' folder will have few more folders
+
The '''Step Analysis''' folder will have few more folders.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Copy-paste the '''data file'''inside '''Kp tau order1 '''folder.
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Copy-paste the '''data file''' generated earlier inside '''Kp tau order1 '''folder.
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Copy-paste the '''data file''' generated earlier inside '''Kp tau order1 '''folder.
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Double click on the file '''firstorder.sce'''
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Double click on the file '''firstorder.sce'''
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Double click on the '''Scilab''' file '''firstorder'''
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Double click on the '''Scilab''' file '''firstorder'''.
  
  
Line 118: Line 116:
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''File >> Open a file>>''' click on '''firstorder '''>> '''Open.'''
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| If it doesn't open the file, click on '''File''' menu then on '''Open a file.'''
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| If it doesn't open the file, click on '''File''' menu then on '''Open a file.'''
  
Line 125: Line 123:
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Change the '''filename''' argument with '''data file''' name
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Change the '''filename''' argument with '''data file''' name.
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Locate the variable '''filename''' and change its value to the filename of your '''data file'''.
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Locate the variable '''filename''' and change its value to the filename of your '''data file'''.
  
  
I will copy paste the file name to avoid spelling mistakes
+
I will copy paste the filename to avoid spelling mistakes.
  
  
Keep the .txt extension.
+
Keep the '''.txt''' extension.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on exeute button  
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''exeute''' button.
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Save and execute this '''Scilab''' code.
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Save and execute this '''Scilab''' code.
  
Line 145: Line 143:
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| This plot window will show two graphs,  
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| This plot window will show two graphs,  
  
* the '''SBHS''' temperature plot which has '''noise'''  
+
* the '''SBHS temperature plot''' which has '''noise'''  
* output of '''SBHS''' '''first order model''' which is a smooth curve
+
* and output of '''SBHS first order model''' which is a smooth curve.
 +
 
  
 
This code basically does the job of fitting a '''first order transfer function''' using the '''data file'''.
 
This code basically does the job of fitting a '''first order transfer function''' using the '''data file'''.
  
  
The value of '''time constant''' '''tau''' and '''gain''' '''Kp''' will be displayed on the top.
+
The value of '''time constant tau''' and '''gain Kp''' is displayed on the top.
  
  
In this tutorial we will not use the '''first order transfer function'''.
+
In this tutorial, we will not use the '''first order transfer function'''.
  
  
Line 167: Line 166:
  
  
We don't want the prediction output to appear on the plot
+
We don't want the '''prediction''' output to appear on the plot.
 
+
 
+
Comment out this line by putting two forward slashes at the beginning of the line
+
 
+
  
  
 +
Comment out this line by putting two '''forward slashes''' at the beginning of the line.
  
 
|-
 
|-
Line 180: Line 176:
  
  
Switch to the plot window
+
Switch to the '''plot''' window.
  
  
Notice that the plot window now has only the '''SBHS''' temperature plot
+
Notice that the '''plot''' window now has only the '''SBHS temperature plot'''.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| click on the '''File'''>>choose '''Export to'''>> type '''sbhsplot'''>>click on '''Files of type '''and choose '''PNG'''>> choose '''Desktop'''>> click on '''Save.'''
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| To save this image click on the '''File''' menu.
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| To save this image, click on the '''File''' menu.
  
  
Line 207: Line 203:
 
I will choose '''Desktop '''and click on '''Save.'''
 
I will choose '''Desktop '''and click on '''Save.'''
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Go to '''Desktop'' >> point to file.
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Let us open and see if the image file is created on the '''Desktop'''
  
Let us open and see if the image file is created on the '''Desktop'''
 
  
 +
Here it is.
  
Here it is
+
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Close window
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Close the image window.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|Switch to the slides
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Let me now switch to the slides.
  
Close the image window
+
|-
 
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|
 
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Let us calculate the value of '''proportional gain''' using '''Ziegler-Nichols tuning method.'''
Let me now switch to the slides
+
 
+
 
+
Let us calculate the value of '''proportional''' gain using '''Ziegler-Nichols tuning method.'''
+
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| There are two tuning rules given by '''Ziegler-Nichols''' to calculate the '''PID''' parameters. These are
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| There are two tuning rules given by '''Ziegler-Nichols''' to calculate the '''PID''' parameters. These are
 +
* '''Reaction curve '''method and
 +
* '''Instability '''method.
  
  
* '''Reaction curve '''method and
+
We will see the '''Reaction curve '''method.
* '''Instability '''method
+
 
+
We will see the '''Reaction curve '''method  
+
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| In this method a '''step input''' is given to the system and its output is observed over a period of time.
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| In this method,
 +
*a '''step input''' is given to the system  
 +
*and its output is observed over a period of time.
  
  
Line 240: Line 241:
  
  
A '''tangent''' is drawn at the point of '''inflection, '''that is when the curve changes from '''convex''' to '''concave'''.
+
A '''tangent''' is drawn at the point of '''inflection'''.
 +
 
 +
That is, when the curve changes from '''convex''' to '''concave'''.
  
  
Line 246: Line 249:
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide with figure.
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| This is illustrated in this figure
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| This is illustrated in this figure.
  
  
This is the tangent line drawn at the inflection point
+
This is the tangent line drawn at the point of '''inflection''' .
  
  
Line 257: Line 260:
 
* T is the '''time constant'''
 
* T is the '''time constant'''
  
 
+
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Replicate this on the '''SBHS''' output figure we just saved on the '''Desktop.'''
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Open image
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Open image
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Replicate this on the '''SBHS''' output figure we just saved on the '''Desktop.'''
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| I have already done this.
  
  
I have already done this.
+
Let me open this file.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| I have used '''paint brush''' which is a default image editing tool on '''Windows'''.
  
Let me open this file
+
|-
 
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Point to relevant info on the figure.
 
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| I have got the values of  
I have used '''paint brush''' which is a default image editing tool on '''Windows'''
+
 
+
 
+
I have got the values of  
+
  
* gain equal to 2.78  
+
* '''gain''' equal to 2.78  
* '''dead time''' equal to x seconds
+
* '''dead time''' equal to 1 second
* and '''time constant''' equal to y seconds
+
* and '''time constant''' equal to 50 seconds
  
 
Note that these are all approximate values.
 
Note that these are all approximate values.
  
  
The values depend on the accuracy with which you draw the tangent line at the inflection point.
+
The values depend on the accuracy with which you draw the tangent line at the '''inflection point'''.
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| After you get the required values, refer to the table given by '''Ziegler-Nichols''' to calculate the value of '''PID'''.  
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| After you get the required values,  
 +
*refer to the table given by '''Ziegler-Nichols'''  
 +
*to calculate the value of '''proportional gain'''.  
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Switch to the slides
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Let me switch to the slides.
  
Let me switch to the slides
 
  
 +
For a '''proportional controller''', we need to calculate only the value of '''proportional gain'''.
  
For a '''proportional''' '''controller''', we need to calculate only the value of '''proportional''' gain
 
  
 +
In my case the value of '''proportional gain''' comes out to be 18.
  
In my case the value of '''proportional''' gain comes out to be X
+
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Now let us see how to implement the '''proportional controller''' on '''SBHS'''.
  
  
But a unity gain will have no noticeable effect.
+
We would modify the '''step test''' code for this.
 
+
 
+
Hence I approximate the value to 2
+
 
+
 
+
Now let us see how to implement the '''proportional''' '''controller''' on SBHS
+
 
+
 
+
We would modify the step test code for this
+
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Switch to '''step test''' code folder>> make a copy >> rename as '''proportional '''and open it
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the folder where you have the '''step test''' code.
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the folder where you have the '''step test''' code.
  
  
Make a copy of this folder
+
Here it is.  Make a copy of this folder.
  
  
Line 320: Line 322:
  
  
Rename the '''stepc.sce''' file to '''proportional'''
+
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Rename '''stepc''' as '''proportional '''>> '''steptest.sci''' as '''proportional '''>> '''steptest.xcos''' as '''proportional '''
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Rename the '''stepc''' file to '''proportional'''.
  
  
Rename the '''steptest.sci''' file to '''proportional'''
+
Rename the '''steptest dot sci''' file to '''proportional'''.
  
  
Rename the '''steptest'''.'''xcos''' file to '''proportional'''
+
Rename the '''steptest dot xcos''' file to '''proportional'''.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration >> Double-click on  '''proportional.sce'''
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Close '''Scilab''' if already running
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Close '''Scilab''' if already running.
  
  
Double click on the '''proportional.sce''' file
+
Double-click on the '''proportional dot sce''' file.
  
  
This should launch '''Scilab''' automatically and also open the file in '''Scilab''' editor
+
This should launch '''Scilab''' automatically and also open the file in '''Scilab''' editor.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''File''' >> '''Open a file'''
 +
>> Choose '''proportional.sce '''>> '''Open'''
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|If it doesn't open the file, click on '''File''' menu then on '''Open a file.'''
  
If it doesn't open the file, click on '''File''' menu then on '''Open a file.'''
 
  
 +
Choose the file '''proportional dot sce '''and click on '''Open.'''
  
Choose the file '''proportional.sce '''and click on '''Open.'''
+
|-
 +
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Change '''exec''' command>> '''steptest.sci''' as '''proportional.sci'''
 +
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Change the '''exec''' command to execute '''proportional.sci''' file instead of '''steptest.sci''' file.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Change '''xcos''' command>> '''steptest.xcos''' as '''proportional.sci''' >> Save file.
 +
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Change the '''xcos''' command to execute '''proportional.xcos''' file instead of '''steptest.xcos''' file.
  
  
 +
Save this file.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''File''' >> '''Open'''
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| Change the '''exec''' command to execute '''proportional.sci''' file instead of '''steptest.sci''' file
+
>> Choose '''proportional.sci '''>> '''Open'''>> Change '''steptest''' to '''proportional'''.
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Click on '''File''' menu and choose '''Open'''.
  
  
Change the '''xcos''' command to execute '''proportional.xcos''' file instead of '''steptest.xcos''' file
+
Select the file '''proportional.sci''' file and click on '''Open'''.
  
  
Save this file
+
Change the function name from '''steptest''' to '''proportional'''.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Change '''heat'' as '''setpoint'''>>type '''global space temp'''>> press '''Enter'''
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Click on File menu and choose Open.
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Delete the input variable '''heat''' from the '''proportional''' function input and type '''setpoint'''.
  
  
Select the file '''proportional.sci''' file and click on Open
+
In the next line, type '''global''', leave a '''space''' and then type '''temp''' and press '''Enter'''.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|In the next line type '''err equal to setpoint minus temp'''.
  
Change the function name from '''steptest''' to '''proportional'''
 
  
 +
Add '''semicolon''' at the end and press '''Enter'''.
  
Delete the input variable '''heat''' from the '''proportional''' function input and type '''setpoint'''
+
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|In the next line type '''heat equal to 18''' multiplied by '''err'''
  
  
In the next line type '''global''', leave a space and then type '''temp''' and press '''Enter'''  
+
Add '''semicolon''' at the end.
  
  
In the next line type '''err''' '''equal''' '''to''' '''setpoint''' '''minus''' '''temp'''  
+
Here 18 is the value of the '''proportional gain''' for my '''SBHS'''.
  
  
Add semicolon at the end and press '''Enter'''
+
You may change it according to what you would have calculated for your '''SBHS'''.
  
 
+
|-
In the next line type '''heat equal to 2''' multiplied by '''err'''
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|Add a space after '''temp''' and type '''setpoint'''
 
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Add '''setpoint''' in the input variable of the '''plotting function '''inside its '''function call.'''
 
+
Add semicolon at the end
+
 
+
 
+
Here '''2''' is the value of the '''proportional''' gain for my '''SBHS'''.
+
 
+
 
+
You may change it according to what you would have calculated for your '''SBHS'''
+
 
+
 
+
Add '''setpoint''' in the input variable of the '''plotting function '''inside its '''function call.'''
+
  
  
 
To do so, add a space after '''temp''' and type '''setpoint'''.
 
To do so, add a space after '''temp''' and type '''setpoint'''.
  
 
+
|-
Then save this file
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Save this file.
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Save this file.
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Switch to '''Scilab console'''>> Type '''xcos'''> press '''Enter'''>> Close '''palette'''.
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the '''Scilab''' console, type '''xcos''' and press '''Enter'''
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the '''Scilab console'''.
  
  
'''xcos''' window will open
+
Type '''xcos''' and press '''Enter'''.
  
  
Close the '''palette''' window
+
'''xcos''' window will open.
  
  
On the xcos untitled window, click on '''File''' menu and choose '''Open'''
+
Close the '''palette''' window.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| click on '''File'''>> '''Open'''>> '''proportional''' directory >>Select '''proportional.xcos''' >> click on '''Open'''.
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|On the '''xcos untitled''' window, click on '''File''' menu and choose '''Open'''.
  
Browse to the '''proportional''' directory
 
  
 +
Browse to the '''proportional''' directory.
  
Select '''proportional.xcos''' and click on '''open'''
 
  
 +
Select '''proportional.xcos''' and click on '''Open'''.
  
'''Xcos''' file will open
 
  
 +
'''Xcos''' file will open.
  
Double click on the label '''Heat''' '''input in percentage'''
+
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Double-click on the label '''Heat input in percentage'''.
  
Delete it and type '''setpoint'''
+
Delete it and type '''setpoint'''.
  
  
Click once anywhere on the '''xcos''' window to save the label
+
Click once anywhere on the '''xcos''' window to save the label.
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Double click on the '''step input''' block to open its property window
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Double click on the '''step input''' block to open its '''Properties''' window.
  
  
Change the '''initial value''' to 30 and '''final value''' to 40
+
Change the '''initial value''' to 30 and '''final value''' to 40.
  
  
Keep step time as 300
+
Keep '''step time''' as 300.
  
  
click on '''Ok'''
+
Click on '''Ok'''.
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Double click on the '''function''' block
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Double click on the '''function''' block.
  
  
A window will appear. click on '''OK'''
+
A window will appear. Click on '''OK'''.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Another window will appear.
  
Another window will appear.
 
  
 +
Here there is an option to enter the function name to be called by this '''xcos''' block.
  
Here there is an option to enter the function name to be called by this '''xcos''' block
 
  
 +
Change the function name from '''step test '''to''' proportional'''.
  
Change the function name '''step test '''to''' proportional'''
 
  
 +
Click on '''Ok'''.
  
Click on '''ok'''
+
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Another window will open.
  
  
Another window will open. Keep clicking on '''ok''' three times to finish configuring the '''function''' block
+
Keep clicking on '''Ok''' three times to finish configuring the '''function''' block.
  
  
Line 469: Line 489:
  
  
Close the '''xcos''' '''untitled''' window as well
+
Close the '''xcos untitled''' window as well.
 
+
 
+
 
+
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''Virtual labs'''>> Login >> Book a slot.
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the web browser
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the web browser.
  
  
On the left hand side, click on '''Virtual labs'''
+
On the left hand side, click on '''Virtual labs'''.
  
  
Login with your registered '''username''' and '''password'''
+
Login with your registered '''username''' and '''password'''.
  
  
Book a '''slot'''
+
Book a '''slot'''.
 
+
 
+
I have already booked the '''slot'''. Here it is.
+
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Switch to '''proportional''' folder >> run
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the '''proportional''' folder
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the '''proportional''' folder.
  
  
Double click on the file '''run'''
+
Double click on the file '''run'''.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Login >> Point to message
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|This will open the '''SBHS''' client application.
  
This will open the '''SBHS''' client application
 
  
 +
Login with your '''username''' and '''password'''.
  
Login with your '''username''' and '''password'''
 
  
 +
Make sure you are logging in at the booked '''slot''' time.
  
Make sure you are logging in at the booked '''slot''' time
 
  
 
+
Expect the message '''Ready to execute Scilab code'''.
Expect the message '''Ready to execute Scilab code'''
+
  
 
|-
 
|-
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| On '''Scilab console''' >> type as per narration
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the '''Scilab''' console
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Switch to the '''Scilab console'''.
  
  
Type '''getd space dot dot slash common underscore files'''
+
Type '''get d space dot dot slash common files'''
  
  
Press '''enter'''
+
Press '''Enter'''
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Execute '''proportional.sce''' on '''Scilab''' editor >> execute '''xcos''' diagram.
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Switch to the '''Scilab''' editor.
  
Switch to the '''Scilab''' editor
 
  
 +
Execute the file '''proportional.sce'''
  
execute the file '''proportional.sce'''
 
  
 +
If the network is fine, then it will automatically open the '''xcos''' window with  '''proportional controller xcos''' diagram.
  
If the network is fine then it will automatically open the '''xcos''' window with
 
  
'''proportional''' '''controller''' '''xcos''' diagram
+
Execute the '''xcos''' diagram and expect a plot window.
 
+
 
+
Execute the '''xcos''' diagram and expect a plot window  
+
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Point on various plots on graph
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Point on various plots on graph
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| The plot window will have three plots '''heat fan temperature'''  
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| The plot window will have three plots '''heat, fan, temperature'''.
  
  
Setpoint will also be plotted in the temperature graph  
+
'''Setpoint''' will also be plotted in the '''temperature''' graph.
  
  
Observe that the '''proportional''' '''controller''' computes the value of '''heat''' in order to achieve the '''setpoint''' value of temperature
+
Observe that the '''proportional controller'''  
 +
*computes the value of '''heat'''  
 +
*in order to achieve the '''setpoint''' value of '''temperature'''.
  
 +
|-
 +
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 +
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|Run this experiment long enough to observe what happens after a '''step change''' in '''setpoint''' occurs.
  
Run this experiment long enough to observe what happens after a step change in '''setpoint''' occurs.
+
|-
 
+
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Demo as per narration
 
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"|I will now pause this recording until the experiment is executed for sufficient time.
I will now pause this recording until the experiment is executed for sufficient time  
+
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
 
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| You can see that the '''proportional''' '''controller''' has responded to the change in '''setpoint'''
+
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;"| You can see that the '''proportional controller''' has responded to the change in '''setpoint'''.
  
  
You can observe that the '''proportional''' '''controller''' inherently has the property of offset
+
You can observe that the '''proportional controller''' inherently has the property of '''offset'''.
  
  
A '''proportional''' '''controller''' will always have an offset between the setpoint value and the actual value
+
A '''proportional controller''' will always have an '''offset''' between the '''setpoint''' value and the actual value.
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"|  
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Now let us summarize, In this tutorial we learnt to  
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Now let us summarize, In this tutorial we learnt to-
 
+
# Use '''Ziegler-Nichols''' tuning method to calculate '''proportional''' '''controller''' gain for SBHS
+
# Modify step test code to design a '''proportional''' '''controller'''
+
# Implement the designed '''proportional''' '''controller''' on SBHS
+
 
+
  
 +
# Use '''Ziegler-Nichols''' tuning method to calculate '''proportional controller gain''' for '''SBHS'''
 +
# Modify '''step test''' code to design a '''proportional controller'''
 +
# Implement the designed '''proportional controller''' on '''SBHS'''
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Watch the video available at the following link
+
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| Watch the video available at the following link.
  
  
Line 577: Line 593:
  
  
If you do not have good bandwidth, you can download and watch it
+
If you do not have good bandwidth, you can download and watch it.
  
 
|-
 
|-
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
 
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.097cm;"| Show slide
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| The Spoken Tutorial Project Team
 
| style="background-color:#ffffff;border:1pt solid #000000;padding:0.097cm;"| The Spoken Tutorial Project Team
 
+
*Conducts workshops using spoken tutorials.
 
+
*Gives certificates to those who pass an online test.
Conducts workshops using spoken tutorials.
+
 
+
 
+
Gives certificates to those who pass an online test
+
  
  
Line 597: Line 609:
  
  
It is supported by the National Mission on Education through ICT, MHRD, Government of India
+
It is supported by the National Mission on Education through ICT, MHRD, Government of India.
  
 
More information on this Mission is available at: [http://spoken-tutorial.org/NMEICT-Intro http://spoken-tutorial.org/NMEICT-Intro]
 
More information on this Mission is available at: [http://spoken-tutorial.org/NMEICT-Intro http://spoken-tutorial.org/NMEICT-Intro]
Line 603: Line 615:
 
Thanks for joining, This is Rupak Rokade from IIT Bombay signing off.  
 
Thanks for joining, This is Rupak Rokade from IIT Bombay signing off.  
  
Thank You
+
Thank You.
  
 
|}
 
|}

Latest revision as of 17:42, 9 February 2015

Title of script: Implementing proportional controller on SBHS Remotely

Author: Rupak Rokade

Keywords: SBHS, Virtual labs, tutorial


Narration
Show Slide Welcome to the spoken tutorial on Implementing proportional controller on SBHS remotely.
Show Slide In this tutorial we will learn to:
  1. Use Ziegler-Nichols tuning method to calculate proportional controller gain
  2. Modify step test code to design a proportional controller
  3. Implement this proportional controller on SBHS
Show Slide

Ensure that Scilab is installed on your computer.


Also, ensure that you have internet connectivity before you begin with this tutorial.


I am recording this tutorial on a Windows 7 32-bit OS

Show Slide As a pre-requisite, watch the tutorial on Using SBHS Virtual labs on Windows OS


This tutorial is available on the Spoken Tutorial website.


It will teach you how to do a basic step test experiment on SBHS, remotely.


You also need to have basic knowledge of PID tuning.

Show Slide You should have the step test experiment code folder available with you.


You should also have the step test experiment data file with you.


If not, then it is recommended that you re-do the step test experiment and generate a new data file.

Browse to the folder, as per narration

Point to the file.

In my machine, the data file is within the Scilab_codes_windows folder >> step test folder >> logs folder.


Here is a folder with my username and here is my data file.

Open web browser and browse to sbhs.os-hardware.in Let us now download the Analysis code from the website.


Open a web browser and go to the web site sbhs.os-hardware.in

Click on Downloads on LHS. On the left hand side, click on Downloads.
Click on SBHS Analysis Code link >> save on Desktop. Download the file SBHS Analysis Code and save it on the Desktop.


Here it is.


The file downloaded will be in zip format.

Right click on the zip file >> choose Extract here. Right-click and extract the contents of the zip file.


A folder named Scilab codes analysis will be created.

Paste the data file inside Kp tau order1 folder Open this folder.


Locate and open the folder Step Analysis.


The Step Analysis folder will have few more folders.

Copy-paste the data fileinside Kp tau order1 folder. Copy-paste the data file generated earlier inside Kp tau order1 folder.
Double click on the file firstorder.sce Double click on the Scilab file firstorder.


This will launch Scilab automatically and will also open the file in Scilab editor.

Click on File >> Open a file>> click on firstorder >> Open. If it doesn't open the file, click on File menu then on Open a file.


Choose the file firstorder and click on Open.

Change the filename argument with data file name. Locate the variable filename and change its value to the filename of your data file.


I will copy paste the filename to avoid spelling mistakes.


Keep the .txt extension.

Click on exeute button. Save and execute this Scilab code.


If the data file is not corrupted and there are no errors, a plot window will open.

Point at respective information available on the plot This plot window will show two graphs,
  • the SBHS temperature plot which has noise
  • and output of SBHS first order model which is a smooth curve.


This code basically does the job of fitting a first order transfer function using the data file.


The value of time constant tau and gain Kp is displayed on the top.


In this tutorial, we will not use the first order transfer function.


We will only use the plot of the SBHS output.

Switch to editor and comment the line plot2d(t,prediction) Switch to the Scilab editor.


Locate the line plot2d of t comma y underscore prediction.


We don't want the prediction output to appear on the plot.


Comment out this line by putting two forward slashes at the beginning of the line.

Execute the code and show the plot Save and execute the Scilab code.


Switch to the plot window.


Notice that the plot window now has only the SBHS temperature plot.

click on the File>>choose Export to>> type sbhsplot>>click on Files of type and choose PNG>> choose Desktop>> click on Save. To save this image, click on the File menu.


Then choose Export to option.


Give a name to the image file.


I will type sbhsplot.


Click on the drop down menu for Files of type and choose PNG.


Choose a directory where you want to save the file.


I will choose Desktop and click on Save.

Go to 'Desktop >> point to file. Let us open and see if the image file is created on the Desktop


Here it is.

Close window Close the image window.
Switch to the slides Let me now switch to the slides.
Let us calculate the value of proportional gain using Ziegler-Nichols tuning method.
Show slide There are two tuning rules given by Ziegler-Nichols to calculate the PID parameters. These are
  • Reaction curve method and
  • Instability method.


We will see the Reaction curve method.

Show slide In this method,
  • a step input is given to the system
  • and its output is observed over a period of time.


Any practical system would respond exponentially to a step input.


A tangent is drawn at the point of inflection.

That is, when the curve changes from convex to concave.


The dead time and time constant is calculated from the time axis.

Show slide with figure. This is illustrated in this figure.


This is the tangent line drawn at the point of inflection .


  • K is the gain of the system
  • L is the dead time
  • T is the time constant
Replicate this on the SBHS output figure we just saved on the Desktop.
Open image I have already done this.


Let me open this file.

I have used paint brush which is a default image editing tool on Windows.
Point to relevant info on the figure. I have got the values of
  • gain equal to 2.78
  • dead time equal to 1 second
  • and time constant equal to 50 seconds

Note that these are all approximate values.


The values depend on the accuracy with which you draw the tangent line at the inflection point.

Show slide After you get the required values,
  • refer to the table given by Ziegler-Nichols
  • to calculate the value of proportional gain.
Switch to the slides Let me switch to the slides.


For a proportional controller, we need to calculate only the value of proportional gain.


In my case the value of proportional gain comes out to be 18.

Now let us see how to implement the proportional controller on SBHS.


We would modify the step test code for this.

Switch to step test code folder>> make a copy >> rename as proportional and open it Switch to the folder where you have the step test code.


Here it is. Make a copy of this folder.


Rename this folder as proportional and open it.


Rename stepc as proportional >> steptest.sci as proportional >> steptest.xcos as proportional Rename the stepc file to proportional.


Rename the steptest dot sci file to proportional.


Rename the steptest dot xcos file to proportional.

Demo as per narration >> Double-click on proportional.sce Close Scilab if already running.


Double-click on the proportional dot sce file.


This should launch Scilab automatically and also open the file in Scilab editor.

Click on File >> Open a file

>> Choose proportional.sce >> Open

If it doesn't open the file, click on File menu then on Open a file.


Choose the file proportional dot sce and click on Open.

Change exec command>> steptest.sci as proportional.sci Change the exec command to execute proportional.sci file instead of steptest.sci file.
Change xcos command>> steptest.xcos as proportional.sci >> Save file. Change the xcos command to execute proportional.xcos file instead of steptest.xcos file.


Save this file.

Click on File >> Open

>> Choose proportional.sci >> Open>> Change steptest to proportional.

Click on File menu and choose Open.


Select the file proportional.sci file and click on Open.


Change the function name from steptest to proportional.

Change heat as setpoint'>>type global space temp>> press Enter Delete the input variable heat from the proportional function input and type setpoint.


In the next line, type global, leave a space and then type temp and press Enter.

Demo as per narration In the next line type err equal to setpoint minus temp.


Add semicolon at the end and press Enter.

Demo as per narration In the next line type heat equal to 18 multiplied by err


Add semicolon at the end.


Here 18 is the value of the proportional gain for my SBHS.


You may change it according to what you would have calculated for your SBHS.

Add a space after temp and type setpoint Add setpoint in the input variable of the plotting function inside its function call.


To do so, add a space after temp and type setpoint.

Save this file. Save this file.
Switch to Scilab console>> Type xcos> press Enter>> Close palette. Switch to the Scilab console.


Type xcos and press Enter.


xcos window will open.


Close the palette window.

click on File>> Open>> proportional directory >>Select proportional.xcos >> click on Open. On the xcos untitled window, click on File menu and choose Open.


Browse to the proportional directory.


Select proportional.xcos and click on Open.


Xcos file will open.

Demo as per narration Double-click on the label Heat input in percentage.

Delete it and type setpoint.


Click once anywhere on the xcos window to save the label.

Demo as per narration Double click on the step input block to open its Properties window.


Change the initial value to 30 and final value to 40.


Keep step time as 300.


Click on Ok.

Demo as per narration Double click on the function block.


A window will appear. Click on OK.

Demo as per narration Another window will appear.


Here there is an option to enter the function name to be called by this xcos block.


Change the function name from step test to proportional.


Click on Ok.

Demo as per narration Another window will open.


Keep clicking on Ok three times to finish configuring the function block.


Save the xcos diagram and close it.


Close the xcos untitled window as well.

Click on Virtual labs>> Login >> Book a slot. Switch to the web browser.


On the left hand side, click on Virtual labs.


Login with your registered username and password.


Book a slot.

Switch to proportional folder >> run Switch to the proportional folder.


Double click on the file run.

Login >> Point to message This will open the SBHS client application.


Login with your username and password.


Make sure you are logging in at the booked slot time.


Expect the message Ready to execute Scilab code.

On Scilab console >> type as per narration Switch to the Scilab console.


Type get d space dot dot slash common files


Press Enter

Execute proportional.sce on Scilab editor >> execute xcos diagram. Switch to the Scilab editor.


Execute the file proportional.sce


If the network is fine, then it will automatically open the xcos window with proportional controller xcos diagram.


Execute the xcos diagram and expect a plot window.

Point on various plots on graph The plot window will have three plots heat, fan, temperature.


Setpoint will also be plotted in the temperature graph.


Observe that the proportional controller

  • computes the value of heat
  • in order to achieve the setpoint value of temperature.
Demo as per narration Run this experiment long enough to observe what happens after a step change in setpoint occurs.
Demo as per narration I will now pause this recording until the experiment is executed for sufficient time.
You can see that the proportional controller has responded to the change in setpoint.


You can observe that the proportional controller inherently has the property of offset.


A proportional controller will always have an offset between the setpoint value and the actual value.

Now let us summarize, In this tutorial we learnt to-
  1. Use Ziegler-Nichols tuning method to calculate proportional controller gain for SBHS
  2. Modify step test code to design a proportional controller
  3. Implement the designed proportional controller on SBHS
Show slide Watch the video available at the following link.


It summarises the Spoken Tutorial project.


If you do not have good bandwidth, you can download and watch it.

Show slide The Spoken Tutorial Project Team
  • Conducts workshops using spoken tutorials.
  • Gives certificates to those who pass an online test.


For more details, please write to contact at spoken-tutorial.org

Show slide Spoken Tutorial Project is a part of the Talk to a Teacher project.


It is supported by the National Mission on Education through ICT, MHRD, Government of India.

More information on this Mission is available at: http://spoken-tutorial.org/NMEICT-Intro

Thanks for joining, This is Rupak Rokade from IIT Bombay signing off.

Thank You.

Contributors and Content Editors

Nancyvarkey, Rupakrokade