0% found this document useful (0 votes)
4 views11 pages

Lab 10 Cs

Uploaded by

maazismail222
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views11 pages

Lab 10 Cs

Uploaded by

maazismail222
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

DEPARTMENT OF MECHATRONICS ENGINEERING

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR


MtE-328L Control system LAB, 6th Semester

Student Name: Mian sayaf ali shah


Registration Number: 18PWMCT0612
Lab No. 8: Observe the output of PI controller

Criteria (Taxonomy Excellent (4) Proficient (3) Basic (2) Below Basic (1) Student’s
Level) Score
To organize the lab Report is as per the Report is mostly as Report is Sections/Steps are
report and practice the guidelines. All per the guidelines disorganized and not ordered and
writing skills as per the sections/steps are and most follows some Report is not as
guidelines clearly organized in a sections/steps are guidelines but
ordered well but per the guidelines
logical order. most of the
requires minor
guidelines are
improvements.
missing
The report The report discusses The report discusses The report is
To discuss the actual completely
The required the experiment/lab totally irrelevant
experiment/task discusses the required experiment/lab work but have to the
experiment/lab work work irrelevant experiment/lab
in own words with work
information
some relevant
additional
information

To perform calculations Calculations and Calculations and data Most data and Calculations and
data analyses were analysis were observations were data analyses of
and data analysis
performed clearly, performed recorded adequately
accurately, but but with several lab were missing
concisely, and
accurately, with minor errors were significant errors or
correct units. made both in omissions.
calculations and in
applying correct
units

To present results in the Graphs, if necessary, Graphs, if necessary, Graphs, if Major components
were drawn were drawn adequately necessary, were of lab were
form of graphs
accurately and neatly drawn but Missing
and were clearly inadequately.
labelled.

Comments:

Course Instructor: Engr. Wahad Ur Rahman


DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Lab No: 10

Title: Observe the output of PI controller

Objectives:
 To study the detail theory of PI.
 Design the PI controller using command in .m file.
 Design the PI controller in Simulink.
 Tuning of PI controller for desired output.
 Apply the PI controller to a real time system.

Apparatus and Tools:


 MATLAB Simulink
 Control system Library

Theory:
Controller:
A controller is a mechanism that seeks to minimize the difference between the actual
value of a system (i.e. the process variable) and the desired value of the system (i.e.
the setpoint). Controllers are a fundamental part of control engineering and are used in
all complex control systems. [1]

Important Uses of Controller:


 Controllers improve the steady-state accuracy by decreasing the steady state error.
 As the steady-state accuracy improves, the stability also improves.
 Controllers also help in reducing the unwanted offsets produced by the system.
 Controllers can control the maximum overshoot of the system.
 Controllers can help in reducing the noise signals produced by the system.
 Controllers can help to speed up the slow response of an overdamped system. [1]

Types of Controllers:
There are two main types of controllers:
 Continuous controllers.
 Discontinuous controllers.

Discontinuous Controller:
In discontinuous controllers, the manipulated variable changes between discrete
values. Depending on how many different states the manipulated variable can assume,
a distinction is made between two position, three position, and multi-position
controllers. Discontinuous controllers operate on very simple, switching final
controlling elements. [1]
Course Instructor: Engr. Wahad Ur Rahman

1
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Continuous Controller:
The main feature of continuous controllers is that the controlled variable (also known
as the manipulated variable) can have any value within the controller’s output range.
Basically, there are three basic modes on which the whole control actions take place.
 Proportional Controllers.
 Integral Controllers.
 Derivative Controllers.
By combining above three controllers, we can get:
 Proportional and integral controllers (PI Controller)
 Proportional and derivative controllers (PD Controller)
 Proportional integral derivative control (PID Controller) [1]

Objectives of Controller:
 Decrease the maximum overshot
 Reduce the rise time
 Reduce the settling time
 Reduce steady state error

Figure 8:1: Block Diagram of proportional controller

PI Controller:
A P.I Controller is a feedback control loop that calculates an error signal by taking the
difference between the output of a system, which in this case is the power being
drawn from the battery, and the set point. The set point is the level at which we’d like
to have our system running. The proportional integral controller is used to decrease
the steady state error without affecting the stability of the control system. [2]
u ( t )=K p e ( t ) + K i ∫ e ( t ) dt

The Laplace transform is


U ( S) KI
=K P +
E( S) S

Course Instructor: Engr. Wahad Ur Rahman

2
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Figure 8:2: Block Diagram of PI controller [2]

Modeling of Mass Spring Damper System:

Figure 8:3: Mass Spring Damper System


X (S ) 1
The transfer function of the system is = 2
F ( S ) S +10 S+20
Lets take the values are m = 1, b = 10, k = 20

Procedure:
 Consider the mass spring system.
 Create the .m file
 Simulate the step response of the system without PI and PD controller.
 Calculate the SS error from initial value and final value.
 Apply the PI and PD controller to reduce the steady state error.
 Keep the value of Kp constant and changing the Ki and Kdvalue.
 Open the Simulink and model the system in Simulink.
 First model it without PI and PD controller and then with PI and PD controller.
 Analyze the response before and after proportional controller.
 Simulate it for different values of proportional constant Kd and Ki.

Code in .m file for PI Controller:


num = [1] %numerator
denum = [1 10 20] %denumerator
system = tf(num, denum) %transfer function
step(system)
Course Instructor: Engr. Wahad Ur Rahman

3
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

stepinfo(system) %characterisitics of step response

kp1 = 500; %When Proportional const value is 500


ki1 = 10; %When Integral const value is 10
c1 = pid(kp1,ki1,0);
T1 = feedback(c1*system,1);

kp2 = 500; %When Proportional const value is 500


ki2 = 100; %When integrl const value is 100
c2 = pid(kp2,ki2,0);
T2 = feedback(c2*system,1);

kp3 = 500; %When Proportional const value is 500


ki3 = 300; %When integral const value is 300
c3 = pid(kp3,ki3,0);
T3 = feedback(c3*system,1);

kp4 = 500; %When Proportional const value is 500


ki4 = 500; %When derivtive const value is 500
c4 = pid(kp4,ki4,0);
T4 = feedback(c4*system,1);
linearSystemAnalyzer(T1,T2,T3,T4)
Circuit Diagram:

Figure 8:4: System without any controller

Course Instructor: Engr. Wahad Ur Rahman

4
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Figure 8:5: System response at different values of Kp and Kd

Course Instructor: Engr. Wahad Ur Rahman

5
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Figure 8:6: System response at different values of Kp and Ki

Results:
Observations:
Table 8:1: System characteristics at different values of Kp and Kd
Proportional Derivative Rise Time Settling Steady State SS Error
Gain Kp Gain Kd Time Value
100 1 0.149 0.726 0.833 0.167
10 0.148 0.22 0.833 0.167
50 0.0335 0.298 0.833 0.167
100 0.0147 1.49 0.833 0.167
500 0.00267 9.26 0.833 0.167
500 1 0.055 0.713 0.962 0.038
10 0.0576 0.348 0.962 0.038
50 0.0387 0.0602 0.962 0.038
100 0.0217 0.0424 0.962 0.038
500 0.00398 0.013 0.962 0.038
1000 1 0.0373 0.709 0.98 0.02
10 0.0388 0.341 0.98 0.02
50 0.0306 0.154 0.98 0.02
100 0.0205 0.0331 0.98 0.02
500 0.00426 0.00736 0.98 0.02

Course Instructor: Engr. Wahad Ur Rahman

6
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Table 8:2: System characteristics at different values of Kp and Kd


Proportional Integral Gain Rise Time Settling Steady State SS Error
Gain Kp Ki Time Value
100 1 0.185 254 1 0
10 0.183 24.9 1 0
50 0.173 4.54 1 0
100 0.163 1.95 1 0
500 0.125 1.68 1 0
500 1 0.0559 12.3 1 0
10 0.0559 9.32 1 0
50 0.0557 6.32 1 0
100 0.0555 2.91 1 0
500 0.543 0.9 1 0
1000 1 0.0375 1.43 1 0
10 0.0375 1.41 1 0
50 0.0375 1.22 1 0
100 0.0375 1.03 1 0
500 0.0373 0.835 1 0
Graphs:

Figure 8:8: System response at different values of Kp and Ki using Linear system Analyzer

Course Instructor: Engr. Wahad Ur Rahman

7
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Figure 8:9: System response at different values of Kp and Kd using Linear system Analyzer

Figure 8:10: System response at different values of Kp and Kd in Simulink

Course Instructor: Engr. Wahad Ur Rahman

8
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Figure 8:11: System response at different values of Kp and Ki in Simulink

Discussion:
We model the system that was given in task. But there was a lot of unwanted offsets,
low accuracy and instability. So we use PI, to remove unwanted offsets, gain more
stability and accuracy. Also rise time were decreasing but peak amplitude were
increasing. By increasing Kp, we got more fluctuations. From Table 8.1 and figure
8.10, we are seeing by keeping the value of Kp constant and increasing the value of
Kd, having the effect on increasing stability, reducing the overshoot, and Improving
the transient response. From Table 8.2 and figure 8.11, we are seeing by keeping the
value of Kp constant and increasing the value of Ki, having the effect of eliminating
the steady state error, but it may make the transient response worse.

References
[1] [Online]. Available: https://www.electrical4u.com/types-of-controllers-proportional-
integral-derivative-controllers/.
[2] [Online]. Available:
https://www.tutorialspoint.com/control_systems/control_systems_controllers.htm.

Course Instructor: Engr. Wahad Ur Rahman

9
DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, PESHAWAR
MtE-328L Control system LAB, 6th Semester

Course Instructor: Engr. Wahad Ur Rahman

10

You might also like