SlideShare a Scribd company logo
Trimberger 1
PID Temperature Controller
Figure 1 – Photograph of Feedback Circuit.
Gerard Trimberger
In collaboration with Gabriela Patilea and Gina Tran
Section: AC
March 13, 2012
Trimberger 2
Methods and Materials
Parts, Materials, and Equipment Used:
 Breadboard & connecting wire
 One TIP121 power transistor
 One 5 Ω resistor, rated for 5 W called “low‐value resistor”
 One Thermistor: 135‐202FAG‐J01, 135‐103LAG‐J01, or similar
 Heat sink
 Two 10kΩ resistor
 Power supply
 USB‐6009 data I/O device
 Digital Computer with LabView program
Circuit schematic diagram:
Figure 2 – Circuit Schematic Diagram of System; H(s).
Trimberger 3
General Principle and Theory of PID Controller:
The general principle of any feedback control system is that the difference between the
set point and the output of the system is defined as the error. This error is then fed back into the
system in an attempt to bring the output of the system to the set point value. The simplest type of
feedback control is proportional, such that the controller output is equal to the error multiplied by
some proportional control gain constant. To improve the system’s performance, integral and
differential terms can be added. Therefore the proportional-integral-differential (PID) controller
algorithm can be written as:
where, u(t) is “controller” output, MV is a manipulated variable, kp is proportional control gain,
ki is integral control gain, kd is derivative control gain, and e(t) is the error of desired output and
measured output (or set point – process value) over time. The Laplace of u(t) (PID algorithm) is,
The transfer function of the system under control is,
where, is the natural frequency and is the damping factor. The gain of the feedback loop is,
By plugging in the previously defined functions for the Laplace of the PID algorithm and the
transfer function of the system under control, the transfer function for the entire loop is,
General Block Diagram of Feedback Control System
Figure 3 – General Block Diagram of Feedback Control System.
Trimberger 4
Supplied LabView VI’s and Their Purpose:
PWM Application Test VI:
Figure 4 – Front Panel of “PWM Application Test” VI. Figure 5 – Block Diagram of “PWM Application Test” VI.
The PWM (pulse width modulation) application test VI was used to examine the system
under control. The heating system circuit was build using the electrical components described
above (Figure 2). A constant (control) voltage was run through the system and the output was
recorded so that a data set of control voltages and measured voltages over time were created for
the thermal heating system.
PWM sub-VI:
Figure 6 – Front Panel of “PWM sub-VI.” Figure 7 – Block Diagram of “PWM sub-VI.”
The PWM sub-VI was used to create a duty cycle. A duty cycle allows the controller to
output a constant voltage of 0% or 100% max power with the percent time over which it runs at
max power being set by the error signal. In other words, instead of controlling the amount of
power output from the system, the duty cycle runs at only two power settings (on or off) and runs
for a percentage of the time based on the difference between set point and actual output. The
PWM sub-VI is called by the PWM application test VI.
Trimberger 5
Get TF from Files 2012:
Figure 8 – Front Panel of “Get TF from Files 2012” VI.
Figure 9 – Block Diagram of “Get TF from Files 2012” VI.
Once a data set of measured and control voltages over time were created using the PWM
application test VI, they were imported into the Get TF from files 2012 VI. This VI solved for
the transfer function of the system based on the values imported.
Trimberger 6
PID Closed Loop Step Response:
Figure 10 – Front Panel of “PID Closed Loop Step Response” VI.
Figure 11 – Block Diagram of “PID Closed Loop Step Response” VI.
Using the transfer function created in the Get TF from files 2012 VI, various parameters
( , , and ) were determined based on the analytical solution of the transfer function described
above. These parameters remained constant when plugged into the overall transfer function of
Trimberger 7
the system. This overall transfer function also included the PID control gains which were
variable based on the desired control system. The PID closed loop step response VI allowed the
user to vary these PID control gains and visualize their effect on the system’s control.
Selecting PID Gain Values:
Figure 12 – PID Closed Loop Step Response with PID Gains: kp=550, ki=2, and kd=8.
After spending significant time varying the PID control gains, a consensus was made on
using the gains of kp = 550, ki = 2, and kd = 8 because it produced a system response with
minimal overshoot, initial heating time, and oscillations during settling time.
Figure 13 – PID Closed Loop Step Response with PID Gains: kp=200, ki=2, and kd=8.
Trimberger 8
Figure 14 – PID Closed Loop Step Response with PID Gains: kp=900, ki=2, and kd=8.
Decreasing the kp gain value while keeping the other parameters constant resulted in an
increase in initial heating time and a minor decrease in overshoot (Figure 13). Increasing the kp
value resulted in a slight decrease in the initial heating time but also produced a significant
increase in overshoot (Figure 14).
Figure 15 – PID Closed Loop Step Response with PID Gains: kp=550, ki=300, and kd=8.
Increasing the ki value, while keeping the other constant, resulted in an increase in the
overshoot and an increase in settling time.
Trimberger 9
Figure 16 – PID Closed Loop Step Response with PID Gains: kp=550, ki=2, and kd=30.
Increasing kd resulted in an decrease in the initial heating time but also increased settling
time.
Figure 17 – PID Closed Loop Step Response with PID Gains: kp=550, ki=2, and kd=2.
Decreasing kd resulted in a decrease in the initial heating time but also decreased the
settling time
Trimberger 10
Figure 18 – PID Closed Loop Step Response with PID Gains: kp=550, ki=0, and kd=0.
Examining a system with only proportional control, it can be seen that the initial heating
time and settling time is significantly longer, however there is minimal overshoot.
Figure 19 – PID Closed Loop Step Response with PID Gains: kp=550, ki=0, and kd=8.
Trimberger 11
Examining a system without integral control, it can be seen that the initial heating time is
significantly longer, but there is minimal overshoot and a short settling time.
Figure 20 – PID Closed Loop Step Response with PID Gains: kp=550, ki=2, and kd=0.
Examining a system without differential control, it can be seen that the initial heating
time is shorter but there is significant overshoot and an increase in settling time.
Therefore, in general, the kp value determines the initial heating time and the length of
the settling time. This type of control is required in all system which means that it cannot be
avoided. To solve the problems created by this type of control, integral and differential control
must be added. In general, the ki value decreases the initial heating time but also increases the
overshoot of the system. This seems logically sound because integral control sums up past errors
and fixes until there is absolutely no error. A common problem with proportional control is that
it rarely reaches the desired set point. Adding integral control solves this problem by ensuring a
steady state eventually; however it creates its own problem of overshooting and increasing the
settling time. Differential control is added to solve the problems created by integral control. In
general, it appears to decrease the overshoot of the system and decrease the settling time. This
argument is also logically sound because differential control examines the rate of change and
when this value gets too large, it is decreased so as not to overshoot the desired value.
Trimberger 12
Results:
Flow Chart for Complete PID Controller:
Figure 21 – Flow Chart for Complete PID Controller.
LabView Front Panel and Associated Block Diagram of Complete PID Controller VI:
Figure 22 – Front Panel of Complete PID Controller VI. Figure 23 – Block Diagram of Complete
PID Controller VI.
Convert User’s Input
Temperature to Voltage
= Set Point (Vset)
Calculate Error:
e(t)=Vset - Vmeasured
Implement
PID Algorithm
(kp, ki, kd)
Calculate u(t):
Sum of
Correcting Terms
Convert to Duty
Cycle (% time on)
to Correct for Error
DAQ Output
Regulation; Input
to “System” Stage
H(s) System
Breadboard,
Heater, etc.
Measure Voltage,
Vmeasured
(Corresponds to Tsystem)
-
Trimberger 13
Results of PID Controller Implementation:
Figure 24 – Temp. Profile w/ Gains: kp=550, ki=2, kd=8. Figure 25 – Temp. Profile w/ Gains: kp=200, ki=2, kd=8.
Figure 26 – Temp. Profile w/ Gains: kp=900, ki=2, kd=8. Figure 27 – Temp. Profile w/ Gains: kp=550, ki=300, kd=8.
Figure 28 – Temp. Profile w/ Gains: kp=550, ki=2, kd=30. Figure 29 – Temp. Profile w/ Gains: kp=550, ki=2, kd=2.
0 20 40 60 80 100 120
295
300
305
310
315
320
Temperature Profile over Time of System w/ PID Gains: kp
=550, ki
=2, kd
=8
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
0 20 40 60 80 100 120
295
300
305
310
315
320
325
Temperature Profile over Time of System w/ PID Gains: kp
=200, ki
=2, kd
=8
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
0 20 40 60 80 100 120
295
300
305
310
315
320
Temperature Profile over Time of System w/ PID Gains: kp
=900, ki
=2, kd
=8
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
0 20 40 60 80 100 120 140 160 180
295
300
305
310
315
320
325
330
Temperature Profile over Time of System w/ PID Gains: kp
=550, ki
=300, kd
=8
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
0 20 40 60 80 100 120
295
300
305
310
315
320
Temperature Profile over Time of System w/ PID Gains: kp
=550, ki
=2, kd
=30
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
0 20 40 60 80 100 120
290
295
300
305
310
315
320
Temperature Profile over Time of System w/ PID Gains: kp
=550, ki
=2, kd
=2
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
Trimberger 14
Figure 30 – Temp. Profile w/ Gains: kp=550, ki=0, kd=0. Figure 31 – Temp. Profile w/ Gains: kp=550, ki=2, kd=0.
Figure 32 – Temp. Profile w/ Gains: kp=550, ki=0, kd=8.
Discussion:
As seen from the results of the experiment, the kp, ki, and kd values appear to effect the
system as described in “Selecting PID gain values” section. The proportional control effects the
initial heating time but has difficulty reaching a steady state value (Figure 30). The addition of
integral control results in a definite steady state with the trade off of overshoot and increased
settling time oscillations (Figure 31). The additional of differential control returns the initial
heating time to its original value, while decreasing the overshoot and oscillations during settling
time (Figure 24). The other figures included in this section serve to solidify this conclusion.
Overall, the experiment went fairly well. There were slight difficulties in figuring out
where to start but once a flow chart was created, the rest was fairly simple. The only major
difficulty faced was that the output of the controller was resulting in a value so large that it was
running multiple duty cycle before rechecking the error. This logically makes sense because
0 20 40 60 80 100 120
290
295
300
305
310
315
320
Temperature Profile over Time of System w/ PID Gains: kp
=550, ki
=0, kd
=0
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
0 20 40 60 80 100 120
290
295
300
305
310
315
320
Temperature Profile over Time of System w/ PID Gains: kp
=550, ki
=2, kd
=0
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
0 20 40 60 80 100 120
290
295
300
305
310
315
320
Temperature Profile over Time of System w/ PID Gains: kp
=550, ki
=0, kd
=8
Time (sec)
Temperature(o
Kelvin)
Experimental Data
Set Point (315 o
K)
Trimberger 15
when the system is first heating, the duty cycle should be constant running. However, this is not
ideal when attempting to get a continuous plot. To solve this issue, a scaling algorithm was
implemented after the controller output to make the maximum controller output equal to the
maximum value of the duty cycle. This easily solved the problem because no matter how large
the error was the duty cycle would only run one time for 100% of the time and then recheck the
error. Also, towards the end of data collection, the epoxy holding the thermistor to the resistor
came undone. This was unfortunate but did not have a significant impact on the data collection.
Appendix:
MATLAB Code for Temperature Profile Plotting:
clear all; close all; clc;
% imports experimental data from .txt files %
data1 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_550_2_8.txt');
data2 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_200_2_8.txt');
data3 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_900_2_8.txt');
data4 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_550_300_8.txt');
data5 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_550_2_30.txt');
data6 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_550_2_2.txt');
data7 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_550_0_0.txt');
data8 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_550_2_0.txt');
data9 = load('C:UsersGerardDesktopBioen337 Lab4Data
FilesTemp_550_0_8.txt');
% sets PID gain values for use in for loop %
param1 = [550 2 8];
param2 = [200 2 8];
param3 = [900 2 8];
param4 = [550 300 8];
param5 = [550 2 30];
param6 = [550 2 2];
param7 = [550 0 0];
param8 = [550 2 0];
param9 = [550 0 8];
for i = 1:9
% creates a time span for each data set %
eval(['time = 1:length([data' num2str(i) '])']);
% creates a set point temperature for each time span %
eval(['setpnt = ones(1,length([data' num2str(i) ']))*315']);
figure
hold on
% plots the experimental temperature versus time graphs %
Trimberger 16
eval(['plot(time, [data' num2str(i) '])']);
% plots the set point temperature over time %
plot(time, setpnt, '--r')
% creates plot title, x axis label, y axis label, and legend %
eval(['param = [param' num2str(i) ']']);
title(['Temperature Profile over Time of System w/ PID Gains: k_p='
num2str(param(1)) ', k_i=' num2str(param(2)) ', k_d=' num2str(param(3))]);
xlabel('Time (sec)')
ylabel('Temperature ( ^o Kelvin)')
legend('Experimental Data', 'Set Point (315 ^o K)', 'Location', 'Best');
hold off
end

More Related Content

PPTX
Pid control
PPTX
PID Controllers
DOCX
PID controller
PPT
Control actions
PPTX
Pid control by Adarsh singh
PDF
Pi dcontroller
PDF
Level Control of Tank System Using PID Controller-A Review
PDF
PID controller in control systems
Pid control
PID Controllers
PID controller
Control actions
Pid control by Adarsh singh
Pi dcontroller
Level Control of Tank System Using PID Controller-A Review
PID controller in control systems

What's hot (20)

PDF
Controller Tuning Method for Non-Linear Conical Tank System
PPTX
Pid controllers
PPTX
PID Controller and its design
PPTX
PID Control Basics
PDF
PID Controllers
PPTX
P, PI AND PID CONTROLLER
PPTX
Pid controllers
PDF
PPTX
PID Control System
PDF
Pid controller
PPTX
Tuning of pid
PPTX
Pid controller
PPTX
08 pid.controller
PDF
pid controller
PPTX
Pid controller
PPTX
P I D CONTOLLER
PPTX
Proportional integral and derivative PID controller
PDF
Types of Controllers PID PD I PD
PDF
Cascade control of superheated steam temperature with neuro PID controller
PDF
Pid controller
Controller Tuning Method for Non-Linear Conical Tank System
Pid controllers
PID Controller and its design
PID Control Basics
PID Controllers
P, PI AND PID CONTROLLER
Pid controllers
PID Control System
Pid controller
Tuning of pid
Pid controller
08 pid.controller
pid controller
Pid controller
P I D CONTOLLER
Proportional integral and derivative PID controller
Types of Controllers PID PD I PD
Cascade control of superheated steam temperature with neuro PID controller
Pid controller
Ad

Viewers also liked (11)

PDF
implementing pid controller in c programing
DOCX
Control system
PDF
Optimized proportional integral derivative (pid) controller for the exhaust t...
PPTX
Ppt on simulink by vikas gupta
DOCX
Speed Control of DC Motor
DOCX
automatic plant irrigation using aurdino and gsm technology
DOCX
automatic plant irrigation using aurdino and gsm technology
PDF
To control the dc motor speed using PWM from LabVIEW
PDF
Automatic Plant Irrigator -Mini Project ECE(without micro controller)
DOCX
HOME AUTOMATION USING ARDUINO
PDF
Doc speed control of a dc motor using micro controller 8051
implementing pid controller in c programing
Control system
Optimized proportional integral derivative (pid) controller for the exhaust t...
Ppt on simulink by vikas gupta
Speed Control of DC Motor
automatic plant irrigation using aurdino and gsm technology
automatic plant irrigation using aurdino and gsm technology
To control the dc motor speed using PWM from LabVIEW
Automatic Plant Irrigator -Mini Project ECE(without micro controller)
HOME AUTOMATION USING ARDUINO
Doc speed control of a dc motor using micro controller 8051
Ad

Similar to PID Temperature Controller (20)

PDF
Control tutorials for matlab and simulink introduction pid controller desig...
PDF
Real-time PID control of an inverted pendulum
PDF
Somasundarreddy2020
PDF
Simulation analysis of Series Cascade control Structure and anti-reset windup...
PDF
call for papers, research paper publishing, where to publish research paper, ...
PDF
control system lab 02 - PID tuning
PDF
M0537683
PDF
Pid logix wp008--en-p
PDF
Design of a discrete PID controller based on identification data for a simsca...
PPT
1578385.ppt
PDF
Iaetsd design of fuzzy self-tuned load frequency controller for power system
PDF
Process Control Final Report
PDF
D04954148
PDF
Modern Control - Lec 06 - PID Tuning
PDF
Modeling, simulation and control of a robotic arm
PDF
Di34672675
PDF
Heat pump design using peltier element For temperature control of the flow cell
PDF
Heat Ventilation & Air- Conditioning System with Self-Tuning Fuzzy PI Controller
PDF
IRJET- Speed Control of Induction Motor using Hybrid PID Fuzzy Controller
PPTX
Temperature Control System Using Pid Controller
Control tutorials for matlab and simulink introduction pid controller desig...
Real-time PID control of an inverted pendulum
Somasundarreddy2020
Simulation analysis of Series Cascade control Structure and anti-reset windup...
call for papers, research paper publishing, where to publish research paper, ...
control system lab 02 - PID tuning
M0537683
Pid logix wp008--en-p
Design of a discrete PID controller based on identification data for a simsca...
1578385.ppt
Iaetsd design of fuzzy self-tuned load frequency controller for power system
Process Control Final Report
D04954148
Modern Control - Lec 06 - PID Tuning
Modeling, simulation and control of a robotic arm
Di34672675
Heat pump design using peltier element For temperature control of the flow cell
Heat Ventilation & Air- Conditioning System with Self-Tuning Fuzzy PI Controller
IRJET- Speed Control of Induction Motor using Hybrid PID Fuzzy Controller
Temperature Control System Using Pid Controller

More from Gerard Trimberger (8)

PDF
UWUnofficialTranscript
PDF
Grocery Store Classification Model
PDF
Optimal Vacation Itinerary Modeling
PDF
Climate Change Model
PDF
Cellular Metabolism Model
PDF
Novel In Vivo Concentration Detector
PDF
Thermocouples therm diff comsol
PDF
Ebola final project paper
UWUnofficialTranscript
Grocery Store Classification Model
Optimal Vacation Itinerary Modeling
Climate Change Model
Cellular Metabolism Model
Novel In Vivo Concentration Detector
Thermocouples therm diff comsol
Ebola final project paper

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Well-logging-methods_new................
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Construction Project Organization Group 2.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Geodesy 1.pptx...............................................
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPT
Mechanical Engineering MATERIALS Selection
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Welding lecture in detail for understanding
UNIT-1 - COAL BASED THERMAL POWER PLANTS
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Well-logging-methods_new................
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
CH1 Production IntroductoryConcepts.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Construction Project Organization Group 2.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
additive manufacturing of ss316l using mig welding
Geodesy 1.pptx...............................................
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Mechanical Engineering MATERIALS Selection
Automation-in-Manufacturing-Chapter-Introduction.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Welding lecture in detail for understanding

PID Temperature Controller

  • 1. Trimberger 1 PID Temperature Controller Figure 1 – Photograph of Feedback Circuit. Gerard Trimberger In collaboration with Gabriela Patilea and Gina Tran Section: AC March 13, 2012
  • 2. Trimberger 2 Methods and Materials Parts, Materials, and Equipment Used:  Breadboard & connecting wire  One TIP121 power transistor  One 5 Ω resistor, rated for 5 W called “low‐value resistor”  One Thermistor: 135‐202FAG‐J01, 135‐103LAG‐J01, or similar  Heat sink  Two 10kΩ resistor  Power supply  USB‐6009 data I/O device  Digital Computer with LabView program Circuit schematic diagram: Figure 2 – Circuit Schematic Diagram of System; H(s).
  • 3. Trimberger 3 General Principle and Theory of PID Controller: The general principle of any feedback control system is that the difference between the set point and the output of the system is defined as the error. This error is then fed back into the system in an attempt to bring the output of the system to the set point value. The simplest type of feedback control is proportional, such that the controller output is equal to the error multiplied by some proportional control gain constant. To improve the system’s performance, integral and differential terms can be added. Therefore the proportional-integral-differential (PID) controller algorithm can be written as: where, u(t) is “controller” output, MV is a manipulated variable, kp is proportional control gain, ki is integral control gain, kd is derivative control gain, and e(t) is the error of desired output and measured output (or set point – process value) over time. The Laplace of u(t) (PID algorithm) is, The transfer function of the system under control is, where, is the natural frequency and is the damping factor. The gain of the feedback loop is, By plugging in the previously defined functions for the Laplace of the PID algorithm and the transfer function of the system under control, the transfer function for the entire loop is, General Block Diagram of Feedback Control System Figure 3 – General Block Diagram of Feedback Control System.
  • 4. Trimberger 4 Supplied LabView VI’s and Their Purpose: PWM Application Test VI: Figure 4 – Front Panel of “PWM Application Test” VI. Figure 5 – Block Diagram of “PWM Application Test” VI. The PWM (pulse width modulation) application test VI was used to examine the system under control. The heating system circuit was build using the electrical components described above (Figure 2). A constant (control) voltage was run through the system and the output was recorded so that a data set of control voltages and measured voltages over time were created for the thermal heating system. PWM sub-VI: Figure 6 – Front Panel of “PWM sub-VI.” Figure 7 – Block Diagram of “PWM sub-VI.” The PWM sub-VI was used to create a duty cycle. A duty cycle allows the controller to output a constant voltage of 0% or 100% max power with the percent time over which it runs at max power being set by the error signal. In other words, instead of controlling the amount of power output from the system, the duty cycle runs at only two power settings (on or off) and runs for a percentage of the time based on the difference between set point and actual output. The PWM sub-VI is called by the PWM application test VI.
  • 5. Trimberger 5 Get TF from Files 2012: Figure 8 – Front Panel of “Get TF from Files 2012” VI. Figure 9 – Block Diagram of “Get TF from Files 2012” VI. Once a data set of measured and control voltages over time were created using the PWM application test VI, they were imported into the Get TF from files 2012 VI. This VI solved for the transfer function of the system based on the values imported.
  • 6. Trimberger 6 PID Closed Loop Step Response: Figure 10 – Front Panel of “PID Closed Loop Step Response” VI. Figure 11 – Block Diagram of “PID Closed Loop Step Response” VI. Using the transfer function created in the Get TF from files 2012 VI, various parameters ( , , and ) were determined based on the analytical solution of the transfer function described above. These parameters remained constant when plugged into the overall transfer function of
  • 7. Trimberger 7 the system. This overall transfer function also included the PID control gains which were variable based on the desired control system. The PID closed loop step response VI allowed the user to vary these PID control gains and visualize their effect on the system’s control. Selecting PID Gain Values: Figure 12 – PID Closed Loop Step Response with PID Gains: kp=550, ki=2, and kd=8. After spending significant time varying the PID control gains, a consensus was made on using the gains of kp = 550, ki = 2, and kd = 8 because it produced a system response with minimal overshoot, initial heating time, and oscillations during settling time. Figure 13 – PID Closed Loop Step Response with PID Gains: kp=200, ki=2, and kd=8.
  • 8. Trimberger 8 Figure 14 – PID Closed Loop Step Response with PID Gains: kp=900, ki=2, and kd=8. Decreasing the kp gain value while keeping the other parameters constant resulted in an increase in initial heating time and a minor decrease in overshoot (Figure 13). Increasing the kp value resulted in a slight decrease in the initial heating time but also produced a significant increase in overshoot (Figure 14). Figure 15 – PID Closed Loop Step Response with PID Gains: kp=550, ki=300, and kd=8. Increasing the ki value, while keeping the other constant, resulted in an increase in the overshoot and an increase in settling time.
  • 9. Trimberger 9 Figure 16 – PID Closed Loop Step Response with PID Gains: kp=550, ki=2, and kd=30. Increasing kd resulted in an decrease in the initial heating time but also increased settling time. Figure 17 – PID Closed Loop Step Response with PID Gains: kp=550, ki=2, and kd=2. Decreasing kd resulted in a decrease in the initial heating time but also decreased the settling time
  • 10. Trimberger 10 Figure 18 – PID Closed Loop Step Response with PID Gains: kp=550, ki=0, and kd=0. Examining a system with only proportional control, it can be seen that the initial heating time and settling time is significantly longer, however there is minimal overshoot. Figure 19 – PID Closed Loop Step Response with PID Gains: kp=550, ki=0, and kd=8.
  • 11. Trimberger 11 Examining a system without integral control, it can be seen that the initial heating time is significantly longer, but there is minimal overshoot and a short settling time. Figure 20 – PID Closed Loop Step Response with PID Gains: kp=550, ki=2, and kd=0. Examining a system without differential control, it can be seen that the initial heating time is shorter but there is significant overshoot and an increase in settling time. Therefore, in general, the kp value determines the initial heating time and the length of the settling time. This type of control is required in all system which means that it cannot be avoided. To solve the problems created by this type of control, integral and differential control must be added. In general, the ki value decreases the initial heating time but also increases the overshoot of the system. This seems logically sound because integral control sums up past errors and fixes until there is absolutely no error. A common problem with proportional control is that it rarely reaches the desired set point. Adding integral control solves this problem by ensuring a steady state eventually; however it creates its own problem of overshooting and increasing the settling time. Differential control is added to solve the problems created by integral control. In general, it appears to decrease the overshoot of the system and decrease the settling time. This argument is also logically sound because differential control examines the rate of change and when this value gets too large, it is decreased so as not to overshoot the desired value.
  • 12. Trimberger 12 Results: Flow Chart for Complete PID Controller: Figure 21 – Flow Chart for Complete PID Controller. LabView Front Panel and Associated Block Diagram of Complete PID Controller VI: Figure 22 – Front Panel of Complete PID Controller VI. Figure 23 – Block Diagram of Complete PID Controller VI. Convert User’s Input Temperature to Voltage = Set Point (Vset) Calculate Error: e(t)=Vset - Vmeasured Implement PID Algorithm (kp, ki, kd) Calculate u(t): Sum of Correcting Terms Convert to Duty Cycle (% time on) to Correct for Error DAQ Output Regulation; Input to “System” Stage H(s) System Breadboard, Heater, etc. Measure Voltage, Vmeasured (Corresponds to Tsystem) -
  • 13. Trimberger 13 Results of PID Controller Implementation: Figure 24 – Temp. Profile w/ Gains: kp=550, ki=2, kd=8. Figure 25 – Temp. Profile w/ Gains: kp=200, ki=2, kd=8. Figure 26 – Temp. Profile w/ Gains: kp=900, ki=2, kd=8. Figure 27 – Temp. Profile w/ Gains: kp=550, ki=300, kd=8. Figure 28 – Temp. Profile w/ Gains: kp=550, ki=2, kd=30. Figure 29 – Temp. Profile w/ Gains: kp=550, ki=2, kd=2. 0 20 40 60 80 100 120 295 300 305 310 315 320 Temperature Profile over Time of System w/ PID Gains: kp =550, ki =2, kd =8 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K) 0 20 40 60 80 100 120 295 300 305 310 315 320 325 Temperature Profile over Time of System w/ PID Gains: kp =200, ki =2, kd =8 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K) 0 20 40 60 80 100 120 295 300 305 310 315 320 Temperature Profile over Time of System w/ PID Gains: kp =900, ki =2, kd =8 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K) 0 20 40 60 80 100 120 140 160 180 295 300 305 310 315 320 325 330 Temperature Profile over Time of System w/ PID Gains: kp =550, ki =300, kd =8 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K) 0 20 40 60 80 100 120 295 300 305 310 315 320 Temperature Profile over Time of System w/ PID Gains: kp =550, ki =2, kd =30 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K) 0 20 40 60 80 100 120 290 295 300 305 310 315 320 Temperature Profile over Time of System w/ PID Gains: kp =550, ki =2, kd =2 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K)
  • 14. Trimberger 14 Figure 30 – Temp. Profile w/ Gains: kp=550, ki=0, kd=0. Figure 31 – Temp. Profile w/ Gains: kp=550, ki=2, kd=0. Figure 32 – Temp. Profile w/ Gains: kp=550, ki=0, kd=8. Discussion: As seen from the results of the experiment, the kp, ki, and kd values appear to effect the system as described in “Selecting PID gain values” section. The proportional control effects the initial heating time but has difficulty reaching a steady state value (Figure 30). The addition of integral control results in a definite steady state with the trade off of overshoot and increased settling time oscillations (Figure 31). The additional of differential control returns the initial heating time to its original value, while decreasing the overshoot and oscillations during settling time (Figure 24). The other figures included in this section serve to solidify this conclusion. Overall, the experiment went fairly well. There were slight difficulties in figuring out where to start but once a flow chart was created, the rest was fairly simple. The only major difficulty faced was that the output of the controller was resulting in a value so large that it was running multiple duty cycle before rechecking the error. This logically makes sense because 0 20 40 60 80 100 120 290 295 300 305 310 315 320 Temperature Profile over Time of System w/ PID Gains: kp =550, ki =0, kd =0 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K) 0 20 40 60 80 100 120 290 295 300 305 310 315 320 Temperature Profile over Time of System w/ PID Gains: kp =550, ki =2, kd =0 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K) 0 20 40 60 80 100 120 290 295 300 305 310 315 320 Temperature Profile over Time of System w/ PID Gains: kp =550, ki =0, kd =8 Time (sec) Temperature(o Kelvin) Experimental Data Set Point (315 o K)
  • 15. Trimberger 15 when the system is first heating, the duty cycle should be constant running. However, this is not ideal when attempting to get a continuous plot. To solve this issue, a scaling algorithm was implemented after the controller output to make the maximum controller output equal to the maximum value of the duty cycle. This easily solved the problem because no matter how large the error was the duty cycle would only run one time for 100% of the time and then recheck the error. Also, towards the end of data collection, the epoxy holding the thermistor to the resistor came undone. This was unfortunate but did not have a significant impact on the data collection. Appendix: MATLAB Code for Temperature Profile Plotting: clear all; close all; clc; % imports experimental data from .txt files % data1 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_550_2_8.txt'); data2 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_200_2_8.txt'); data3 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_900_2_8.txt'); data4 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_550_300_8.txt'); data5 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_550_2_30.txt'); data6 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_550_2_2.txt'); data7 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_550_0_0.txt'); data8 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_550_2_0.txt'); data9 = load('C:UsersGerardDesktopBioen337 Lab4Data FilesTemp_550_0_8.txt'); % sets PID gain values for use in for loop % param1 = [550 2 8]; param2 = [200 2 8]; param3 = [900 2 8]; param4 = [550 300 8]; param5 = [550 2 30]; param6 = [550 2 2]; param7 = [550 0 0]; param8 = [550 2 0]; param9 = [550 0 8]; for i = 1:9 % creates a time span for each data set % eval(['time = 1:length([data' num2str(i) '])']); % creates a set point temperature for each time span % eval(['setpnt = ones(1,length([data' num2str(i) ']))*315']); figure hold on % plots the experimental temperature versus time graphs %
  • 16. Trimberger 16 eval(['plot(time, [data' num2str(i) '])']); % plots the set point temperature over time % plot(time, setpnt, '--r') % creates plot title, x axis label, y axis label, and legend % eval(['param = [param' num2str(i) ']']); title(['Temperature Profile over Time of System w/ PID Gains: k_p=' num2str(param(1)) ', k_i=' num2str(param(2)) ', k_d=' num2str(param(3))]); xlabel('Time (sec)') ylabel('Temperature ( ^o Kelvin)') legend('Experimental Data', 'Set Point (315 ^o K)', 'Location', 'Best'); hold off end