Você está na página 1de 7

DESIGN OF A PID CONTROLLER FOR A RESISTIVE HEATING ELEMENT

Rachel Straughn
Group Members: Jasmine Graham, Yiming Li
March 17, 2017
BIOEN 337, Section C

INTRODUCTION • Thermistor: 135-202FAG-J01, 135-103LAG-J01,


or similar (10 kΩ NTC), $0.82
The ability to control temperature holds • Wire insulation
significant importance in the fields of healthcare and • Heat sink compound
clinical research. The performance of biological • Heat-shrink tubing, $7.29 for 127 pieces
systems is often highly dependent on a specific • Hot air gun
environment temperature, and scientists must be • 10 kΩ resistors, rated for 0.25 W
able to emulate these environments accurately and • 5-6 V power supply
consistently if they wish to produce the most realistic • Multimeter
results in their research. Controlled heating systems • USB-6008/9 or similar DAQ (data acquisition)
are especially useful for this application, and it is device
important to understand the way in which they • Computer with LabView
operate before utilizing them in temperature-
sensitive work and research. Methods
The goal of this lab was to build a PID-
controlled heated resistor circuit that uses feedback
for maintaining a desired set temperature. Personal
tasks and responsibilities included deriving formulas
used to convert voltage to temperature and vice
versa, circuit construction, LabView VI design, and
PID tuning. These processes were done with the oral
presentation application in mind, which was
ThermoCuddle, a temperature-controlled swaddling
blanket for infants.

METHODS AND MATERIALS

Materials
• Breadboard
• Wires
• Power MOSFET, such as NTD3055-094-1G (low
threshold voltage, minimum 1 A capacity), $0.34
Figure 1. Schematic of the circuit used for the heating
• 22 Ω resistor, rated for 2W, $0.99
element and for the detection of the heating element. Rth,
representing the thermistor, was connected to the 22Ω
resistor using heat sink compound and heat-shrink shown below, where the user may tune the constants
tubing. Rth is initially 10kΩ at room temperature, resulting such that the system outputs the desired response
in an equal voltage drop initially across Rth and Rfixed. The for the chosen biomedical application:
voltage across the thermistor will change as its 𝑡
𝑑𝑒(𝑡)
temperature increases, resulting in a different error value 𝑢(𝑡) = 𝑘𝑝 𝑒(𝑡) + 𝑘𝑖 ∫ 𝑒(𝜏)𝑑𝜏 + 𝑘𝑑
0 𝑑𝑡
calculated in LabView. The output from LabView is then
In this lab, the PID control was implemented using
sent back out through the DAQ to the MOSFET, where the
LabView, a visual system design platform, and then
power through the heated resistor will be controlled.
sent to the circuit as a voltage through a DAQ.
However, before the controlled voltage is
A Proportional-Integral-Derivative (PID)
passed to the circuit, it passes through a sub-VI that
Controller is a type of feedback system that
outputs a pulse with modulation (PWM). The PWM
measures an error value 𝑒(𝑡) from the difference
controls the average power through the circuit so
between a set point (usually controlled by the user)
that the power does not need to be set to the exact
and a measured output value. Depending on the size
value at all times. PWM controllers have outputs that
of this error, the controller will work to correct that
are either on at full power or off, with the duration
error using a sum of proportional, integral, and
of the on time determined by the error value. For
derivative terms relating that error.
instance, the on time will be larger when the error is
The proportional term yields an output term
10°C than when the error is just 0.2°C. These pulses
that is proportional to the error value, and can be
are usually quite fast, occurring several times per
adjusted such that 𝑃 = 𝑘𝑝 𝑒(𝑡), where 𝑘𝑝 is the
second, but the resistor acts as a low-pass filter and
proportional constant. In other words, the
it is virtually impossible to know that power (or heat)
proportional term brings the system output close to
has been applied in pulses at distances away from
the set point, but with purely proportional control,
the point of application. When the PWM is off, the
the output will never quite reach the set point. The
resistor cools passively by dissipating heat to the
integral control term integrates the error over time,
environment around it.
meaning it depends on both the magnitude and
duration of the error multiplied by the integral
𝑡
constant 𝑘𝑖 : 𝐼 = 𝑘𝑖 ∫0 𝑒(𝜏)𝑑𝜏. The integral control
component eliminates the steady-state error that
occurs with purely proportional control, but because
it sums all of the past errors, is prone to overshoot
Figure 2. General block diagram of the feedback control
the set point and oscillate before eventually settling
system utilized in this lab. The Sum, Controller, and Duty
on the set point. The derivative term calculates the
Cycle steps were implemented using LabView. The
rate of change of the error and multiplies it by the ‘System’ block represents the system’s intrinsic response,
𝑑𝑒(𝑡)
derivative constant 𝑘𝑑 : 𝐷 = 𝑘𝑑 𝑑𝑡
. The derivate which can be understood through its transfer function.
control works to predict system behavior and
dampen overshoot and oscillations caused by the Before the group designed a brand new
integral term, thus resulting in the system reaching LabView VI, this lab involved using and
steady-state faster than without derivative control. understanding a series of VIs supplied by the
The resultant governing equation of PID control is teaching staff. The fist, titled ‘PWM application.vi,’
was used for obtaining files indicating the voltage constant amplitude around the set point. The derivative
output with a control ramp voltage input. This file control ensures that the amplitude of these oscillations
contained a sub-VI implemented the pulse with does not increase.

modulation with an indicator of the duty cycle, which


displays the percentage of time that the output is on
at full power. The second VI, ‘Get TF from files
2012.vi,’ used the data from the ‘PWM application’
to obtain the transfer function 𝐻(𝑠) of the circuit
system, which characterizes the controlled system’s
response to an input. The transfer function for the
group’s system appeared as follows:
5.93469
𝐻(𝑠) =
1476.41𝑠 2 + 4964.32𝑠 + 1
The third LabView file, titled ‘pid-closed-loop-
stepResponse.vi,’ utilized the transfer function Figure 4. The system response with Kp = 2000, Kd = 0,
obtained in the second VI and allowed the user to and Ki = 1000. Without derivative control, there is no
alter the proportional, integral, and derivative ability for the system to control the initial large overshoot
constants and investigate the effects different caused by the integral control. The system appears to
reach steady-state and the set point in about 30 seconds.
combinations of constants have on the behavior of
the output.
The results from the investigation of the last
VI mentioned above are shown below. It is important
to note that the ratio between the constants is what
truly determines the behavior of the system, not the
magnitude of the values.

Figure 5. The system response with Kp = 2000, Kd = 1000,


and Ki = 0. Without any integral control, the system shows
no oscillations as it approaches steady-state in about 15
seconds. In this case, it appears that the steady-state is
equal to the set point, but more time spent with the actual
system in this lab will determine if a response like this is
possible without any integral control.
Figure 3. The system response with Kp = 0, Kd = 3000,
and Ki = 1000. Without any proportional control, the
system cannot stay within a close range around the set
point (which is 1 in this case), and instead oscillates with
Figure 6. The system response with Kp = 2000, Kd = 2000,
and Ki = 2000. When all three constants are equal, it Figure 8. The system response with Kp = 2000, Kd = 5000,
appears that each influences the output equally. The and Ki = 2000. When the derivative control is relatively
system approaches the set point quickly due to the large, the oscillations caused by the integral control are
proportional and integral control, but the overshoot is reduced in amplitude and the output remains closer to
relatively large because the effect of the derivative and the set point as it settles to steady-state.
integral control are equal, therefore the derivative control
cannot dampen the oscillations as much as in other cases.

Figure 9. The system response with Kp = 2000, Kd =


2000, and Ki = 5000. When the integral control is relatively
Figure 7. The system response with Kp = 5000, Kd = 2000, large, the damping from the derivative control has less of
and Ki = 2000. When the proportional constant is an effect and the system quickly increases toward the set
point, quickly overshoots it, and quickly oscillates with
relatively large, the system accurately approaches the set
decreasing amplitude until the steady-state/set point is
point and tends to remain around that set point as soon
reached at around 20 seconds.
as possible. The existence of the integral control ensures
that the steady-state value is equal to the set point.
RESULTS
The group’s biomedical temperature control
application, the ThermoCuddle, presented a variety
of specifications that were to be met by tuning the
PID constants such that the system responded in the
appropriate manner to a desired input temperature. that finite range of acceptable body temperatures for
These specifications included a moderate steady- infants.
state time (no more than 5 to 10 minutes), little to
no overshoot (less than 0.5°C above set point), and
the ability for the system’s steady-state value to
match exactly that of the set point. The following
images depict the front panel and block diagram
design of the VI used by the group to create a proof-
of-concept for the biomedical application.

Figure 12. Block diagram for the group’s PID controller.


The top portion contains steps for converting the set
point from a temperature to a voltage value, which then
has the system’s voltage reading subtracted from it to
produce the error. In the lower left corner, the error is
passed through the PID control and fed into the pulse
Figure 10. Resulting LabView front panel. The plot with modulation in the bottom right corner. The output
displays the resistor temperature (in degrees Celsius) over voltage is then converted back to a temperature reading
time (in seconds). The desired temperature (in degrees and displayed in the front panel to ensure that the system
Celsius) and PID constants are all easily adjusted from the is behaving as desired. If not, the PID constants are
front panel. adjusted and the process continues.

The equations used for converting the set


point to a voltage reading and the output voltage to
temperature (seen in the MathScript nodes in Figure
12 above) were as follows:
𝑣𝑖𝑛
𝑣𝑠𝑒𝑡 = 1 1
𝑒 𝛽(𝑇𝑠𝑒𝑡−𝑇𝑜) + 1
1 𝑅𝑓𝑖𝑥𝑒𝑑 𝑣𝑖𝑛 1
Figure 11. An additional LabView front panel component, 𝑇𝑡ℎ = ( ln [ ( − 1)] + )−1
𝛽 𝑅𝑜 𝑣𝑎 𝑇𝑜
meant to demonstrate the user interface for the Where 𝑣𝑖𝑛 was equal to 6V, β was equal to 3974K, 𝑅𝑜
ThermoCuddle product. The user can input a desired
was equal to 10kΩ, and 𝑇𝑜 was equal to 298K. 𝑇𝑠𝑒𝑡
temperature within a finite range (36.1- 37.2°C), observe
was converted to Kelvin prior to the MathScript node
the real-time system temperature, and use an indicator
such that the units of all variables matched and
that flashes green once the system temperature is within
produced a result with the proper units.
The PID constants were easily adjustable would be to either reduce the integrator control or
from the front panel. From the specifications, the increase the derivative control in order to reduce the
group knew that some ratio of all three constants magnitude of the overshoot.

was needed in order to have the desired response.


The integrator constant would most likely be much
smaller than the derivative constant such that most
of the overshoot would be dampened and that the
output would reach set point within a reasonable
amount of time—5 to 10 minutes was a relatively
long time range to reach steady-state for these
systems so it was not crucial that the integrator acted
quickly. The proportional constant would most likely Figure 14. The second system response run with set point
be large in comparison to the integrator as well so 36.1°C, Kp = 10, Ki = 0.075, and Kd = 20. In this response,
that the output closely approached the set point. the system never quite reaches the set point in the given
However, the proportional constant introduces time frame, which spans about 7 minutes. It appears that
some instability concerns as it increases in the overshoot issue seen in the first attempt has been
magnitude, and it became apparent that it could not resolved. The next attempt should either increase the
proportional control such that the steady-state value
be set above 12, otherwise the system would heat
approaches the set point, or increase a combination of
well above the set point and not return.
two constants such that the integrator brings the output
The following images depict the results of
to set point but remains dampened with minimal
the group’s tuning trials in an effort to meet all of overshoot.
the specifications set by the ThermoCuddle
application and display a proof of concept for the
product.

Figure 15. The third system response attempt met all of


the biomedical application specifications, with set point
36.1°C, Kp = 12, Ki = 0.1, and Kd = 20. The trial started
with the system at room temperature, which is roughly
25°C. The plot above is zoomed in on the steady-state,
which shows small oscillations (about 0.2°C in magnitude)
Figure 13. The first system response curve attempt with
around the set point, about 5 minutes after the trial
set point 36.1°C, Kp = 10, Ki = 0.1, and Kd = 20. In this
started. These small oscillations may have been a result of
response, the system overshoots the set point by 0.4°C,
the pulse with modulation or the increased integral
which was unacceptable by the groups specifications.
control, and are acceptable because a 0.1-0.2°C change in
However, it does appear to reach the set point and remain
temperature is not discernable by the human body.
close to it after about two minutes. The next attempt
CONCLUSIONS
This lab successfully resulted in a proof of
concept for the biomedical application of
ThermoCuddle, a temperature-controlled swaddling
blanket for infants. Challenges arose mostly in the
construction of the LabView VI in that LabView is a
programming language of its own and requires time
to understand how to best handle the transfer of a
Figure 16. A zoomed-out image of the same system
signal through the block diagram. After some trial
described in Figure 15, displaying the entire behavior of
and error, the group became familiar with the
the system from Time = 0 seconds. The system
LabView language and was able to successfully
approaches the set point quickly from room temperature,
but slows in rate as the error decreases. This results in little implement the PID control and pulse with
to no overshoot, and the system steadily approaches modulation components of the system, as well as
steady-state/set point over the span of approximately five transfer the signal through a DAQ back to the heated
minutes. circuit.
Even more, a solid hands-on understanding
A firm understanding of LabView and PID of PID control systems was obtained, giving the
control systems resulted in the group’s successful group members the ability to implement these skills
tuning of the PID constants and creation of the in future research or industry work. PID control
desired system response to an initial difference in systems, especially for the application of
system temperature and set point temperature. temperature control, are found everywhere in the
Part of this success can be attributed to the biomedical field, as many products and systems
advice and feedback of the teaching team during must operate at specific temperatures. Further
this lab as well as throughout the quarter. In this lab, implementation of PID control systems can only
the premade LabView VI’s proved to be especially work to improve the quality of the work being
helpful in deconstructing the steps of the overall currently done in the biomedical field, and the group
feedback system such that the group was better able members could have a part in doing so someday.
to understand the operation of each component. “Soft skills” were also gained refined in this
Additionally, the teaching staff encouraged lab, as the group had to communicate and work
questions and creativity throughout the quarter, together as a team to design the control system,
which helped in the tuning process of the PID select a biomedical application, tune the PID
controller. The group was constantly analyzing the constants, and organize an oral presentation to pitch
output results to ensure that they made sense in the the idea to fellow classmates and the teaching staff.
context of the situation and troubleshooting the These skills will prove to be useful no matter what
block diagram and PID constants such that the field the group members find themselves in in the
system response aligned with the specifications set future.
by the biomedical application.

Você também pode gostar